texts: Hide action-edit on cart page if simple product

texts:
I'm really struggling with the following scenario:

On the checkout page, you have an action toolbar for each product:
- Add to wishlist
- Edit
- Remove

Now, I'm trying to hide the 'Edit' function from the frontend when the product that has been added to the cart is an simple product. The edit button has no function for these particular products, so I'd love to see it not being there.

I've been trying to modify the default.phtml, with the following code:

 <?php if (!$product->getTypeId() == \Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE): ?>
                <script type="text/javascript">window.alert('test alert')</script>
                <style type="text/css">.action.action-edit{display:none;}</style>
 <?php endif;?>

It verifies if the product is not an configurable product, and if not (so it is an simple product), it hides the action-edit. But of course, this will remove it for every item in cart.

I could not figure out where else to put the code or how to do it differently. If someone is able to help, I'd be grateful.


texts: Magento 2: Is it possible to create Product attributes sets and their options programmatically but not during the install

texts:
We are developing a REST API that extends magento 2's functionality. One thing we need this API to do is to create attributes "on the fly" based on the custom JSON product payload sent.

For example part of the product payload will contain:

options: [
   {
      code: "Country Made",
      value: "New Zealand",
   },
   {
      code: "Color",
      value: "Red"
   }
]

In this example, when creating the product, it will create a new attribute "Country Made" because it doesn't exist, and assign the existing attribute "Color" to the Color field.

Ive seen a lot of forum posts showing how to add attributes using the InstallData but none on how to add attributes by calling a function or model.

I've also seen a few on how to do it via the command line, we also can not do this

Im also asking for our magento developer - I roughly know how to read PHP and have a basic understanding of magento, so try to keep it simple so I can answer any questions you might have :)

Thanks in advance!


texts: Magento2 How to change the mobile menu breakpoints from 767px to 1024px?

texts: I would like to display mobile menu for tablet or iPad, for testing I have changed the media breakpoints from 767px to 1024px  directly in lib/web/mage/menu.js but it's not working. where I have to change to achieve it? I am working on Magento 2.3.5.


texts: What are the first steps in exploring Magento 2?

texts:
I am planning to start out with Magento 2.
Could you  please advise me on the first steps of transition from Magento 1 to Magento 2? I have quite little experience with Magento 1 development, but judging by M2 code, everything seems to be drastically changed. Can you suggest me to study any trusted, relevant resources?

Also, I would like to know how the basic principles have been changed, I mean: catalog, products, quotes, carts. If someone can share the experience of migrating from M1 to M2 ( the popular issues and their solutions) it will be very useful and I will be highly grateful.

P.S. I have already installed M2 and it has not caused any issues. I am highly interested in the extensions development and customizations.


texts:
I got a error if i use Pay pal

  PayPal gateway has rejected request. Currency is not supported
  (#10605: Transaction refused because of an invalid argument. See
  additional error messages for details)


texts: Why does DataProvider (UiComponent) expect custom data to have custom attributes?

texts:
I've built an admin grid following a few tutorials and hit this error:

  Warning: Invalid argument supplied for foreach() in /home/sadmin/mage/lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/DataProvider.php on line 253

I went to the file and saw this function:

protected function searchResultToOutput(SearchResultInterface $searchResult)
{
    $arrItems = [];

    $arrItems['items'] = [];
    foreach ($searchResult->getItems() as $item) {
        $itemData = [];
        foreach ($item->getCustomAttributes() as $attribute) {
            $itemData[$attribute->getAttributeCode()] = $attribute->getValue();
        }
        $arrItems['items'][] = $itemData;
    }

    $arrItems['totalRecords'] = $searchResult->getTotalCount();

    return $arrItems;
}

for my data, there are no custom attributes, so how do I bypass this part of the function for my grid to load? Var_dumping my $searchResult->getItems() shows my table data so I'm not sure why this is needed, any help or explanations are much appreciated :)

Thanks!


texts: Upload Image Folder zip for Image of products in Magento 2.1

texts:
I want to upload products image folder (Zip format) from Admin ,

The uploaded folder suppose to go pub/media/import folder where zip folder can unzip programmatically.

 Images can be in jpeg/png. format.
  How can I approach to achieve this.


texts: Get product price after applied Catalog Price Rule

texts:
I have created a catalog price rule in Magento adminarea.

For ex. Product A's price is 100 and after applying the catalog price rule, its price becoming 80.

I am trying to fetch the price 80 programmatically but the below code is returning original price only i.e. 100.

$product->getPrice();
$product->getFinalPrice();


texts: In Magento 1.9, how can I set a custom field for an order?

texts:
I need to have one more additional field for each order. I can add this attribute with this code:

<?php
$installer = $this;
$installer->startSetup();

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$setup->addAttribute('order', 'order_dropship_export_status', array(
        'position'          => 1,
        'type'              => 'text',
        'label'             => 'order_dropship_export_status',
        'global'            => 1,
        'visible'           => 1,
        'required'          => 0,
        'user_defined'      => 1,
        'searchable'        => 0,
        'filterable'        => 0,
        'comparable'        => 0,
        'visible_on_front'  => 1,
        'visible_in_advanced_search' => 0,
        'unique'            => 0,
        'is_configurable'   => 0,
        'position'          => 1,

));

$installer->endSetup();

and the field is added to the eav_attribute table in Magento. However, when I set it using:

$order = Mage::getModel("sales/order") -> load($a_ids[0]);
$order -> setOrderDropshipExportStatus("XXXXXX");
$order -> save();

it is not saved anywhere. Where and how can I save this attribute for an order?


texts: add new column to catalog product entity table

texts:
I add new column to catalog_product_entity. so when i want to add new filter to collection i get this error
The "user_id" attribute name is invalid. Reset the name and try again.

$subject->getCollection()->addFieldToFilter('user_id', array('eq' => '2'))


texts: Redirect after place order got issue in CE 2.1.0

texts:
I developed a Magento CE 2.0 payment module.It's procedures are:

Select the payment method and choose the bank.
Place order.
After place order successful, customer will redirect to payment gateway
page.
Gateway page will back to magento page after customer done payment.
If the paymen process is success, customer will be redirected to order success
page.

I wrote it first time in Magento CE 2.0.7 and everything worked perfectly. However, when I was using it for magento CE 2.1.0, the module couldn't run redirect action after place order successful.

I put my redirect url in method.js file by overriding afterPlaceOrder of default.js from Magento Checkout module as below:

/**
* After place order callback
*/
afterPlaceOrder: function () {
    $.mage.redirect(window.checkoutConfig.payment.ideal.redirectUrl);
},

After investiged some things I reconize some issue such as:

In Magento CE 2.0.7, the success page order requrest run first, then the gateway payment redirect request run. Everything worked fine.
In Magento CE 2.1.0, it happened opposite. The gateway payment redirect request run first. Then the success page order requrest run, and it replaced the first one. As a result, the gateway payment redirect request was aborted, it go straight to order success page without redirect to payment gateway page.

Apache log request:

(Magento CE 2.0.7)
127.0.0.1 - - [22/Jul/2016:11:59:09 +0700] "POST /rest/default/V1/carts/mine/payment-information HTTP/1.1" 200 349 "http://192.168.200.62/checkout/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
127.0.0.1 - - [22/Jul/2016:11:59:17 +0700] "GET /checkout/onepage/success/ HTTP/1.1" 200 7443 "http://192.168.200.62/checkout/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
127.0.0.1 - - [22/Jul/2016:11:59:17 +0700] "GET /customer/section/load/?sections=cart%2Cmessages&update_section_id=true&_=1469163514364 HTTP/1.1" 200 788 "http://192.168.200.62/checkout/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
127.0.0.1 - - [22/Jul/2016:11:59:17 +0700] "GET /ideal/ideal/redirect?_secure=true&bank_id=1234 HTTP/1.1" 302 732 "http://192.168.200.62/checkout/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"

(Magento CE 2.1.0)
127.0.0.1 - - [22/Jul/2016:11:54:58 +0700] "POST /magento210/rest/default/V1/carts/mine/payment-information HTTP/1.1" 200 379 "http://localhost/magento210/checkout/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
127.0.0.1 - - [22/Jul/2016:11:55:07 +0700] "GET /magento210/ideal/ideal/redirect/?_secure=true&bank_id=0771 HTTP/1.1" 302 802 "http://localhost/magento210/checkout/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
127.0.0.1 - - [22/Jul/2016:11:55:07 +0700] "GET /magento210/checkout/onepage/success/ HTTP/1.1" 200 7648 "http://localhost/magento210/checkout/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"
127.0.0.1 - - [22/Jul/2016:11:55:07 +0700] "GET /magento210/customer/section/load/?sections=cart%2Clast-ordered-items%2Cmessages&update_section_id=true&_=1469163137422 HTTP/1.1" 200 1161 "http://localhost/magento210/checkout/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0"

The redirect request is aborted on firefox developer tool screen:

I also check the /view/frontend/web/js/view/default.js from Magento Checkout module core. It is much different between two version CE 2.0.7 and CE 2.1.0.

Now, I'm getting stuck at this problem and haven't found a solution for it. Please give me some advise if I made something wrong!


texts: Magento 1 - How to get relevant 'tax_calculation_rate_id' from order items

texts:
I'm trying to get 'tax_calculation_rate_id' by iterating through ordered products.

The following code works ok, but the problem arises when there are multiple ids assigned to the same percentage values (e.g. "VAT exempt rate" at 0% and "EC Sales rate" at 0%)

Is there a better way to get the rate ids calculated?

Thank you for your help!

// $line_item and $address come as arguments

$store = Mage::app()->getStore();
$product_class= Mage::getModel('catalog/product')
                         ->loadByAttribute('sku',$line_item->getSku())
                         ->getTaxClassId();
$tax_model = Mage::getSingleton('tax/calculation');
$request = $tax_model->getRateRequest($address, null, null, $store);
$percent = $tax_model->getRate($request->setProductClassId($product_class));

$rates = Mage::getModel("tax/calculation_rate")
                         ->getCollection()
                         ->addFieldToFilter('rate', array('eq'=>$percent));
foreach ($rates as $rate)
{
    $mage_rate_id = $rate->getTaxCalculationRateId();
    // if more than 1 rate exits it obviously picks the last one
}


texts: Magento 2.0.17 Category page Error - Uncaught ReferenceError: updateContent is not defined

texts:
I am creating a Root/Sub Category from Category page. But in console, showing following error:

I am using magento v2.0.7.

Browser: Chrome latest version


texts: What exactly does cleanAllSessions() does?

texts:
I came accross a line Mage::app()->cleanAllSessions(); and going through the function I saw that it fetches the session save path and deletes it. i havent specified any session_save_path in my local.xml and have all my sessions saving in files, when i run this code it doesnt really clears the var/session folder, so what does it do actually?

FYI, calling session_save_path() returns c:\xampp\tmp.


texts: Integrating Premium Rate Shipping with Shipwire

texts:
Have a Magento integration that's using Premium Rate for shipping.  The shipping method for 2 Day shipping is premiumrate_2day.  Shipwire expects the shipping_method value in the order API that it pings to contain 2D.

It looks like I will need to rewrite the Mage_Sales_Model_Order_Api class in order to map our shipping methods to the ones that they expect.  This seems like a bit of a heavy hammer for what I would have imagined would be a pretty common scenario.

Can someone tell me if there are a couple of configuration options I'm missing somewhere?


texts: Magento product Images are uploading but not showing up after upload in backend and frontend

texts:
When trying to upload a product image, it stays stuck on "Complete", like this and nothing happens.

My Magento version is 1.9.3.2 I've changed the media folder permissions also checked removing the cache storage, flushed the Magento cache, reindexed the data, and nothing seems to be working.

Have also enabled all php extensions.


texts: Where I have to upload a file phpcs.xml to install marketplace-eqp from https://github.com/magento/marketplace-eqp/tree/master/MEQP2


texts: Error after installing extension , Unable to access configuration in store, Mageplaza Extension

texts:
Notice: Undefined index: id in
  /home/208806.cloudwaysapps.com/mnaanucsmd/public_html/vendor/magento/module-config/Model/Config/Structure/Element/Iterator.php
  on line 63

Error log record number: 1370744923540.

Got this error after trying to install a new module/extension mageplaza SMTP extension.

My iterator.php

public function setElements(array $elements, $scope)
    {
        $this->_elements = $elements;
        $this->_scope = $scope;
        if (count($elements)) {
            $lastElement = end($elements);
            $this->_lastId = $lastElement['id']; //<--- Line 63 is here
        }
    }


texts: Contributing to magento hackathon Github

texts: I'm wanting to contribute to the magento hackathon github page https://github.com/magento-hackathon .Does it need to be during a hackathon or can anyone contribute at anytime? And Do they accept PR's?


texts:
Which file do I amend to add a callback function whenever the system is trying to generate new entry in sales_flat_invoice?

Version 1.4.1.1


texts: Where’s The V in Magento's MVC? And is there better name?

texts: When you look at the Magento directory structure, the C for ‘controller’ and the M for Model are easily identified as files and classes. But where are the Views and what are they?


texts:
I don't have SSH access and cannot find where to download a FTP version of 7405 1.1, currently magentary.com does not contain the 1.1 patch. Does anyone have an idea how to get it or if it is possible to patch a .sh file with no SSH access.

Thankyou


texts:
On our category view in grid mode, our images got all different sizes. (see screenshot)
Images already got a max-height class to give them all the same height.
The problem of this is inside the image-file, because some images got more white space around the product than others.

We get our images from a open catalog with product images.

Beside changing the images manually, by uploading the correct format.
Is there an other way to give all our product images the same height and white space?
(So I mean that some images got more white space than others, so that they look all the same)


texts: Layouts of cms page don`t work in magento 2

texts:
I want to stylize the cms page 404. Content added through the admin page. To override the layout I created a file cms_index_noroute.xml in  app/design/frontend/mytheme/Magento_Cms/layout. However, the page does not see this file, it does not apply. I tried to rename the file in cms_noroute_index.xml. But no result. But at the same time the file default.xml is used, and my 404 page it sees. But I need a separate file for this particular page.
File code:

<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="css/views/cms-styles.css" />
</head>
<body>
    <referenceBlock name="title" remove="true"/>
</body></page>

Could someone help me with this?
Thank you so much!


texts: How to deploy magento 1.9.X module to 2.X module

texts:
I need to deploy my custom modules from 1.9.X to 2.0.X,

Is there any way to deploy, or we will start from scratch.?


texts: Magento Adminpanel - Custom Grid Error on Filter

texts:
I have created a custom Grid in the adminpanel where i need to show orders and the last comment for the order. I did this by adding Join in the _prepareCollection function and the data is showing properly.

protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel($this->_getCollectionClass());
        $subquery = new Zend_Db_Expr('(SELECT parent_id,MAX(entity_id) as comment_id,created_at as comment_date,comment FROM sales_flat_order_status_history GROUP BY parent_id ORDER BY `sales_flat_order_status_history`.`parent_id` DESC)');
        $collection->getSelect()->joinLeft(array('c'=>$subquery), 'c.parent_id = main_table.entity_id', array('c.*'));
        //echo $collection->getSelect();exit;
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

However if i try to filter the comment column its showing following error.

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'comment' in 'where clause'

What i'm missing. Please help me to resolve this.


texts:
i would like add a colum in my invoice PDF.

so I changed the "draw ()" function found in the "app / code / core / Mage / Sales / Model / Order / Pdf / Items / Invoice" file by adding "item-> getEan ()

but i dont'woks.What method should I use to get the "EAN"?

thank you


texts: Please specify the product's option(s). in Magento 1.9.1.0

texts:
I am getting this error message after clicking the addtocart in configurable product and it redirects to same page for ex on: example.com/shoes/ballet-flats/sample-product-for-size.html it will redirect to example.com/sample-product-for-size.html and it will showing the above

This is the addtocart button:

Add to Cart

I am getting the above after clicking the addtocart in configurable product and it redirects to same page for ex:http://www.domain.com/shoes/ballet-flats/sample-product-for-size.html it will redirect to http://www.domain.com/sample-product-for-size.html and it will

This is the console error


texts:
Following is my theme's layout.xml, but seems like it it not loaded

<?xml version="1.0"?>
    <layout>
      <default>
        <reference name="content" after="*">
        <block type="cms/block" name="test.c">
            <action method="setBlockId">
                <block_id>contact</block_id>
            </action>
        </reference>
      </default>
    </layout>

I tried removing after="*" but it didn't work, is my syntax wrong?
It is located under app/design/frontend/{my_theme}/{my_package}/layout/local.xml


texts: Does Magento 2 has a Fallback Directory as /tmp/magento?

texts:
I know that in Magento 1 the directory "/tmp/magento" was used as fall-back in case it existed.

I would like to know if that is still the case in Magento 2.


texts: Force page rendering after new HTML is loaded by AJAX

texts:
I have a 3rd party extension for layered navigation in Magento 2.2.1. Products listing is repainted (using ajax) after customer changed the navigation filter (categories)  There is some visual error in product details after new HTML code loaded with ajax is inserted into the DOM (all products on the page have the same failure):

This failure is disappeared after browser window is resized manually:

I have tried to use $(window).trigger('resize') but unsuccessfully:

    updateContent: function (url, updateState) {
        ...
        $.ajax({
            ...
            success: function (resp) {
                if (resp instanceof Object) {
                    /* replace inner HTML for products listing with new one */
                    $(window).trigger('resize'); // does not work :(
                }
            }
        });
    },

Does any method exist to refresh/repaint/render the page programmatically after HTML was changed?

The same effect (wrong order of the blocks then right order) exists on the page loading - wrong order leave about 1 second while page is loading and blocks order is restructured after the page is completely loaded. I believe there is some Magento JS function that does something like I need.


texts: how to set base image in coding while adding image programmatically

texts:
I added the code to update the product images programmatically.

Please refer the below code

$firstProduct  = Mage::getModel ('catalog/product')
                        ->load($firstProductId);

$firstProduct->setMediaGallery (array('images'=>array (), 'values'=>array ()))
                    ->addImageToMediaGallery(
                        $filePath,
                        array('image','thumbnail'),
                        false,
                        false
                    );
$firstProduct->save();

/*debug*/
$mediaGallery = $firstProduct->getMediaGallery();
print_r($mediaGallery);

My doubt here is, how to set added image as base image.

Thank you for your valuable inputs


texts: magento 1 query generated back tics are wrongly placed

texts:
I have an issue in Magento 1, where the SQL query that is getting generated has the back tics wrongly placed.

This is a piece of the code that helps to provide the collection to the grid layout.

protected function _prepareCollection(){

    $accountId = $this->getRequest()->getParam('id');
    $collection = Mage::getResourceModel('testmodule/coupon_collection');

    if (Mage::helper('testmodulecoupon')->isMultiProgram()
        && Mage::helper('core')->isModuleEnabled('Test_module')
    ){
        $collection->getSelect()->joinLeft(
            array('p'   => $collection->getTable('testmodule/account')),
            'main_table.program_id = p.program_id AND main_table.account_id = p.account_id',
            array()
        )->joinLeft(
            array('r'   => $collection->getTable('testmodule/program')),
            'main_table.program_id = r.program_id',
            array('status' => 'IF (main_table.program_id = 0, 1, IF(p.id AND r.use_coupon, 1, 0))')
        );
    } else {
        $collection->addFieldToFilter('program_id', array('eq'=>0));
    }
    $collection->addFieldToFilter('main_table.account_id',$accountId);

    $this->setCollection($collection);
    return parent::_prepareCollection();
}

In the above code, this part of the line is generating the back tics wrongly.

array('status' => 'IF (main_table.program_id = 0, 1, IF(p.id AND r.use_coupon, 1, 0))')

This is part of SQL query that is generating.

(`IF (main_table`.`program_id = 0, 1, IF(p`.`id AND r`.`use_coupon, 1, 0))` = '1')

I was not able to find a proper solution to fix this. Can anyone help on this ?
thanks


texts: How to optimally find the total no of orders canceled, processed, pending, shipped from the Order collection?

texts: How to find the number of orders canceled, processed, pending etc from the order collection. Currently I am clearing the loaded collection and applying the filters and calling count. So for all the status I am getting the count. But When checked the mysql logs I understand that its making lot of queries, Is there way I can do it optimally.?


texts:
I'm having major issues with the static content deploy command because it doesn't give any errors but it isn't fixing my issue. Here is what my website looks like currently:

Here are the results of what I have tried:

Magento compile (no errors)
Magento setup:upgrade (no errors)
Magento static content deploy (no errors)

Does anyone have any ideas on how to fix this?


texts: Magento 2 Fatal error when adding date field in admin form and save

texts:
I am developing a custom module where there are many fields text,select,multiselect..etc in admin form.

Today I have added one field in admin of type time ,below is the code to add new field

$timeFormat = $this->_localeDate->getTimeFormat(\IntlDateFormatter::MEDIUM);

$actionTime = $fieldset->addField(
                    'action_time',
                    'time',
                    [
                        'name'      => 'action_time',
                        'label'     => __('Time'),
                        'class'     => 'required-entry',
                        'required'  => true,
                        'time_format'=> $timeFormat,
                        'time'=>true
                    ]
                );

and in installSchema.php I have put below code to add column in table

)->addColumn(
             'action_time',
            \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
            255,
            ['nullable' => false],
            'Action Time'
        )

Field created successfully but it throwing error when saving form.

  Fatal error: Uncaught TypeError: DateTime::__construct() expects
  parameter 1 to be string, array given in
  /var/www/html/Magento2/vendor/magento/framework/Stdlib/DateTime.php:57
  Stack trace: #0
  /var/www/html/Magento2/vendor/magento/framework/Stdlib/DateTime.php(57):
  DateTime->__construct(Array) #1
  /var/www/html/Magento2/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(2764):
  Magento\Framework\Stdlib\DateTime->formatDate(Array, true) #2
  /var/www/html/Magento2/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(3001):
  Magento\Framework\DB\Adapter\Pdo\Mysql->formatDate(Array) #3
  /var/www/html/Magento2/vendor/magento/framework/Model/ResourceModel/AbstractResource.php(183):
  Magento\Framework\DB\Adapter\Pdo\Mysql->prepareColumnValue(Array,
  Array) #4
  /var/www/html/Magento2/vendor/magento/framework/Model/ResourceModel/Db/AbstractDb.php(541):
  Magento\Framework\Model\ResourceModel\AbstractResource->_prepareDataForTable(Object(Vendorname\Modulename\Model\Grid),
  'manage_feed_dat...') #5
  /var/www/html/Magento2/vendor/magento/framework in
  /var/www/html/Magento2/vendor/magento/framework/Stdlib/DateTime.php on
  line 57

I have debugged but not found any issue.Please help me.


texts:
I am creating my own module and as I am creating some text, that will be shown in the website. The store manager, which installs my module, needs to have the possibility to translate my text into other languages, which run on his Website. How can I achieve this?

To give you an example I make a Popup with the text: "Hello World", but the Store Managers has an shop which runs on German, Dutch, French, Italian and so on and now  my "Hello World" should be changed into those languages, if the store view is currently in this language.

Thanks in advance.


texts: How to call gallery.phtml file in my custom phtml?

texts:
I have created a custom widget and now, I am trying to display product images
Something like in the Product view page.
On catalog_product_view.xml it calls /vagrant/www/vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml
How can I call gallery.phtml in my custom phtml file?


texts: how to add variant description into email

texts:
How can I add this part ( it is a variant of parent product which customer bought)

Into a transation email. Right now I have only The basic name and the sku


texts: Magento 2 : Error 500 - Internal server error while creating the large varient configurable products

texts:
I am not able to create a large variant of configurable products. It's showing me the error like Error 500 - Internal server error after processing some minute of time. After processing the configurable product it's only generating some of the products not all. There is no error in a log file.
So is there any way that can be useful for creating a large number of variant products at the time of creating this configurable product?


texts: Validate Shopping cart rule with custom from and to date EE 1.14

texts:
I have created custom from and to dates to validate the shopping cart rule coupons.
For this I have overridden the Mage_SalesRule_Model_Mysql4_Rule_Collection setValidationFilter().

protected function setValidationFilter($websiteId, $customerGroupId, $couponCode='', $now=null)
{
    if ($this->getFlag('validation_filter')) {
        return $this;
    }

    if ($couponCode)
        $couponCode = explode(',', $couponCode); // multiple coupon compatibility

    $this->getSelect()->reset();

    $this->getSelect()->from(array('main_table' => $this->getTable('salesrule/rule')));
    //$this->getSelect()->reset(Zend_Db_Select::WHERE);
    $this->addWebsiteGroupDateFilter($websiteId, $customerGroupId, $now);

    if ($couponCode) {
        $this->getSelect()->joinLeft(array('c' => $this->getTable('salesrule/coupon')),
            'main_table.rule_id = c.rule_id ',
            array('code')
        );

        // Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON is not defined
        $this->getSelect()->where(
            $this->getSelect()->getAdapter()->quoteInto(' main_table.coupon_type = ?', 1)
            .
            $this->getSelect()->getAdapter()->quoteInto(' OR c.code IN(?)', $couponCode)
        );

        //modify rule date to validate with custom dates
        if (is_null($now)) {
            $now = Mage::getModel('core/date')->date('Y-m-d');
        }

        $this->getSelect()->join(array('cd' => $this->getTable('couponenhancement/couponenhancement')),
                'main_table.rule_id = cd.rule_id ',
                array('cd.coupon_valid_from','cd.coupon_valid_to')
            );

        $this->getSelect()->where('cd.coupon_valid_from is null or cd.coupon_valid_from<=?', $now);
        $this->getSelect()->where('cd.coupon_valid_to is null or cd.coupon_valid_to>=?', $now);
        //ends

        $this->getSelect()->group('main_table.rule_id');
    }
    else {
        $this->getSelect()->where('main_table.coupon_type = ?', 1);
    }

    $this->getSelect()->order('sort_order');

    $this->setFlag('validation_filter', true);

    return $this;
}

Printing the query gives me this..

SELECT `main_table`.*, `c`.`code`, `cd`.`coupon_valid_from`, `cd`.`coupon_valid_to` FROM `salesrule` AS `main_table`
 INNER JOIN `salesrule_customer_group` AS `customer_group_ids` ON main_table.rule_id = customer_group_ids.rule_id AND customer_group_ids.customer_group_id = 1
 LEFT JOIN `salesrule_coupon` AS `c` ON main_table.rule_id = c.rule_id
 INNER JOIN `couponenhancement` AS `cd` ON main_table.rule_id = cd.rule_id
 WHERE (EXISTS (SELECT 1 FROM `salesrule_website` AS `website`
 WHERE (website.website_id IN ('3'))
 AND (main_table.rule_id = website.rule_id)))
 AND (**from_date** is null or from_date = '2015-03-09')
 AND (is_active = '1')
 AND ( main_table.coupon_type = 1 OR c.code IN('APRGE05-2687-3459'))
 AND (cd.coupon_valid_from is null or cd.coupon_valid_from='2015-03-09')
 GROUP BY `main_table`.`rule_id` ORDER BY `sort_order` ASC

PROBLEM HERE IS the query also includes the default date columns(from_date & to_date) as well as My custom column for dates (coupon_valid_from & coupon_valid_to).

Now I need to Remove ONLY the default date columns from_date & to_date from the query. and my validation will work fine.

Is there a way to do it. $this->getSelect()->reset(Zend_Db_Select::WHERE) removed full where condition.. but I only need to remove those particular from_date and to_date where fields.

Thanks


texts:
6 weeks ago i updated my M1 to M2.2.3, 2 weeks ago i updated tot 2.2.5

After i updated to M2.2.5 my (old) products, on my productpage (like woman), show up in the wrong order. The oldest products show up as first, and the newest at last.

The products who are on top, came from my M1 store.

I did'nt give them a number for the position.
And in "products in catagorie" the products are in the right position.

I even did'nt change anything at " Default Product Listing Sort By" it's at position.

Someone now whats wrong? Do need to change something that it will be oke again?


texts:
I am working with magento 2 graphql.

Out of box product category GraphQl service take more the 12 sec to load fist time.

I have updated all required parameters on server but still same performance in first load.

Can anyone provide me some input which help me to increase Magento graphQl performance.


texts: Magento 2: Show whole HTML code(phtml file code) into PDF file and Download with the use of DOM PDF?

texts:
I have tried to do it with zend pdf but i am not able to show whole html content with the use of zend pdf.
If i want to display content of cms block , then i am not able to do it with Zend PDF. I have tried to find out class reference which can draw html with its tag.
If i pass html content in $page1->drawText($html, $x, $y); then it will display with all html tag. So i have noticed that we can do it with DOM PDF. But i am not aware about exact logic for it.
Is any other way to do it?


texts: Magento 2 Static Content Deploy is Not working

texts:
I'm using Magento 2.2.3. I am trying to do the Static Content Deploy through CLI in my Lampp.

This is the code I'm used, php bin/magento setup:static-content:deploy or php bin/magento setup:static-content:deploy -f.

It is showing the this error.

I tried the below commands:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
rm -rf var/* pub/static/* generated/*
sudo chmod -R 777 var/* pub/* generated/* app/etc/*
sudo chmod -R 777 var/ pub/* generated/ app/etc/*
php bin/magento setup:static-content:deploy *or* php bin/magento
setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:flush


texts: Magento performance images and static on CDN

texts:
We are investigating further Magento speed improvements. What we see now is that with the following setup the page flies. Only the images come later. The main files are delivered in a couple of milliseconds, but the loading time is still 2 seconds because of the images.

mage caching
merge css/js
minify apc + memcache
htaccess tweaks
session/cache on tmpfs

My question: what are the steps to setup a CDN (on my own server)?
(and does it actually help)

I understand it is something like this (but this is not at all working):

create cdn subdomain
change document root (and/or why set a cname?)
change config


texts:
I want to place the fotorama slider in an absolute div that is behind other elements.
Also the slider should behave like the css background property cover.

I found that the slider plugin used has an option to set to cover. But I can't find out how to set it.
Also when I change the div containing the fotorama to position absolute it just ignores the height altogether.
This might be because of that cover option as the slider will scale the image up and the image is 4:3 but the space is 16:9.

How can I change/set this behavior?


texts: Proper way to get $block->getChildHtml inside the custom phtml file

texts:
I want to add default wishlist sidebar section into my Magento_Theme template,
Layout xml file:
<referenceBlock name="header.panel">

            <block class="Magento\Framework\View\Element\Template" name="mylocation.block" template="Magento_Theme::location_link.phtml" after="-">

              <!-- Wishlist sidebar section -->
            <block class="Magento\Wishlist\Block\Customer\Sidebar" name="wishlist_sidebar" as="wishlist" template="Magento_Wishlist::sidebar.phtml"/>

            </block>

        </referenceBlock>

FYI : The following code coming from core vendor\magento\module-wishlist\view\frontend\templates\sidebar.phtml
  <!-- Wishlist sidebar section -->
<block class="Magento\Wishlist\Block\Customer\Sidebar" name="wishlist_sidebar" as="wishlist" template="Magento_Wishlist::sidebar.phtml"/>

After added in layout xml file and getting this block using getChildHtml in app\desigh\frontend\Zero\my_theme\Magento_Theme\templates\location_link.phtml
<?php echo $block->getChildHtml('wishlist');?>

Not working, any help thanks.


texts: Аppearance of the form, choosing Credit card payment method

texts:
When customer accepts Credit Card (saved) payment method, then appears a form for introducing credit card data. I wonder if it posiible to do the same action (to show this form) if customer accepts other Credit Card payment methods (i.e. Authorize.net option).

Thanks for any help you can provide in this situation.


texts: Update installment price on product configuration change Product Page Magento2

texts:
I created a template to display the installment price of the product, on the product page.
I need to update this price when the user clicks the configurable product option.

Any help is welcome.
Thanks


texts: Magento 2: cURL webAPI request for Customer search

texts:
Trying to find a way how to integrate Magento 2 via cURL to search for a customer.

For Example the below command is able to bring the customer details of 8

curl -X GET "http://example.com/index.php/rest/V1/customers/8"
     -H "Authorization: Bearer myaccesstoken"

In the similar fashion how can I construct the search URL with Search Criteria

I spent a day with this website and no luck.

curl -X GET http://example.com/index.php/rest/V1/customers/search
     -H "Authorization: Bearer xxxxxxx"
     -d '{"searchCriteria":{"filterGroups":[{"filters":[{"field":"email","value":"abcd@gmail.com","condition_type":"eq"}]}]}}'

And I got the error

{"message":"%fieldName is a required field.","parameters":{"fieldName":"searchCriteria"}}

There is something wrong in my request...


texts:
Not able to place the order in magento2 checkout.

getting below error when place order button is clicked.

  An error occurred on the server. Please try to place the order again.

The request to rest/default/V1/carts/mine/payment-information

is showing 400 Bad request.

Can anyone help me with this issue please.
Thanks


texts: Check if product allow backorder in category list slow - Magento 2.4

texts:
How can we check in the category list page, if a specific product is allowed for backorders?
We only allow this on product level, so I want to check if this product can be ordered as backorder.
Edit:
I currently use the following code to load in the category list, but that seems to slow down the page a bit. Is there a faster way?
class Backorder extends \Magento\Framework\View\Element\Template
{
    protected $_productRepository;

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

    public function getBackorder($_product)
    {
        $product = $this->productRepository->getById($_product->getId());
        $backorderStatus = $product->getExtensionAttributes()->getStockItem()->getBackorders();
        return $backorderStatus;
    }
}


texts: Getting a sudden error on Magento backend / frontend

texts:
Our webshop has been working fine for a while, today this error shows up on frontend:

There has been an error processing your request

Invalid backend model specified: ultramegamenu/category_attribute_backend_grid_columns

and this shows up in backend whenever I try to enter "category" menu item:

Source model "ultramegamenu/category_attribute_source_dropdown_type" not found for element "umm_dd_type"

It appears to be traces from an old theme that was installed on the server and present on the FTP, yet it was not enabled - I have removed all traces of the old theme in /app and /skin, and de-activated whatever modules remained that had relevance to it.

What could be causing this?

EDIT: Thank you for all your answers guys, but I figured it out with Adarsh! +1


texts: Magento 2 add condition filter with collection

texts:
I need to build a query like

select * from table_name where '2008' >= substr(table_name.field_name,7,4);

in this query 2008 is the dynamic value.
I need this to be built using Magento collection addFieldToFilter function.

Thanks in advance


texts: Best way to apply conditional statement to layout update?

texts:
Ok, so i'm trying to show a certain link in the customer account area only if a customer is a particular group.

I can get the link to show by:

<customer_account>
    <reference name="customer_account_navigation" >
        <action method="addLink" translate="label" module="mymodule"><name>module link</name><path>mymodule/account</path><label>Module Link</label></action>
    </reference>
</customer_account>

But how could I apply a conditional statement to this to only get this to show based on a customer group?

My thoughts are:

public function accountAction()
{
    $this->loadLayout();
    if (Mage::getSingleton('customer/session')->isLoggedIn() && Mage::getSingleton('customer/session')->getCustomerGroupId() == 3){
        // edit layout?
    }
    $this->renderLayout();
}

Is this the correct approach?


texts: Magento2 - override 3rd party module layout file in custom theme

texts:
We have a custom theme with some layout / template overrides

Now we have installed a 3rd party module, which is overriding one of layout files in our custom theme. So, only module's override is being loaded

I suppose, we can deal with this, by defining that concrete layout override in a custom module (instead of the custom theme approach), and then define the module dependencies to load both layout overrides

Or is there a way to do that without the need of declaring a new module?

UPDATE

About RishabhRkRai answer...

Let's say our custom theme is placed in folder app/design/frontend/Sinapsis/projectname

We had this layout override there:

app/design/frontend/Sinapsis/projectname/Magento_Multishipping/layout/multishipping_checkout_billing.xml

Now, we've installed a module which overrides that same layout file. The concrete module name is Df_Checkout, and problem is our layout override stopped working

I've tried, following the answer, moving our override to

app/design/frontend/Sinapsis/projectname/Df_Checkout/layout/multishipping_checkout_billing.xml

but only module's layout keeps loading


texts: Add the field 'Associate to Company' on register form

texts:
I would like to add a mandatory field on my register form in front.

The field is 'Associate a company' exactly like the field in admin when I want to edit a customer :

I checked the 'vendor/magento/module-company/view/base/ui_component/customer_form.xml' to find the field 'extension_attributes.company_attributes.company_id' so I think it should be done easily but I have no idea how.

I also check the block 'Magento\Customer\Block\Widget\Company' but it's for adresses.

Thank you !


texts:
I have created a extension with version 0.0.1 and it is listed on magento connect.

My question is I have to make some changes in the extension block files. After completing My Changes, I have change version number in config xml from 0.0.1 to 0.1.0

there is no change in set up script, in first released it was named as install-0.0.1.php. do I need to rename this files as well to  install-0.1.0.php.

Please suggest what are the correct steps to create Version Upgrade for extension.

Thanks


texts: Magento2 Product import (image filenames)

texts:
I'm not sure that this is a bug, as it's intentional from the looks of it, but ...

I'm working on a migration from Zencart and the original site's media folder has been downloaded and we've written a custom importer.

The feedback from the product importer is very generic, but it turns out that the original media including a space in it's filename is an issue.

Specifically, the PATH_REGEXP within \Magento\CatalogImportExport\Model\Import\Product\Validator\Media.php doesn't allow for this.

Is there any reason for this restriction? Is this due to how different file systems may interpret special characters?  If I alter the REGEX to allow for spaces, Magento2 parses the file successfully, and actually changes the filename to a more comfortable format (underscores instead of spaces)

Steps to reproduce

Create product import
Ensure image reference within base_image, small_image or thumbnail_image contains a space
Place files within pub/media/images/

Expected result

Media images pass validation

Actual result

Media Images do not pass validation
Wrong URL/path used for attribute image in row(s): 2, 3, 4, 5, 6, 7, 8, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49
Wrong URL/path used for attribute small_image in row(s): 2, 3, 4, 5, 6, 7, 8, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49
Wrong URL/path used for attribute thumbnail in row(s): 2, 3, 4, 5, 6, 7, 8, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49


texts:
I have a big issue with reading my csv file.

When I do an export and open it in Google doc or Excel the price and qty not show correct.
Magento 2.2.6

  https://docs.google.com/spreadsheets/d/1uJ_CLLGG1WLi_udJTIEHQhx8nCLCHSTxuO-c3kw1XaM/edit?usp=sharing

Can you help me please?

Greetings Bart


texts: Code for filtering products by attributes?

texts: I have created a brand.phtml file in my custom theme. I want to write the code for getting products having specified attribute value.


texts: How to tell Magento that there is new block available, so that it can be used in a template with ->getChildHtml('name_of_that_block')

texts:
How to tell Magento that there is new block available, so that it can be used in a template with
<?php $this->getChildHtml('name_of_that_block'); ?>?
I want to pull in my Block and template defined in my module to another template to be used as a child. How do I do this?


texts: Add payment logo and facebook in the footer

texts: I would like to add payment logo in my footer, and also to add a facebook block in my footer. Exist it an extension?


texts: how do save customer session in magento2?

texts:
I have code for test a customer session....

$sessionOrderBy = $this->_customerSession->setSortOrderBy('2');
echo $this->_customerSession->getSortOrderBy();

  return is: 2 value

after commented

 // $sessionOrderBy = $this->_customerSession->setSortOrderBy('2');
and run

  return : null;

So, how do save $sessionOrderBy in _customerSession?


texts: Magento 2 Unable to find a physical ancestor for a theme

texts: I've delete Magento 2 theme folder and upload it again but when upgrade it via command line i've got an error say Unable to find a physical ancestor for a theme so any suggestion about that?


texts: Printing invoice in different custom language

texts:
I have one website with multiple store views for different languages. All store views have same products, but use different front-end languages which are stored in locale.

When someone orders from German store view, Sales=>Invoices=>(invoice #)=>Print will print a German PDF invoice. I would like to be also able to print all PDF invoices in English language for accounting. How can I achieve that?


texts:
I have a little code to create an order which don't work with php7

foreach ($object['products'] as $productInfoSrc) {
        $productId = $productInfoSrc['product_id'];
        $qty = $productInfoSrc['qty'];
        $data['order']['add_products'][$productId] = array('qty' => $qty);
}

The line $data['order']['add_products'][$productId] = array('qty' => $qty); return me the bug php.

I try to make some correction like this :

    foreach ($object['products'] as $productInfoSrc) {
        $productId = $productInfoSrc['product_id'];
        $qty = $productInfoSrc['qty'];
        $data['order']['add_products']= array($productId, array('qty' => $qty);
}

but if I have 2 product, just 1 was taken by this code (i don't merge array i think).

someone can help me ?


texts:
I am not able to enter data in the magento tables, what am I doing wrong?
In var_dump it returns me the data correctly, it just does not re-insert into the table I want

<?php
ini_set("display_errors", 1);
ini_set('memory_limit','1024M');
    require_once('app/Mage.php');
    Mage::app(0);

    $users = Mage::getModel('customer/customer')->getCollection();

    $i = 1;
    foreach ($users as $key => $user) {
    $id = $user->getId();

    $usuario_loaded = Mage::getModel('customer/customer')->load($id);

                $tudo = array(
                'clientes_id'=>$usuario_loaded->getId(),
                'nome'=>$usuario_loaded->getFirstname(),
                'sobrenome'=>$usuario_loaded->getLastname(),
                'loja'=>$usuario_loaded->getWebsiteId(),
                'grupo'=>$usuario_loaded->getGroupId(),
                'prefixo'=>$usuario_loaded->getPrefix(),
                'assinatura'=>$usuario_loaded->getMiddlename(),
                'cpf'=>$usuario_loaded->getCpf(),
                'cnpj'=>$usuario_loaded->getCnpj(),
                'razao'=>$usuario_loaded->getCompanyName(),
                'fantasia'=>$usuario_loaded->getTradingName(),
                'apelido'=>$usuario_loaded->getNickname(),
                'insestadual'=>$usuario_loaded->getIe(),
                'tipocadastro'=>$usuario_loaded->getType(),
                'profissao'=>$usuario_loaded->getOccupation(),
                'fundação'=>$usuario_loaded->getFoundationDay(),
                'sufixo'=>$usuario_loaded->getSuffix(),
                'email'=>$usuario_loaded->getEmail(),
                'emailsec'=>$usuario_loaded->getEmailSeconday(),
                'emailfiscal'=>$usuario_loaded->getEmailBilling(),
                'nascimento'=>$usuario_loaded->getDob(),
                'cpfcnpj'=>$usuario_loaded->getTaxvat(),
                'sexo'=>$usuario_loaded->getGender(),
                'departamento'=>$usuario_loaded->getDepartment(),
                'ondeconheceu'=>$usuario_loaded->getHowFindUs(),
                'adyen'=>$usuario_loaded->getAdyenCustomerRef());

                var_dump($tudo);

                $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
                $query = "INSERT INTO clientes (clientes_id, nome, sobrenome, loja, grupo, prefixo, assinatura, cpf, cnpj, razao, fantasia, apelido, insestadual, tipocadastro, profissao, fundação, sufixo, email, emailsec, emailfiscal, nascimento, cpfcnpj, sexo, departamento, ondeconheceu, adyen) VALUES ('".$tudox['clientes_id']."', '".$tudox['nome']."', '".$tudox['sobrenome']."', '".$tudox['loja']."', '".$tudox['grupo']."', '".$tudox['prefixo']."', '".$tudox['assinatura']."', '".$tudox['cpf']."', '".$tudox['cnpj']."', '".$tudox['razao']."', '".$tudox['fantasia']."', '".$tudox['apelido']."', '".$tudox['insestadual']."', '".$tudox['tipocadastro']."', '".$tudox['profissao']."', '".$tudox['fundação']."', '".$tudox['sufixo']."', '".$tudox['email']."', '".$tudox['emailsec']."', '".$tudox['emailfiscal']."', '".$tudox['nascimento']."', '".$tudox['cpfcnpj']."', '".$tudox['sexo']."', '".$tudox['departamento']."', '".$tudox['ondeconheceu']."', '".$tudox['adyen']."')";
                $connection->query($query);

    $i++;
    if ($i == 1) {
    break;
    }

}
?>


texts: Magento 2: No Payment Methods showing in Frontend after Ajax call

texts: I am using IWD One page checkout free extension and Ccavenue online payment method for Magento 2. Site version is 2.1.4 .Initially on checkout page load, both payment methods (COD and Ccavenue)are visible. When entering city,state , "shipping-information" ajax gets fired and both payment methods disappear and "No Payment Method" is shown, but the ajax returns both the payment methods as specified in screen shot.Any help would be greatly appreciated.


texts: magento Deployment FTP Error. Invalid login credentials

texts:
While we are saving the FTP details from Magento connect manager under setting tab, it gives the Deployment FTP Error. Invalid login credentials.

If we give invalid ftp details, it still gives the same error.

What will be the reason for this issue? Please give your valuable feedback as soon as possible.


texts: Error with Magento\Eav\Model\Entity\Attribute how to fix?

texts:
I have this error,

1 exception(s):
Exception #0 (Exception): Item (Magento\Eav\Model\Entity\Attribute) with the same ID "87" already exists.

it seems to me that there must be a duplicate row ?

But what Table as I cant find one.

Thanks.


texts:
I've upgraded my site from v2.3.1 to v2.3.6 and I now get the error:
Reference to undeclared plugin with name 'priceIndexUpdater'
in my system.log.
I've found that in vendor\magento\module-inventory-catalog\etc\di.xml there is the line
    <plugin name="priceIndexUpdater" disabled="true"/>

Why is the plugin disabled when it is needed. Any ideas what will happen if I delete the line?


texts: How do we Place order from storefront on behalf of another customer in Magento 2.3?

texts:
The salesperson (sales rep) talk to customers take an order at offline mode, will Place orders on behalf of them on Storefront,
So Salesperson logged in to My Magento account (Storefront), he can choose the associated Customer in the customer's contact list and he can add items for that customer and check out, the customer gets an order notification email.

Product price will be displayed according to the associated Customer's Group (Tier price). also, Salesperson can add products to cart with or without negotiated price based on product Min – Max Selling price.

So instead of associated customers can order from the website, Salesperson using his account and do it for them.


texts: How to show certain sub categories on a page

texts:
I have some code which displays certain categories on a page. I chose these categories by defining the category ID in an array, however if i put in a sub category ID the category is not displayed, this is my code.

<?php $arr_cat_ids = array('65','85','64','83','56','71');?>
<?php foreach ($this->getStoreCategories() as $_category):
$this_cat_id = $_category->getId();
if(in_array( $this_cat_id, $arr_cat_ids)){
?>
<?php $open = $this->isCategoryActive($_category); ?>
<?php
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
if ($immagine = $this->getCurrentCategory()->getImageUrl()):
?>

        <a href="<?php echo $this->getCategoryUrl($_category)?>">
        <img src="<?php echo $immagine ?>" alt="<?php echo $this->htmlEscape($this->getCurrentCategory()->getName()) ?>" class="img-responsive" />

<a href="<?php echo $this->getCategoryUrl($_category)?>"><?php echo $_category->getName()?>

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

what would i have to change so i could show parent categories as well as sub categories?


texts: Magento2 not getting post data from ui component phtml file

texts:
I have implemented admin form using UI component. In that, I have 3 separate tabs. Among 3, I have displayed one tab using custom phtml file by using following code in ui component form xml file

<fieldset name="custom_fieldset" sortOrder="30">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Manage Titles</item>
            <item name="collapsible" xsi:type="boolean">true</item>
        </item>
    </argument>
    <container name="custom_container">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="sortOrder" xsi:type="number">10</item>
            </item>
        </argument>
        <htmlContent name="html_content">
            <argument name="block" xsi:type="object">Namespace\Module\Block\Adminhtml\Module\Labels</argument>
        </htmlContent>
    </container>
</fieldset>

But when I click on save button I am not getting any data in save controller post variable from this particular phtml file. I am getting data of other 2 tabs which implemented using field tag as we do normally with ui component.

This is my phtml file code :

    <fieldset class="admin__fieldset fieldset">

                    <?php foreach ($block->getStores() as $_store): ?>
                        <?= /* @escapeNotVerified */ $_store->getName() ?>
                    <?php endforeach; ?>

                    <?php foreach ($block->getStores() as $_store): ?>

                            <input class="input-text<?php if ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID): ?> required-option<?php endif; ?>" type="text" name="frontend_label[<?= /* @escapeNotVerified */ $_store->getId() ?>]" value="" <?php if ($block->getReadOnly()):?> disabled="disabled"<?php endif;?>/>

                    <?php endforeach; ?>

    </fieldset>

This is my block code

    <?php

namespace Namespace\Module\Block\Adminhtml\Module;

class Labels extends \Magento\Backend\Block\Template
{
    /**
     * Block template
     *
     * @var string
     */
    protected $_template = 'labels.phtml';

    /**
     * AssignProducts constructor.
     *
     * @param \Magento\Backend\Block\Template\Context  $context
     * @param array                                    $data
     */
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        array $data = []
    ) {
        parent::__construct($context, $data);
    }

    /**
     * Retrieve stores collection with default store
     */
    public function getStores()
    {
        return $this->_storeManager->getStores();
    }
}

Any help into this will be highly appreciable.

Thanks.


texts: Remove decimal values in backend in Magento2

texts:
How to remove decimal from all numbers on the backend (admin)of Magento2?

Currently, I use a module of lillik/price-decimal, but when I try to change the price of some product in some store at the advanced price, I lost the old price.


texts: how to override template files for magento2 extension

texts:
In magento2 to override template files here, but for magento2 extension we have to follow here.

So how to override template files in magento2 extension with out considering theme inheritance.

I want to override vendor\magento\module-ui\view\base\web\js\form\components\collection.js and vendor\magento\module-ui\view\base\web\templates\form\components\collection.html for customer address tab modifications.

With using theme inheritance i can do this by implementing above files in my custom theme files in Magento_Ui folder, but how could I achieve the same for magento2 extension i.e. with in app/code/vendor/module folder.


texts: Magento 2 Warning imagecreatefromjpeg error

texts:
I am getting issue regarding Magento 2 Installation and still don't get any solution about it.

I am installing Magento 2 using docker-compose but I keep getting following warning:

[Progress: 419 / 833]
Module 'Magento_Theme':

In PatchApplier.php line 167:

Warning: call_user_func() expects parameter 1 to be a valid callback, function 'imagecreatefromjpeg' not found or invalid function name in /var/www/myshop/vendor/magento/framework/Image/Adapter/Gd2.php on line 72

Here is how I added GD support on Dockerfile (FROM php:7.2-fpm):

RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ --with-xpm-dir=/usr/include/ --enable-gd-jis-conv
RUN docker-php-ext-install -j$(nproc) gd

Here is my current phpinfo() output related gd information:

From the snapshot there is no JPEG support listed there.

Here is my OS information:

Any help regarding this will be really appreciated since I have been stuck on this for 2 days.

Thanks in advance.


texts:
error message as below appeared after database details is entered this is an excerpt as the original is too long.

It is a fresh install without any sample data imported into the database. Tried many times but it won't get past this page. What could be wrong?

Zend_Db_Statement_Exception Object
(
    [_previous:Zend_Exception:private] =>
    [message:protected] => SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`19`.`cms_block_store`, CONSTRAINT `cms_block_store_ibfk_2` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE), query was: INSERT INTO `cms_block_store` (`block_id`,`store_id`) VALUES (?, ?)
    [string:Exception:private] =>
    [code:protected] => 23000
    [file:protected] => /var/www/._./19/lib/Zend/Db/Statement/Pdo.php
    [line:protected] => 235
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /var/www/._./19/lib/Varien/Db/Statement/Pdo/Mysql.php
                    [line] => 110
                    [function] => _execute
                    [class] => Zend_Db_Statement_Pdo
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [0] => 97
                                    [1] => 0
                                )

                        )

                )


texts: How can I remove the Review step in Onepage checkout?

texts:
I would like the order to be processed after the Payment method step, omitting the Review step in the Onepage Checkout.

Is there anyone who has experience with this or who can point me in the right direction on how to do this?

Thank you


texts: magento2 check if customer is logged in or not in knockout template

texts:
How do I check if customer is logged in or not in knockout template?

my template

<!-- ko if: customer().firstname -->

<!-- /ko -->

my js

 define(
    [
        'ko',
        'jquery',
        'Magento_Ui/js/form/element/abstract',
        'mage/url',
        'Magento_Customer/js/customer-data',
        'mage/translate'
    ],
    function (Component,storage,ko,jquery,Abstract, url, customerData, $t) {
        'use strict';

        return Component.extend({
            message: function() {
            loggedMessage : $t('Welcome, %1!')
            },
            htmlLoggedMessage: ko.observable(),
            isLoggedIn: ko.observable(),
            customer: ko.observable({}),
            initialize: function() {
                this._super();
                if(this.isCustomerLogged != 0) {
                    this.isLoggedIn(true);
                }
                this.checkCustomerLocalStorage();
            },
            /**
             * Check customer localstorage
             */
            checkCustomerLocalStorage: function () {
                var self = this;
                var time = setInterval(function () {
                    self.customer = customerData.get('customer');
                    if (localStorage["mage-cache-storage"] != '{}') {
                        clearInterval(time);
                    }
                    if (self.customer().fullname) {
                        var name = self.customer().fullname;
                        var message = self.message.loggedMessage.replace('%1', name);
                        self.htmlLoggedMessage(message);
                    }
                }, 1000);
            }
        });
    }
);

I followed this link but its still entering in to if condition:

How to check if customer is logged in or not in magento 2?


texts: What does "setData('used_in_forms')" stand for in SQL install

texts:
I am creating a custom customer attribute.

<?php
$this->addAttribute('customer', 'complaining_customer', array(
    'input'        => 'text',
    'type'         => 'varchar',
    'label'        => 'Special ATT',
    'position'     => 120,
    'user_defined' => 0,
    'required'     => false,

));
$attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'complaining_customer');
$attribute->setData('used_in_forms', array(
    'adminhtml_customer',
    'checkout_register',
    'customer_account_create',
    'customer_account_edit',
));
$attribute->setData('is_user_defined', 0);
$attribute->save();

I don't want this attribute to be visible to the customer.

I noticed that under $attribute->setData
I have 'customer_account_create', 'customer_account_edit'

I was wondering if that means that this attribute might appear somewhere in the frontend. Should I remove them?


texts: Error with custom shipping method M2.3.5)

texts: I made a custom shipping method in 2.3.5. I can select it in the checkout, but after selecting the payment method and clicking the "buy-button" the checkout gives this error: An error has occurred on the server. Try to place the order again. What is going wrong?


texts: Is it possible to add new functionality to OPC method saveBilling by Observer?

texts:
I need to add new customer field. This field should be available during customer registration via OPC.
How I can do it?
I can rewrite Mage_Checkout_Model_Type_Onepage modify method saveBilling and add into it:

$this->getCheckout()->setSomeField($data['some_field']);

After it I can call Observer on event checkout_type_onepage_save_order and use such code:

$quote = $observer->getEvent()->getQuote();
$customer = $quote->getCustomer();
$customer->setSomeField(Mage::getSingleton('checkout/session')->getSomeField());

And this field will be added to customer.

But I already have 2 time rewrites for class Mage_Checkout_Model_Type_Onepage. And this one will be third. I don't like. Maybe I can use some event for it?  Or any other approach?


texts: Fatal Error Call to a member function registry() in observer in magento 2

texts:
<?php namespace Namespace\Mymodule\Observer;

use Magento\Checkout\Model\Session as CheckoutSession;
use Namespace\Mymodule\Helper\Data as DataHelper;

abstract class AbstractCartActionObserver
{
    /**
     * @var DataHelper
     */
    protected $_helper;

    /**
     * @var CheckoutSession
     */
    protected $_checkoutSession;

    /**
     * @var Registry
     */
    protected $_registry;

    /**
     * @param DataHelper $dataHelper
     * @param CheckoutSession $checkoutSession
     * @param Registry $registry
     */
    public function __construct(
        DataHelper $dataHelper,
        CheckoutSession $checkoutSession,
        \Magento\Framework\Registry $registry){
        $this->_helper = $dataHelper;
        $this->_checkoutSession = $checkoutSession;
        $this->_registry = $registry;
    }

    /**
     * Fired by checkout_cart_product_update_after event
     *
     * @param \Magento\Quote\Model\Quote\Item[] $items
     * @return $this
     */
    protected function _processQuoteItemsChange($items)
    {
        /**
         * @var \Magento\Quote\Model\Quote\Item $quoteItem
         */

        $productsToAdd = $this->_registry->registry('gtm_products_addtocart');
        if (!$productsToAdd) {
            $productsToAdd = [];
        }

        $productsToRemove = $this->_registry->registry('gtm_products_to_remove');
        if (!$productsToRemove) {
            $productsToRemove = [];
        }
       $lastValues = [];

        if ($this->_checkoutSession->hasData(DataHelper::CART_PRODUCT_QUANTITIES)) {
            $lastValues = $this->_checkoutSession->getData(DataHelper::CART_PRODUCT_QUANTITIES);
        }

        foreach ($items as $quoteItem) {

            if ($quoteItem->getParentItem()) {
                continue;
            }
            $oldQty = isset($lastValues[$quoteItem->getId()]) ? $lastValues[$quoteItem->getId()] : 0;
            $qty = $quoteItem->isDeleted() ? 0 : $quoteItem->getQty();
            if ($qty > $oldQty) {
                $productsToAdd[] = [
                    'product' => $quoteItem->getProduct()->getSku(),
                    'quantity' => $qty - $oldQty,
                ];
            } elseif ($qty < $oldQty) {
                $productsToRemove[] = [
                    'product' => $quoteItem->getProduct()->getSku(),
                    'quantity' => $oldQty - $qty,
                ];
            }
        }

        $this->_registry->unregister('gtm_products_addtocart');
        $this->_registry->register('gtm_products_addtocart', $productsToAdd);

        $this->_registry->unregister('gtm_products_to_remove');
        $this->_registry->register('gtm_products_to_remove', $productsToRemove);

        $this->_checkoutSession->unsetData(DataHelper::CART_PRODUCT_QUANTITIES);
        return $this;
    }
}

This one is another class i am calling function of abstract class :

class CartAddObserver extends AbstractCartActionObserver implements ObserverInterface
{
    /**
     * Fired by sales_quote_product_add_after event
     *
     * @param Observer $observer
     * @return $this
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
     * @SuppressWarnings(PHPMD.NPathComplexity)
     */
    public function execute(Observer $observer)
    {
        $items = $observer->getEvent()->getItems();
        $this->_processQuoteItemsChange($items);
        return $this;
    }
}


texts: CPU usage on Heartbeat Cron (every minute)

texts:
Magento 2.2: The heartbeat cron jobs that run every minute spike CPU to 100% for a second.   Is this normal?   I have other services running on my server (2 core 4MB Linode) and the Magento cron job is causing problems.

I installed Wyomind OE Scheduler so I can see what runs and there are no obvious errors or abnormalities.  I am not sure how to troubleshot beyond that.

I upgraded from 2.2.2 to 2.2.3 and saw no change.

Top Screenshot:

CronJobs:


texts: how can I update all product base images, to be the same as small images in Magento 2

texts:
I have a set of products, which are using different image for base, small and thumbnail.
I would like to programmatically update them so that the base/thumbnail image is the same as the image now used for small image.
Any ideas?


texts:
How to add Layernavigation in manin content in my list.phtml

<reference name="left_first">
            <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml">
                <block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
            </block>
        </reference>


texts: Error when opening the product page.I havent changes the code level

texts:
1 exception(s):

  Exception #0 (Exception): Notice: Array to string conversion in
  /var/www/html/magento2/app/code/Magento/Catalog/Block/Product/View/Attributes.php
  on line 88

http://107.22.132.126/singing-bowl-20.html


texts: Paypal Express not including Tax with OneStepCheckout

texts:
When my customers use Paypal Express (especially if they click the button from the cart page), they bypass my Magento tax configurations. When they enter the Paypal page, Paypal has no tax calculated because the customer did not enter their location information yet. Now when they enter their info, Paypal does not seem to communicate back to Magento to grab my tax configuration. When the customer pays and gets redirected back to Magento, their purchase is ready for confirmation, but still no tax calculation.

When not using Paypal Express, tax gets calculated fine. Is this a known 1.4 issue? Do I also need to set taxes in Paypal? It seems like any logic that happens on the Magento checkout page gets bypassed when customers use Paypal Express, so I'm curious what's going on here.

My specific question is for tax, but other attributes could apply like shipping, currency, etc.


texts:
I'm creating a new module with a multiple select attribute "size".
The attribute and it's values are created in an installer script.

How can I assign the products to the values in the installer script, for example:

SKU shirtsummer => size =>large
SKU shirtwinter => size =>medium


texts: Getting error while placing order in magento 2.3.2

texts:
When i try to place order after selecting payment method i am getting error as "An error occured on the server.Please try to place the order agian error". please help how to resolve this.
Error while inspecting in network.

/var/www/html/magento/vendor/magento/framework/Interception/Interceptor.php(58):
Magento\Checkout\Mode\GuestPaymentInformationManagement->savePaymentInformationAndPlaceOrder(8dffeA1l6JygGlr...','abc.abc@pr...',
Object(Magento\Quote\Model\Quote\Payme\Interceptor),
Object(Magento\Quote\Model\Quote\Address)) #1
/var/www/html/ihouzit/vendor/magento/framework/Interception/Interceptor.php(138):
Magento\Checkout\Model\GuestPaymentInformationManagement\Interceptor->___callParent('savePaymentInfo...',
A…r.php(26):
Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch',
Array, Array) #11
/var/www/html/ihouzit/vendor/magento/framework/App/Http.php(137):
Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
12 /var/www/html/ihouzit/vendor/magento/framework/App/Bootstrap.php(261):
Magento\Framework\App\Http->launch() #13
/var/www/html/ihouzit/index.php(39):
Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
14 {main}


texts: Installing 1.9.1.0 problem, can't change language

texts: Trying yo install 1.9.1.0 on Ubunto 14.04 server, can't change the installation language, when setting to Portugues(Brasil) the browser resets option to English.


texts: I have exported my data with my products and filled in all the info with the location to the images located in the media folder. I am using the same image for multiple products, could that be a problem?


texts: Upgrade Magento CE 1.9.2.4 Magento CE 2.3.3 Guide?

texts:
We are currently running Magento 1.9.2.4 and would like to upgrade to the latest version of Magento CE 2.3.3. We don't have any custom themes or custom plugins or anything custom. IS there a tool/documentation to perform this upgrade?

We do have access to the database and the ability to install 2.3.3 on another server and do the migration.


texts: Overload noRouteAction for 404 Errors not working?

texts:
I want to overload the noRouteAction() to search for products based on the url and if found, redirect there.
Else I want to use the default 404 page.
Here is what I have: (for magento 1.8)

app/etc/modules/ACME_ErrorHandler.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <ACME_ErrorHandler>
            <active>true</active>
            <codePool>local</codePool>
        </ACME_ErrorHandler>
    </modules>
</config>

app/code/local/ACME/ErrorHandler/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <ACME_ErrorHandler>
            <version>1.0.2</version>
            <depends>
                <Mage_Page />
            </depends>
        </ACME_ErrorHandler>
    </modules>

    <frontend>
        <routers>
            <SkuRoute>
                <use>standard</use>
                <args>
                    <module>ACME_ErrorHandler</module>
                    <frontName>ErrorHandler</frontName>
                </args>
            </SkuRoute>
        </routers>
    </frontend>

    <global>
        <routers>
            <cms>
                <rewrite>
                    <index>
                        <to>ACME_ErrorHandler/index</to>
                        <override_actions>true</override_actions>
                        <actions>
                            <noroute><to>ACME_ErrorHandler/index/noroute</to></noroute>
                        </actions>
                    </index>
                </rewrite>
            </cms>
        </routers>
    </global>

</config>

app/code/local/ACME/ErrorHandler/controllers/IndexController.php

<?php
class WellLinked_ErrorHandler_IndexController extends Mage_Cms_IndexController
{
    public function noRouteAction($coreRoute = null)
    {
        header("X-Custom-Mod: working");
        parent::noRouteAction($coreRoute);

    }
}

The Problem is, it doesn't work!
When the Module is activated, every nonexisting URL gives this error:

a:5:{i:0;s:52:"Front controller reached 100 router match iterations";i:1;s:377:"#0 /var/www/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(179): Mage::throwException('Front controlle...')
#1 /var/www/magento/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#2 /var/www/magento/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#3 /var/www/magento/index.php(126): Mage::run('default', 'store')
#4 {main}";s:3:"url";s:38:"/no-such-url";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

What did I do wrong?


texts: In customer group "Not Logged In" option not saved in db

texts:
In customer group "Not Logged In" option  alone not saved in db

  app/code/Vendor/Module/Setup/InstallData.php

<?php

namespace Vendor\Module\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{

    private $_eavSetupFactory;

    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->_eavSetupFactory = $eavSetupFactory;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $groupName = 'Hide Price';
        $eavSetup = $this->_eavSetupFactory->create(array('setup' => $setup));

         $eavSetup->addAttribute(
             \Magento\Catalog\Model\Product::ENTITY,
             'is_hide_price',
             [
                'type' => 'int',
                'input' => 'boolean',
                'label' => 'Hide Price Mode',
                'required' => false,
                'source' => \Magento\Eav\Model\Entity\Attribute\Source\Boolean::class,
                'default' => '0',
                'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
                'user_defined' => true,
                'sort_order' => 3,
                'group' => $groupName
             ]
         );

         $eavSetup->addAttribute(
             \Magento\Catalog\Model\Product::ENTITY,
             'is_customer_group',
             [
                'type' => 'text',
                'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
                'frontend' => '',
                'input' => 'multiselect',
                'label' => 'Use Current Price Mode By Customer Group',
                'required' => false,
                'source' =>'Vendor\Module\Model\Config\Source\CustomerGroup',
                'default' => '0',
                'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
                'user_defined' => true,
                'sort_order' => 4,
                'group' => $groupName
             ]
         );

        $entityTypeId = $eavSetup->getEntityTypeId(\Magento\Catalog\Model\Product::ENTITY);
        $attributeSetId = $eavSetup->getAttributeSetId($entityTypeId, 'Default');

        $eavSetup->addAttributeToGroup($entityTypeId, $attributeSetId, $groupName, 'is_hide_price');
        $eavSetup->addAttributeToGroup($entityTypeId, $attributeSetId, $groupName, 'is_customer_group');

    }
}

  app/code/Vendor/Module/Model/Config/Source/CustomerGroup.php

<?php

namespace Vendor\Module\Model\Config\Source;

use \Magento\Customer\Model\ResourceModel\Group\Collection;

class customerGroup extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource implements \Magento\Framework\Option\ArrayInterface
{

    protected $_customerGroup;
    protected $_options;

    public function __construct( Collection $customerGroup ) {
    $this->_customerGroup = $customerGroup;
    }

    public function toOptionArray()
    {
        if (!$this->_options) {
        $this->_options = $this->_customerGroup->toOptionArray();
        }
        return $this->_options;
    }

    public function getAllOptions()
    {
        if (!$this->_options) {
        $this->_options = $this->_customerGroup->toOptionArray();
        }
        return $this->_options;
    }
}

"NOT LOGGED IN" option is selected before saved

After saved:

Why "NOT LOGGED IN" option value '0' not saved in db

Product id ----> https://prnt.sc/rbe3wu
product attribute id of customer group ---> https://prnt.sc/rbdzuz
saved customer group value ---> https://prnt.sc/rbe3hh


texts: Magento 1 - Create Simple Controller Not Working In My Module?

texts:
I am Trying To create a Simple Module. It's Found 404 page Error.

My config file in app/etc/module/Ffay_All.xml

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

Create Controllrer in app\code\local\Ffay\Test\controllers\IndexController.php

class Ffay_Test_IndexController extends Mage_Core_Controller_Front_Action
{
   public function indexAction ()
   {
     echo 'test index';
   }
   public function mamethodeAction ()
   {
     echo 'test mymethod';
    }
}

And Create My Plugin xml file in app\code\local\Ffay\Test\etc\config.xml

   <?xml version="1.0"?>
  <config>
     <modules>
        <Ffay_Test>
          <version>1.0.0</version>
        </Ffay_Test>
     </modules>
     <frontend>
        <routers>
            <routeurfrontend>
            <use>standard</use>
            <args>
                <module>Ffay_Test</module>
                <frontName>testing</frontName>
            </args>
            </routeurfrontend>
        </routers>
    </frontend>
</config>

When I am Write testing in magento in display 404 page error. can You Tell me What's Issue?


texts: how to set custom function to cookie in magento2?

texts:
How to set uniqid in cookie in Magento2?

 public function generateVisitorId()
    {
         $visitorId = $this->_checkoutSession->get('visitor_id');
        if (!$visitorId) {
            $visitorId = uniqid();
         $this->_checkoutSession->set('visitor_id', $visitorId, $this->getExpiryTime(), '/');
        }
        return $visitorId;
    }

But id returning only  empty array .If any changes in code....If anyone knows please expain me....


texts: Only Authorize back orders but Authorize and Capture all other orders

texts:
I want to enable back orders but I want to only Authorize back orders but Authorize and Capture all other orders.

Is this possible to do? We are using Authorize.net and Magento Enterprise 1.12.02


texts: Truncate Meta Title and Meta Description in Magento2

texts: turncate Meta title and meta description on pdp page how we can do that in which file we need to make changes .


texts: How to redirect all 404 errors page to home page / specified url in .htaccess?


texts: Get Magento 1.9 qty of child products of configurable products in list.phtml

texts: I am trying to change the availability message in category view in the file list.phtml depend on the qty of the product. I did on the simple products but I couldn't manage to get results for the configurable products. I tried to use the function that I found on this answer How to get stock quantity of child product from configurable product in Magento 1.9. It is working as a function in the product view.phtml but in list.phtml I get an error like Undefined function getTypeId(). What I should add to solve the problem?


texts: Magento 2 SOAP exception: missing values for message placeholders

texts:
When calling the Magento2 SOAP API to create a new product, I get a generic error message saying 'Invalid product data: %1'. I was hoping that the Magento2 API would throw better exceptions than Magento1 but unfortunately they seem to be just as awful and generic.

Is there any way to get the actual exception somewhere? Or do we just trial and error?


texts: How can I use Highcharts graphs in magento2 custom module customer account section in the standard/recommended way with require js?

texts:
I need to use the Highcharts.com simple line graph by adding its library with requirejs-config.js in frontend luma theme, custom module in customer account section.

I have tried these solutions but till now it dosent work.
https://magento.stackexchange.com/a/144867/49186
https://magento.stackexchange.com/a/149020/49186

and also tried the
<link src="Vendorname_module::js/highcharts/highcharts.js"/> in my layout.xml
. The js file loads but the Highcharts object dosent create.

Still facing this issue.

Please help me in using the standard most recommended way to do this.


texts: Magento 2.2.2 issue mini cart not working

texts:
Centos 7 (se linux disabled)
nginx php 7.0.27
Luma theme
Magento 2.2.2

A very strange issue. Minicart not working I found a lot of posts but no one corrects my issue.
try setup:di / deploy static content fr_FR us_US

I see the mini cart updated when I add product. But when I click on this just blue button no text and button doesn't work.
In chrome developer mode I have this error:

Uncaught ReferenceError: Unable to process binding "if: function (){return getCartParam('summary_count') }"
Message: Unable to process binding "if: function (){return getCartParam('possible_onepage_checkout') }"
Message: Unable to process binding "click: function (){return closeMinicart() }"
Message: closeMinicart is not defined
    at click (eval at createBindingsStringEvaluator (knockout.js:2624), <anonymous>:4:87)
    at newValueAccessor (knockout.js:3839)
    at init (knockout.js:3849)
    at init (knockout.js:3842)
    at knockout.js:2989
    at Object.ignore (knockout.js:1249)
    at knockout.js:2988
    at Object.arrayForEach (knockout.js:151)
    at applyBindingsToNodeInternal (knockout.js:2974)
    at applyBindingsToNodeAndDescendantsInternal (knockout.js:2854)

I tried a test to switch interfaces to English US and it's working fine... No particular plugin.

Any idea ?


texts:
I am sending a string from helper file to email template
 $templateVars = [
                'store_credit_amount' => $storeCredit
            ]; // $15

In email template html file i use it like

 You’ve got  {{var store_credit_amount}}  in store credit.

But in email template which i get on email id, it shows span tag separately
When i add static number in email template it appears fine.
Not sure how to solve this, any thoughts ?


texts: How to check Magento Cloud patches available?

texts:
My Magento 2.3 Cloud is not updated, and I see some issues that when I reporting to Magento they send me a patch already released.
Is there a way to see the list of patches available?


texts: Programmatically generated forgot password link showing expired

texts:
I am trying to reset my password using below code,

$emailid  = $this->post('email_id');
    $customer = Mage::getModel('customer/customer')
            ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
            ->loadByEmail($emailid);
    if ($customer->getId()) {
        try {
            $newResetPasswordLinkToken =  Mage::helper('customer')->generateResetPasswordLinkToken();
            $customer->changeResetPasswordLinkToken($newResetPasswordLinkToken);
            $customer->sendPasswordResetConfirmationEmail();
            $this->response([
                'status' => true,
                'message' => 'Email sent successfully'
                ], REST_Controller::HTTP_OK); // NOT_FOUND (404) being the HTTP response code
        }catch (Exception $exception) {
            $this->response([
                'status' => false,
                'message' => 'Email ID is not registered with us.'
                ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
        }
    }

Above code it's working perfectly, I am getting mail also, But when I click reset password button in the mail, Its showing link expired.

I have noticed the password reset link, they have used two parameters (id, token). In the programmatically generated email, the link has only token, id parameter is missing. I don't know why id not coming.

Can any one help help me to fix this issue.
Thanks.


texts: Magento 1.9 : How to Get Customer Data using Rest API

texts:
We have tried to get Customer Data using the below URL. we have got the below error
URL: http://127.0.0.1/magento1940/api/rest/customer/:3
http://i.imgur.com/dMECF5D.png


texts: Magento 2: How to convert product array into collection?

texts:
I am a new developer of Magento 2.

I got an array of product items from order.

$products = $order->getAllVisibleItems();

However, getAllVisibleItems() get the array of products. I need to convert the array to collection so that I can render it by pager. what should I do ?


texts: Magento 1 get only those product collection which are not on sale in a category

texts:
I have created a cron which adds all products which have active special price from one specific category to another, now I want another cron to remove  products from that sale category which doesn't have active special price.
I am using this collection to get products on sale.

$products = $products->addAttributeToFilter(array(
                            array('attribute'=>'special_from_date','lteq'=>$current_date),
                            array('attribute'=>'special_from_date','eq'=>''),
                            array('attribute'=>'special_from_date','null'=>true)
                        ),'','left')
            ->addAttributeToFilter(array(
                            array('attribute'=>'special_to_date','gteq'=>$current_date),
                            array('attribute'=>'special_to_date','eq'=>''),
                            array('attribute'=>'special_to_date','null'=>true)
                        ),'','left');

$products->getSelect()->group('e.entity_id');

Now I changed the condition to

$products = $products->addAttributeToFilter(array(
                            array('attribute'=>'special_from_date','gteq'=>$current_date),
                            array('attribute'=>'special_from_date','neq'=>''),
                            array('attribute'=>'special_from_date','null'=>false)
                        ),'','left')
            ->addAttributeToFilter(array(
                            array('attribute'=>'special_to_date','lteq'=>$current_date),
                            array('attribute'=>'special_to_date','neq'=>''),
                            array('attribute'=>'special_to_date','null'=>false)
                        ),'','left');

But id doens't work


texts: How to display main menu item after the seleted submenu?

texts: Am working in magento 1.9.2.2. In mobile view, When I click the main menu the submenu items are displayed but the rest of the main menu items are sticking to the same place.I want the rest of the main menu items to be displayed below the opened submenu.


texts: How to retrieve a full list of payment methods and shipping methods/codes

texts:
I'm working on a Magento SOAP integration for a call center and am looking for a full list of configured values for the payment/credit card info and shipping methods/codes.

Because this is an integration for a call center rather than a website, we're attempting to save all the order information locally before pushing it across the SOAP api.  With this setup, I need to know all available shipping and payment option codes. (We would recreate logic on the call center side to insure invalid payment/shipping options are filtered out.)

I have attempted to use both the shoppingCartShippingList() and shoppingCartPaymentList() but those only show me available payment options for a specific shopping cart/quote that I have passed in.

Is anybody aware of an API that would show all these values without a populated cart, or the location that they would be configured in the management console/backend?

EDIT:words


texts: Cannot remove contact us from navigation menu

texts:
In Catalog -> Manage categories i have set "Include in Navigation Menu" No for contact us but still it displays in the menu. For other categories it works.

From the database level i went to catalog_category_flat_store_1 and changed include in menu to 0 for the contact us entity id and it worked. Still if i refresh the indexes it keeps appearing in the menu. How can i set include in menu to 0 permanently for contact us?

========update===================

I disabled my 3rd party extension sm megamenu and still contact us is there.


texts: Magento 2: Consequences of not Naming a plugin class `\Plugin`

texts:
Are there any consequences for using a plugin class in Magento 2 that doesn't end in \Plugin?  The docs suggest that this class should end in the name \Plugin.

  The name of a plug-in’s class or its virtual type. Use the following schema when you specify this element: \Plugin.

However, there's several code plugins that don't follow this.

<!-- #File: app/code/Magento/Weee/etc/frontend/di.xml-->
<plugin name="weee-app-action-dispatchController-context-plugin"
        type="Magento\Weee\Model\App\Action\ContextPlugin"/>

Are there any programmatic consequences to not using \Plugin in your class name?  Or is this just a convention -- similar to Magento 1's _Observer class name convention?


texts: Magento 2 Retrive the Shipping method and shipping rates programmatically

texts:
My current magento version is 2.1.7

I need exactly this but in magento 2

Retrive the Shipping method and shipping rates programmatically


texts: Attribute set sort order has gone - how to rebuild?

texts:
This code returned attributes set for dropdown menu - ordered by attribute set name ...

$sets = Mage::getResourceModel('eav/entity_attribute_set_collection')
    ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())
    ->load()
    ->toOptionHash();

Suddenly it changed to display sets orded by ID instead of name ...

What is your default sort for this code? Why could it change? Would like to understand, why behavoir changed ...

Update:

Checked eav_attribute_set table wher sort order is stored ... and its set to 0 for all set - only "default" has value 10.

Last thing I've made was to create a new set ....

No change ...

Update:

Found this ... How to sort the Attribute Set list on the Manage Products Grid dropdown menu?, BUT why did it work before?

(Whats your sort order for attribute sets?)

Update:

Suddenly sort order (by set name) is correct again. Without any changes made. Just added further sets.

Ideas? (Refreshed cache/indexes already yesterday)


texts: Getting "site can't be reached" after visiting public IP address, after using lightsail to launch a magento site

texts:
Every tutorial video I've watched, the user just creates a wordpress or a magento site using lightsail, assigns a static IP address and then pastes the public IP address onto the browser and it ends up loading the home page for them. But for me, I get a "site cannot be reached" error.
When I try visiting http://52.13.96.131/ I get site cannot be reached. I've made sure to assign a static IP address as well as make the ports open for everyone to be able to visit.

When I try to examine using curl, I get this result. But I don't have enough technical knowledge to further diagnose the problem. Is the root cause of the issue related to editing an apache file inside the server itself?  Thanks.
adlalas :: ~ » curl -Iiks https://52.13.96.131/ | grep -v Content-Security-Policy-Report-Only
HTTP/1.1 302 Found
Date: Fri, 09 Apr 2021 02:10:18 GMT
Server: Apache/2.4.46 (Unix) OpenSSL/1.1.1d
X-Powered-By: PHP/7.4.15
Pragma: no-cache
Cache-Control: max-age=0, must-revalidate, no-cache, no-store
Expires: Thu, 09 Apr 2020 02:10:25 GMT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Set-Cookie: PHPSESSID=11qq8j2ku7bqc7mjk7d8nrd3cf; expires=Fri, 09-Apr-2021 03:10:24 GMT; Max-Age=3600; path=/; domain=52.13.96.131; HttpOnly
Location: https://127.0.0.1/
X-UA-Compatible: IE=edge
Content-Type: text/html; charset=UTF-8


texts: In Magento 2 can I have the product page title be different than the product name?

texts: Is that configurable in admin or does it have to be done in the code base?


texts: Magento 2 - How to use admin panel email template in my custom module?

texts:
I have created the custom module for customer registration request including an email function also.
email function is working fine.

I have customized the email template using Marketing -> Communication ->Newsletter Template -> Add New Template.

When customer registration request the email template is not getting from the customized one.its getting from the module.

What i want to do to use the customized email template?

file -> email_templates.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
<template id="registration_request_template" label="Customer Registration Request" file="registration_request.html" type="html" module="E25media_CustomerRegistration" area="frontend"/>

Controller email

$full_name = $first_name." ".$last_name;
        $templateOptions = array('area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => $this->_storeManager->getStore()->getId());
        $templateVars = array(
                    'store' => $this->_storeManager->getStore(),
                    'full_name' => $full_name,
                    'email' => $email,
                    'phone' => $phone,
                    'company' => $company,
                    'position' => $position,
                    'vessel' => $vessel
                );
        $from = array('email' => $email, 'name' => $full_name);
        $this->_inlineTranslation->suspend();

        $to = array('mujahidhaseem@gmail.com');
        $to = $this->getCustomerSupportEmail();
        $transport = $this->_transportBuilder->setTemplateIdentifier('registration_request_template')
            ->setTemplateOptions($templateOptions)
            ->setTemplateVars($templateVars)
            ->setFrom($from)
            ->addTo($to)
            ->getTransport();
        $transport->sendMessage();
        $this->_inlineTranslation->resume();


texts: Magento invoice bundle price including tax

texts:
On the invoice that is generated by Magento simple products price displays including the TAX which is correct, but for bundle products the single products price displays exclusive of TAX despite what is set in the admin.

How can I make this display the price inclusive of TAX?

Looking at the code it is currently using
$price = $order->formatPriceTxt($_item->getPrice());

Some images to demonstrate the issue more

Order back end

Invoice PDF