texts: Magento 2: Get Customer data before login with observer

texts:
I want to check customer group around the login process

and want to add some custom code over there.

Anyone have any idea?

Please tell me.


texts: Magento 2 : What's the best way to add custom html to a product block in the product list?

texts:
I thought this would be better in Magento 2, but currently (Magento 2.1.4) Magento still has a quote complex way of rendering a product list. I'm talking about vendor/magento/module-catalog/view/frontend/templates/product/list.phtml. This is the template that is responsible for rendering the catalog- and the search results list.

The task

We all had the task at some point where the client requests a small addition to this template. Perhaps a product label, or an additional image, etc. But this template has very few points to hook into. The way I currently see it, when you want to make a modification to this list there are the following options:

The posible options

Copy/paste the phtml-file to your design folder and make the adjustments there. This - of course - is no option if you want to modify this template from within your module.
Add a modified template to your own module and point Magento to it from  within your own custom catalog_category_view.xml. However, this could give unexpected results when using 3rd party templates. And I generally don't like the idea to overrule such a big template purely for a minor edit.
Rewrite the default product details renderer. This however gives the problem that as soon as you have a configurable product the default renderer is no longer rendered.
Hook into the addto-block (since this is the only place in the template where getChildHtml() is called for dynamicly added child templates.
Use JavaScript to enrich the html later on. This might seem a bit like the wrong solution for the problem, especially when what you're trying to render can already be done server-side.
There are some other hacky options (like using plugins to modify the output with regexp), but those are so not-done that I won't even discuss them here.

The question

So with the above options that I currently can think of, what would be the best approach to add custom html the the product block (in the product list). I'm currently tending toward the 'addto'-method, although it also seems like it's not the exact right place for the job. But at least it allows me to:

Minimize the changes I have to do about core templates.
Maximize the compatibility with external templates.
Keeps my own logic separated.

Of course it would be nicer if the rendering of a single product provided more hooks to manipulate the output (or at least, don't wrap the whole thing inside one massive foreach-loop inside list.phtml). Perhaps there are plans for this in the future?

What are your suggestions on this task?


texts: How to edit the format of 'Part#' on the product page in Magento 1.9.2.4

texts:
I researched and found that I can find the 'part#' in view.phtml in app/design/frontend/default/mencom/template/catalog/product. The most relevant row I could find is

        <?php echo $this->__('SKU');?><?php echo $_product->getSku();?>

But it doesn't say anything about 'Part#' in the code.

All I want is to add a space between 'Part#' and SKU(T35-...)

Thank you for your help in advance.


texts:
I currently have a code capable of updating the stock of products but this code involves updating the stock of each product one by one.
Is there any functionality capable of sending an array of SKUs and quantity and that is processed internally?


texts: Where to place magento 2.2.x custom interceptor

texts:
I am trying to look for a proper document where it is clearly told about where to place my interceptor code for continuous programming

This document https://devdocs.magento.com/guides/v2.2/extension-dev-guide/plugins.html explains clearly about before around after methods but it does not say where to properly place code to continuously program and test

should I place my code inside vendor folder and keep on programming ? will it auto load? or should I place into to the "/" location of the Magento installation ?

If I keep on changing code, will it detect?

My setup is d:\dev\xampp\htdocs\magento where will place the code


texts: Magento 2 want to add itemprop="image" tag in image field

texts: I want to add itemprop="image" to main image on product page. How can I achieve this.


texts:
Currently, in my minicart.phtml override file I have knockout.js code like this to display the number of items in my cart:

        <!-- ko if: getCartParam('summary_count') -->
            <!-- ko text: getCartParam('summary_count') --><!-- /ko -->
            <!-- ko i18n: 'items' --><!-- /ko -->
        <!-- /ko -->

If an item is added to my cart I also want to display the current cart subtotal. Is there a method for directly displaying this with knockout.js or is there another simpler way to achieve this? How do I find out what other things I can display with knockout.js?


texts:
I want to rewrite the url of product from
www.example.com/product-name.html
To
www.example.com/SKU.html
Someone can help me? The products we sell are unique, but share the same name. So when we add two different products with the same name, it throws back the error that that URL already exists.


texts: Deprecated Functionality: The each() function is deprecated when run the commands in terminal

texts:
I have installed magento 2.2.6 version in php 7.2. After the installation i tried to run the cache clear commands. But there was an error thrown called,

Deprecated Functionality: The each() function is deprecated. This message will be suppressed on further calls in /var/www/html/xxxxxxxx.com/vendor/magento/zendframework1/library/Zend/Cache/Backend.php on line 79

After i downgraded my php version from 7.2 to 7.0 i've done all the required things, disabled 7.2 and enabled 7.0, when i run info.php it showing the right version. But still the same issue is happening. I don't know where is the problem kindly help me to fix this.

Note: in terminal when i run php -v it showing php 7.2. Thanks in advance


texts: What stopObserving() function is used for - Magento 1.9

texts: I want to know what the js function stopObserving() is used for.


texts: which phtml file is called by $this->renderTotals()?

texts:
In following path, app\design\frontend\MYTHEME\default\template\checkout\cart\totals.phtml file contains $this->renderTotals().

My question is that, which phtml file is called by renderTotals() method ?

I want to update Subtotal, Shipping & Handling (Flat Rate - Fixed), Grand Total style in http://localhost/MYTHEME/index.php/checkout/cart/


texts: Jquery prototype conflict IE7 and 9 already using noConflict()

texts:
I am using noConflict() function within a template page on a Magento site and I'm pretty sure my code is in the correct order on the following page (view page source): http://animalnecessity.com/company/where-to-buy. The script is working on all major browsers except for IE7 the clickable maps do not show up at all and in IE9 you cannot click on the maps. I am receiving the following error in IE7: SCRIPT1028: Expected identifier, string or number where-to-buy, line 245 character 4 which is pointing to the second to last line of this block:

J(function(J)
            {
                J('#map-usa').cssMap(
            {
                'size' : 960,
                'tooltips' : 'floating',
                'cities': false,
            });
            });


texts: Search for products by URL in the dashboard

texts:
Is there a way to search for products by URL in the dashboard (catalog->manage products)?

Often I have the URL of the product but have trouble finding the product.

How do you proceed?


texts: Magento 2: what's the status of M2 regarding PSR compliance?

texts:
So according to the official documentation, I understand that Magento 2 is PSR-1 and PSR-2 compliant.

I'm wondering if Magento 2 is (or will be) compliant with the others ones ?

PSR-3: Logger Interface
PSR-4: Autoloading Standard
PSR-6: Caching Interface
PSR-7: HTTP Message Interface

The answer I expect could also consider the draft PSR


texts: Some Magento tables are not InnoDB, is it safe to convert all tables to InnoDB?

texts:
I am using AWS RDS Read Replica. It constantly has issues with Magento's Memory engine tables. For backup and read replicas RDS loves InnoDB. Can I safely change all tables to InnoDB?

In addition I get the following warning from AWS:

  DB Instance magento-monin-prod-db contains MyISAM tables that have not been migrated to InnoDB. These tables can impact your ability to perform point-in-time restores. Consider converting these tables to InnoDB. Please refer to http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.MySQL.CommonDBATasks.html#MySQL.CommonDBATasks.Tables

Plausible Answer

Still interested in feedback. I will add this as an answer if I don't find any issues within the next 24 hours. The steps I took below appear to be safe, so far. My biggest concern was Magento's Memory Engine tables (tables ending in_tmp) and the impact it might have on indexing.

Here is what I did:

SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE (ENGINE = 'Memory'  OR ENGINE='MyIsam') AND TABLE_SCHEMA='magento_db'

For me this returned mostly temporary index tables and magento module tables, so not a lot of critical core tables to be concerned about and few enough tables that I can easily execute another alter table if stuff hits the fan.

For each table returned I executed: Alter table {table-name} ENGINE=InnoDB;

I'd be nervous to try this if none of your tables are InnoDB. But, as I said before, there were only a few core tables on my instance that needed to be modified.


texts:
I am creating a fixtures yaml file to create a sample product for my unit tests - using the EcomDev phpunit plugin for Magento.

The issue is that I need to set store specific values for price.  I have managed to get this working fine for website specific values like so:

eav:
  catalog_product:
    - entity_id: 1
      type_id: simple
      sku: book
      name: Book
      short_description: Book
      description: Book
      url_key: book
      price: 12.99
      tax_class_id: 2
      status: 1
      visibility:
      /websites:
        uk: # this is the website code
          price: 12.99

However when I try with stores instead of websites at the bottom, the store specific values are not being set:

/stores:
  artista_uk: # this store does exist in the database
    price: 16.99

The way I have tested this is by viewing the catalog_product_entity_decimal table and seeing if a price value appears next to the relevant store id.

The documentation can be found here:
http://www.ecomdev.org/wp-content/uploads/2011/05/EcomDev_PHPUnit-0.2.0-Manual.pdf
Which does say you can interchange websites with stores

Any ideas would be great.

Thanks.


texts: How to Change/Modify Content of Slider in Magento 2 PWA

texts:
I have setup venia theme in Magento 2.3 instance. But, now I want to change and add some content in product slider.
I want to also know that from where these content load and display.
How can I change it?
Any help would be appreciated.
Thanks.


texts: Magento 2 : Add custom field in customer registration form without customer attribute create

texts:
I want to add custom field in customer registration form in magento2.

I don't want to make it customer attribute and want to save in custom table.

Can anyone help me


texts:
Using attribute Id how to get attribute label in magento 2.1.
example :

    Array
       (
         [93] => 30
         [188] => 26
         [189] => 15
        ).


texts: If Description is empty copy from short description

texts:
I have many products that have no description but all have short descriptions
How can I copy from short description if description is empty?


texts: How to fetch store information with all attributes in magento api

texts:
I am stuck here for develop new API for stores information in Magento.

I'm trying to fetch store info from default API but it's not useful for me. I need all attributes what we have in admin like address, telephone, store images etc..

Please help me.


texts: get the html of a product as it would render in category page

texts:
I need to write a controller that get a product id and return the html that this product would generate if shown in a category page.

for example:

To be clear I got everything working to the point of getting the HTML. I tried several methods but they all failed, and I'm not sure what's the right approach to do it.

Thanks!


texts: Admin login won't remember password after upgrade

texts:
I've upgraded a magento CE site from 1.6 to 1.8.1 and after the upgrade several issues have popped up.
The admin login screen will now no longer remember the password (the browser doesnt ask to remember nor does it fill in the fields).

Any ideas as to why and/or how to fix it?


texts:
I have 2 root categories and subcategories in every one of them.

One of root category(Default Category) and sub categories are showing on navigation menu. It's OK. That's what I want.

The other root category (name: Collections) is not showing in navigation menu and I can't access any collections's subcategory's page. It's getting 404 error.

I think it's related to System > Manage Stores page root category settings. It's saying Root category is default category.

So If you understand what I mean, how can I access not-default root category(Collections)'s subcategories?


texts: Magento 2 Google recaptcha issue in multiple websites

texts:
I have installed Google Recaptcha extension(msp/recaptcha) using composer.
It's installed successfully and working in default website and not working in other websites.
When I check the console it's giving 404 Page not found error

  535dc1ddcd538f1a68d2c8d093103e2f.min.js:120 GET https://www.google.com/recaptcha/api.min.js net::ERR_ABORTED 404 (Not Found)

Enabled js minification and merge for all the websites but in default website Recaptcha is loading with https://www.google.com/recaptcha/api.js

For other websites it's trying to load api.min.js which is not exist.

If I disable JS minification and merge then Recaptcha is working for all the websites.


texts: DROP TABLE syntax commented in install scripts?

texts:
What is the purpose behind having DROP TABLE IF EXISTS in commented SQL in Magento installers?

From app/code/core/Mage/Admin/sql/admin_setup/mysql4-install-0.7.0.php:

-- DROP TABLE IF EXISTS {$this->getTable('admin_assert')};
CREATE TABLE {$this->getTable('admin_assert')} (

I know in mysqldump certain comments can be executed - how is this used in Magento setup scripts?


texts:
I have a site with approx 6500 products. The are constantly running into problems where they run up against the hosting companies PHP Process limit.

I have been running a SQL profiler against their site today and came up with the following slow queries:

SLOWEST: UPDATE catalogsearch_query SET is_processed = '0' (13s)

The next slow query is the actual search on the catalog search query table. (78,000 rows)

My question: Can I truncate this table?

Here are all the queries by threads during the day in order of slowness


texts:
I want to add the global amount field in the text that I added in the invoice pdf.
    public function insertConditions($page)
{
    $page->drawLine(25, $this->y, 570, $this->y);
    $this->y -= 25;
    $page->drawText(Mage::helper('sales')->__('The order amount with a value [global amount] of has already been paid..'), 35, $this->y, 'UTF-8');

}


texts: Recommend Buy Online Pick up in Store Extension v2.3

texts:
I'm looking for recommendations for extensions for buy online, pick up in store for Magento Cloud v2.3

Preferably with a Map locator component.  Any recommendations that work with v2.3 cloud greatly appreciated.


texts:
I seem to be having a problem with the merge css function on magento, when i do this the admin panel css seems to  break, I've tried uploading the admin folders again but its still the same. As soon as i turn merge css off, it's fine.

I tried clearing cache etc but no joy.


texts:
I recently changed my magento to use HTTPS for all secure and unsecure urls. The one thing I notice is that all my internal links are set to HTTP instead of HTTPS, which slows down the website since the requestes are getting redirect to HTTPS.

Any ideas on how to set the internal link to HTTPS

Thanks


texts: Google Cloud Platform and Preemptible VM Instances with Magento

texts:
I am developing a Magento (CE 1.9.1) store that I want to host on Google's Cloud Platform.  One of the options in their pricing calculator is the VM Class, which has 2 options: Regular and Preemptible.  From the resources that Google provides, I have a basic understanding of what Preemptible VM Instances are, however, I can't figure out how this would affect my store once it's online.  There is a drastic difference in price between preemptible and regular and I want to make sure that I'm not overpaying for services that aren't necessary.

How would a Magento store perform with preemptible instances?  Would users experience broken pages or does this mainly apply to large scripts such as cron jobs?  Any insight to preemptible instances and website performance is greatly appreciated.


texts: The use of helpers in templates is discouraged. Use ViewModel instead warning in magento 2

texts:
$extensionStatus=$this->helper('Esparksinc\Extension\Helper\Data')->getConfig('Extension/general/enableDisable');

how to use viewmodel instead helper method to acces the system.xml values in phtml in maganto 2


texts:
I have been getting a "Forbidden" error when trying to make specific api calls. The API login and session retrieval work fine, but when I call salesOrderInfo or storesList functions I get that exception error. This is working on other magento installations on the same server. I have tried resetting the magento permissions with 664 on all files and 755 on all folders and 777 on mage folder.  Here is my code:

    try{
        $soap = new SoapClient('http://magentohost/index.php/api/v2_soap?wsdl=1');
    }catch(\Exception $e){
        echo 'SoapClient: ' . $e->getMessage();
    }
    try{
        $sessionId = $soap->login($api_user, $'api_key);
    }catch(\Exception $e){
        echo 'soap login: ' . $e->getMessage();
    }

    $filter = array('complex_filter'=> array(
        array(
            'key' => 'CREATED_AT',
            'value' => array('key' => 'from', 'value' => $minDate)
        ),
        array(
            'key' => 'created_at',
            'value' => array('key' => 'to', 'value' => $maxDate)
        )            )
    );

    try{
        $ordersResult = $soap->salesOrderList($sessionId, $filter);
    }catch(\Exception $e){
        echo 'salesOrderList: ' . $e->getMessage();
    }

    foreach($ordersResult as $order){
        //get order details
        try{
            $orders[] = $soap->salesOrderInfo($sessionId, $order->increment_id);
        }catch(\Exception  $e){
            echo 'salesOrderInfo: '. $e->getMessage() . '<br/>';
        }
        //get store name for filtering
        $storeName[] = explode("\n", $order->store_name);
        $count++;
    }

    try{
        $stores = $soap->storeList($sessionId);
    }catch(\Exception $e){
        echo 'storeList: ' . $e->getMessage();
    }

After a bit more testing I noticed that it will only let me make 1 api call before giving forbidden error. I am not sure why that is, but I feel like it is important.


texts: Inchoo facebook connect "Sorry, could not retrieve your Facebook first name. Please try again."

texts: Hi i am using facebook connect from inchoo.. but when ever i try to login through my account it says "Sorry, could not retrieve your Facebook first name. Please try again."


texts: Get selected product options on configurable product

texts:
When I select the product options of configurable product on my website I get a pop-up with the added product. I want to show the selected options on the pop-up. I already got the following code which shows the label, but i can't seem the selected options to show in the pop-up.

Can someone tell me how to get the selected options on the pop-up.

For example:

I want 'Product A' with options: Color: black and size: 16. I add this product to cart and want to see the pop-up with both Color: black and Size: 16

                        <?php

                        foreach ($_product->getTypeInstance()->getConfigurableAttributes() as $attribute) {

                            echo '' . $attribute->getLabel() . '	'. $attribute->getValue($_product).'
';

                        }
                        ?>


texts:
I can't get Grunt working on Magento 2.  I'm going through the devdocs and have run the following commands to set up grunt:

$ sudo npm install -g grunt-cli
/usr/bin/grunt -> /usr/lib/node_modules/grunt-cli/bin/grunt
/usr/lib
└── grunt-cli@1.2.0

$ sudo npm install
$ sudo npm update
$ grunt watch
Running "watch" task
Waiting...
^C

Execution Time (2017-03-20 17:24:18 UTC-0)
Total 2m 47.1s

$ grunt clean:nova
Running "clean:nova" (clean) task
>> 0 paths cleaned.

Done, without errors.

Execution Time (2017-03-20 17:27:07 UTC-0)
loading tasks  749ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 97%
clean:nova      14ms  ▇▇▇ 2%
Total 769ms

$

grunt watch does nothing, it just says waiting.... And while grunt clean seems to work, I'm not sure how I can verify this.

Of course I edited on of my theme's less files...
app/design/frontend/Holy/nova/web/css/source/_extend.less

I have magento2 running in a vagrant box on my OSX host.  I've tried running grunt on both the vagrant box & OSX host without success on either.

However, the server side less compilation is working, it was before I tried to try grunt.  I can see my less changes take effect once I clear the cache with:

php bin/magento cache:clean; php bin/magento cache:flush; rm -rf pub/static/frontend/Monsoon/nova/en_IE/ ; rm -rf var/view_pre

processed/

I'm not sure what the advantage is with using grunt in my workflow if the server compiles the less files.  Just trying to get a grip of Magento2.


texts:
i have google map api i just want get these longitude and latitude
my phtml code is

<?php $address=$_GET['location'];//location=Manhattan

$address = str_replace(" ", "+", $address);
$url="https://maps.google.com/maps/api/geocode/json?address=$address&key=".$block->getApiKey();

it will genrate a link i.e https://maps.google.com/maps/api/geocode/json?address=Manhattan&key=AIzaSyBr3mn7y42_iHMTcE_5zEJk_uSGCFXIFGk

i just want this link data into my php variable to pass in longitude and latitude of my script function


texts:
I turned on SID using store>configuration>general>web>use Store ID in frontend but it does not show in the front end. I've tried looking for solutions but all I could find is how to disable SID instead of enabling it. How can I troubleshoot this problem?

Magento version: 2.1.7


texts: 4 questions regarding Weight attribute product

texts:
While learning "How to Add a NEW product in Magento 1.9", I came across few fields (attributes) and totally confused and 3 doubts barricaded me to move further...

What is the use of weight field in General tab of product creation form, I gone through the Megento user guide where it mentioned for weight attribute - "Enter the Weight of the product, which is used to calculate shipping".
I referred many examples and found some number are enter in weight field for example - 0.3000 or 1, I want to know which measurement unit is used for this attribute.
How I will calculate the final cost of the product, for example -
Green beans with different weight in drop down 100g, 150g, 200g, 250g, 300g, 500g (Yes I added this drop down by using custom option tab). Also Qty is there suppose buyer need 1.5Kg then they may select 500g from weight and enter 3 in Qty text field. Price of item is 10.75 for 100g. And this non taxable good.
So the Total price of the item is 1500g*10.75 = 161.25, Now how can I perform this calculation or where I need to setup this formula.
If in some product price varies based on weight, then shall I enter the price in custom Option Tab in front of respective weight like this -

Title* Price* Price Type*
100 g           Fixed
150 g           Fixed
200 g           Fixed
250 g           Fixed
300 g   9.00    Fixed
500 g   8.50    Fixed

Suggestion / Guidance/ Advice any thing will help me to move on step. For reference I attached 1 image of my store


texts: Magento 2 - Clear cache in 3 Servers programatically?

texts:
I am in a project which uses 3 servers to serve a Magento 2 site. I have written a code to clear cache and re-indexing. But for certain reasons the cache flush has to happen in all the three servers.
The reason i am looking for these approach because after every csv product update we need to manually run all these commands.
So, I am looking for a programmatic approach by which i can trigger the re-indexing and cache flush commands after CSV product upload.

<?php
/**
 *
 * Reindex the indexes and perform chache flush
 *
 */
 namespace Retailinsights\Testing\Controller\Index;

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

  protected $_indexerFactory;

  public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
    \Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool,
    \Magento\Indexer\Model\IndexerFactory $indexerFactory
  ) {
    parent::__construct($context);
    $this->_cacheTypeList = $cacheTypeList;
    $this->_cacheFrontendPool = $cacheFrontendPool;
    $this->_indexerFactory = $indexerFactory;
  }

  public function reindexAll() {

    /* reindexs the following category */
    $indexer_ids = [
        //"design_config_grid",
        //"customer_grid",
        "catalog_category_product",
        "catalog_product_category",
        "catalog_product_price",
        "catalog_product_attribute",
        "catalogsearch_fulltext",
        "cataloginventory_stock",
        //"catalogrule_rule",
        //"catalogrule_product"
    ];

    foreach ($indexer_ids as $indexerId) {

        $indexerFactoryObject = $this->_indexerFactory->create();
        $indexerFactoryObject->load($indexerId);
        $indexerFactoryObject->reindexAll();

        // destroy object
        unset($indexerFactoryObject);
    }
    return $this;
  }

  public function cacheFlush() {

    $typeCollection = $this->_cacheTypeList->getTypes();

    foreach ($typeCollection as $type) {
        $this->_cacheTypeList->cleanType($type->getId());
    }

    foreach ($this->_cacheFrontendPool as $cacheFrontend) {
        $cacheFrontend->getBackend()->clean();
    }
  }

  public function execute() {

    /**
     *  reindex
     */
    $this->reindexAll();
    /**
     *  Cache Flush
     */
    $this->cacheFlush();

    }
  }


texts:
I wanted to summarize the purchase on the success page, as if it were a cart with all the products that the user bought, with the image, product name, quantity and price of it. From the code below I can see how many products are in the cart, but I can not get them and assemble the HTML portion of this summary.Thanks in advance.

$order = Mage::getSingleton('sales/order');
$order->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());
$_items = $order->getAllItems();
echo count($_items);


texts: which is better to use Data feed or Google Content API (Google merchant)

texts:
I have a store with over 20K+ product out of which i have listed around 15K product to Google shopping using Magento Google shopping extension that makes use of Google content API.

I also need to import inventory changes on daily basis which i do it using Magmi.

I am not sure, if this product are synced with Google merchant on real time, due to which i am facing issue. Few product which are out of stock are still showing as in stock on Google Shopping.

I always run the data Synchronization process, but thats a very time consuming job and takes hours to finish.

Can any one please guide me how i can do a real time sync with Google merchant.

And, Is using Magmi a good option for importing data on daily basis?

Your feedback can help me a lot.
Thank You.


texts: Magento after upgrading to 2.2 issue coming while editing product

texts:
I did upgrade Magento from 2.1.4 to 2.2.2

I am getting issue while editing the product in back end.

  1 exception(s): Exception #0 (Exception): Warning: Illegal offset type
  in isset or empty in
  /vendor/magento/module-ui/Config/Reader/Definition/Data.php on line
  126

  Exception #0 (Exception): Warning: Illegal offset type in isset or
  empty in /vendor/magento/module-ui/Config/Reader/Definition/Data.php
  on line 126
  /vendor/magento/module-ui/Config/Reader/Definition/Data.php(126):
  Magento\Framework\App\ErrorHandler->handler(2, 'Illegal offset ...',
  '/var/www/html/u...', 126, Array)
  /vendor/magento/framework/View/Element/UiComponentFactory.php(382):
  Magento\Ui\Config\Reader\Definition\Data->get(Array)
  /vendor/magento/framework/View/Element/UiComponentFactory.php(396):
  Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array,
  Array, false)
  /vendor/magento/framework/View/Element/UiComponentFactory.php(396):
  Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array,
  Array, false)
  /vendor/magento/framework/View/Element/UiComponentFactory.php(396):
  Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array,
  Array, false)
  /vendor/magento/framework/View/Element/UiComponentFactory.php(305):
  Magento\Framework\View\Element\UiComponentFactory->mergeMetadataItem(Array,
  ..........
  ..........


texts:
I have Magento 1.9 installed, and have approximately 3,000 products. We've been doing a ton of CSV importing, and I'm getting concerned about the size of the database.

In particular, these 3 tables concern me:

catalog_product_index_price - 442,442 rows
catalog_product_index_price_idx - 442,442 rows
core_url_rewrite - 270,749 rows

I have truncated the core_url_rewrite table in another Magento system, and everything was fine once it reindexed.

But I'm not sure about catalog_product_index_price and catalog_product_price_idx - can I truncate those 2 tables? Will they rebuild themselves after we reindex?

Please advise.


texts:
I would like to export the last 1000 orders with following fields:
order id, customer email, first name, last name.

Is there an easy way to export a CSV like this? I do have access to PHPMyAdmin.


texts:
Because of the Black Friday, I've added some products as an offer. They can be shown on the main page with a block I had initially hidden with some CSS on my styles.css file.
This morning, I removed the display:none I had in my styles.css. Apart from this, I cleaned server's cache, flushed css/js cache and changed my .htaccess css catch time from 1 week to 1 second.
After doing all this stuff I couldn't still see that block if I didn't clean the cache from my browser.
Isn't there a way to avoid people cleaning their cache's browser and see my css as it is?
By the way, I have installed FPC module, my css files are merged and I have gzip caching on .htaccess, just in case it's related to any of these.


texts:
I am following this doc page for installing ElasticSearch. This requires Java so again I followed this doc page to install Java.

The commands are,

add-apt-repository -y ppa:webupd8team/java
apt-get -y update
apt-get install -y oracle-java8-installer

The 3rd command threw bellow error.

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package oracle-java8-installer is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'oracle-java8-installer' has no installation candidate

After some search I found out from here that the Java is no longer free.

Question: Should I purchase Java License if I want to use/install ElasticSearch?


texts: Make the compare list work without filling the log_* tables?

texts:
The Magento compare list feature only works, when the log_* tables are being filled. If they are not, the compare list is global, which means, whenever a customer adds to the list, every other customer can see that recently added item. I disabled (and cant enable) this feature by putting this in my local.xml:

<controller_action_predispatch>
    <observers><log><type>disabled</type></log></observers>
</controller_action_predispatch>
<controller_action_postdispatch>
    <observers><log><type>disabled</type></log></observers>
</controller_action_postdispatch>

Removing this makes the compare list work right away. The question is, is there a workaround for that? Is there a way to make the compare list work and not fill the log_* tables?

Thanks!


texts:
I want to do redirect after do function from model. I already tried both code below, both works redirect, but both return error too.

Redirect 1 :

$this->_redirect('*/*/addresses');

Redirect 2 :

$resultRedirect = $this->resultRedirectFactory->create();
return $resultRedirect->setPath('*/*/addresses');

Is there another way to redirect from model without returning error?


texts:
In my magento app, google sitemap generation frequency is set to daily. For the last 4 weeks, I see email saying the following error:
Sitemap generate warnings: dbModel read resource does not implement Zend_Db_Adapter_Abstract

Is there anybody who has any idea about this error?


texts: M2.4.2 Cookie restriction mode not working (any more) Analytics drop

texts:
when enabling the Magento Cookie Restriction Mode OR a separate module doing the same thing (amasty cookie consent), there is the same problematic behaviour, since M2.4.2 / GTM v.1.10.5 module Welpixel :
A drop of 50% (!) of Users in Google analytics.
This is an error and unrealistic, because we had before a rejection rate of max 7-10% for marketing cookies.
The behavior is reproducible "ON / OFF" . Either Amasty cookie consent module OR built in Magento Cookie Restriction Mode
Please see screenshots.
Before M2.4.2 / GTM v.1.10.5 there was no problem.
Does anybody faces the same problem?


texts: Invalid email address "admin@eternal.florist"

texts:
Hi I bought this new fancy domain name and now I'm in trouble.
I was trying to set that into store email addresses in Magento admin.
And got the above error. What do I do?

(I've also attempted to change it in the DB. But I can't find the table holding it)


texts: Magento 2.3.3 -Data Migration tool from composer chmod(): Operation not permitted error

texts:
I am trying to Install Magento 2.3.3 Data Migration tool version 2.3.3 but i am facing an error and it got killed in between.
I am using in Ubuntu 18.4 and Xampp 7.2

I have tried composer require magento/data-migration-tool:2.3.3 -vvv also but again after a long break it throws this error.

is there anyway where i can successfully download this tool with its all dependencies without bug.
And also suggest me a simple and good tutorial for migration.
Small help will be greatly appreciated.
Thanks in Advance :)


texts: HTML tag in widget not show as HTML element when insert to the CMS page

texts:
I have created a widget text box that contains just an HTML tag.

Some heading

and then insert this widget to a CMS page with url: "cms_page_link".
When I hit the CMS page URL, for example:
http://example.com/cms_page_link/
the page show that widget content just as string with quoted:

"
Some heading
"

not the HTML element as I expected:

Some heading

Have anyway to get HTML tag as normal?


texts: Magento2 Certain Mobile Product Page Images too big - not responsive

texts:
I have having an issue with some product pages. The images are too big causing the entire page not to be responsive. It only happens with some product pages, not all. All product pages use 1200x1200 sized images, and are setup exactly the same way.

All other pages on the website (home, category) are responsive and look great on mobile. But some of the product pages, the images are too big, causing the rest of the page to lose its responsiveness.


texts: Magento2 - How to stop redirecting to Shopping cart on canceling Paypal payment?

texts:
In default Magento2, on canceling paypal express checkout (closing the paypal popup), redirects to the Shopping Cart. Is there an easy way to stop redirecting to shopping cart and display the success/error messages on checkout page itself?
Any help/suggestion is appreciated!

Thank you!


texts: Convert super attributes to simple attributes

texts:
I have configurable products with 3 super attributes, but now I need only one super attribute, the other two (that has only one option each one) now have to be simple attributes with the value of the only option they have.

Now:

super attributes: size (multiple options), color (only one option),
fit (only one option)

Need:

super attributes: size (multiple options)
simple attributes: color (for example: 'red'), fit (for example: 'slim')

I'm trying this way:

$_configurableProducts = Mage::getModel('catalog/product')
        ->getCollection()
        ->addAttributeToSelect('*')
        ->addAttributeToFilter('type_id', array('eq' => 'configurable'));

foreach ($_configurableProducts as $key_number => $_product) {
    $productAttributeOptions = $_product->getTypeInstance(true)->getConfigurableAttributesAsArray($_product);

    $attributeOptions = array();

    foreach ($productAttributeOptions as $productAttribute) {
        foreach ($productAttribute['values'] as $attribute) {
            $attributeOptions[$productAttribute['label']][$attribute['value_index']] = $attribute['store_label'];
        }
    }

    $attributeOptions = $attributeOptions['Color'];

    $color = array_values($attributeOptions)[0];
    $color_group = $_product->getColorGroup();

    //Get product attributes
    $usedProductAttributeIds = $_product->getTypeInstance()->getUsedProductAttributeIds();
    $configurableAttributesData = $_product->getTypeInstance()->getConfigurableAttributesAsArray();
    $fitValue;

    //Remove Colors and fit from configurable attributes
    for ($i=0; $i <= count($configurableAttributesData); $i++) {

        if ($configurableAttributesData[$i]['label']=='Fit') {
            $fitValue = $configurableAttributesData[$i]['values'][0]['label'];
            unset($configurableAttributesData[$i]);
        }

        if ($configurableAttributesData[$i]['label']=='Color') {
            unset($configurableAttributesData[$i]);
        }

    }

    $_product->setCanSaveConfigurableAttributes(true);
    $_product->getTypeInstance()->setUsedProductAttributeIds(array(134));
    $_product->setConfigurableAttributesData($configurableAttributesData);

    $_product->setColor($color)
        ->setFit($fitValue)
        ->setColorGroup($color_group)
        ->save();
}

But after this code color and fit remain as super attributes.

I tried also:

$sql1 = "DELETE FROM catalog_product_super_attribute WHERE attribute_id = 92;";
$sql2 = "DELETE FROM catalog_product_super_attribute WHERE attribute_id = 135;";

$conn->query($sql1);
$conn->query($sql2);

This way I have size as the only superattribute, but color and fit have no value.


texts: Override Magento Core Abstract Controller

texts:
I want to override Mage_Adminhtml_Controller_Action in my module Mycompany_Mymodule.

I've searched the net,but I couldn't find anyway to do this. Is it like the controllers, or it has a different way?

I appreciate any help.


texts: Custom sort by is not working with elastic search in magento 2.3

texts:
After upgrading magento 2.3 and enabling magento new feature elastic search 6, My custom module for sort by is not working. It is perfectly fine working with MySql option but not working with elastic search.

Below is my custom module code:

CS/SortBy/Plugin/Product/ProductList/Toolbar.php

<?php
namespace CS\SortBy\Plugin\Product\ProductList;

class Toolbar
{
    /**
    * Plugin
    *
    * @param \Magento\Catalog\Block\Product\ProductList\Toolbar $subject
    * @param \Closure $proceed
    * @param \Magento\Framework\Data\Collection $collection
    * @return \Magento\Catalog\Block\Product\ProductList\Toolbar
    */
    public function aroundSetCollection(
        \Magento\Catalog\Block\Product\ProductList\Toolbar $toolbar,
        \Closure $proceed,
        $collection
    ) {
        $this->_collection = $collection;
        $currentOrder = $toolbar->getCurrentOrder();
        $currentDirection = $toolbar->getCurrentDirection();
        $result = $proceed($collection);

        if ($currentOrder) {
            switch ($currentOrder) {

            case 'newest':
                $this->_collection
                    ->getSelect()
                    ->order('e.created_at DESC');
            break;

            case 'price_desc':
                $this->_collection
                    ->getSelect()
                    ->order('price_index.min_price DESC');
            break;

            case 'price_asc':
                $this->_collection
                    ->getSelect()
                    ->order('price_index.min_price ASC');
            break;

            default:
                $this->_collection
                    ->setOrder($currentOrder, $currentDirection);
            break;

            }
        }
        return $result;
    }
}

CS/SortBy/Plugin/Model/Config.php

<?php
namespace CS\SortBy\Plugin\Model;

class Config
{
    /**
     * Adding custom options and changing labels
     *
     * @param \Magento\Catalog\Model\Config $catalogConfig
     * @param [] $options
     * @return []
     */
    public function afterGetAttributeUsedForSortByArray(\Magento\Catalog\Model\Config $catalogConfig, $options)
    {
        //Remove default sorting options
        unset($options['name']);
        unset($options['price']);

        //New sorting options
        $options['position'] = __('Recommended');
        $options['price_desc'] = __('Price High');
        $options['price_asc'] = __('Price Low');
        $options['newest'] = __('Newest First');

        return $options;
    }
}


texts: List of not-used core modules that can be turn off with no harm

texts:
Reffering to this this topic for Magento 1, maybe it would be useful to prepare a list of core Magento 2 modules that can be turn off or completely removed with no harm for our store, because they are hardly used.

To begin with some propositions:

Magento_Ups or Magento_Dhl or Magento_Fedex (if our client won't use them shipment)
Magento_Paypal - as above
Magento_AdminNotification (sometimes annoying)
all modules with Import/Export - if we don't migrate our store from Magento 1
Magento_Bundle or Magento_Downloadable or Magento_GroupedProduct - if won't be used
Magento_GiftMessage - (if not used)
Magento_Rss - if not used
Magento_Sitemap

And here some questionable ones - if someone has experience with them, please let know if they are useful for anything:

Magento_Marketplace
Magento_Msrp
Magento_NewRelicReporting
Magento_OfflineShipping & Magento_OfflinePayments
Magento_SampleData
Magento_Swagger
Magento_Usps
Magento_Vault


texts: Local environment for Magento 2, on Mac is it a thing?

texts:
Is anybody using local environment for Magento 2, on Mac OS?

When i try to run my local environment using xampp i get this error on localhost/magento2/setup

Fatal error: Uncaught Magento\Framework\Exception\FileSystemException: The file "/Applications/XAMPP/xamppfiles/htdocs/magento2/var/.regenerate" cannot be deleted Warning!unlink(/Applications/XAMPP/xamppfiles/htdocs/magento2/var/.regenerate): Permission denied in /Applications/XAMPP/xamppfiles/htdocs/magento2/vendor/magento/framework/Filesystem/Driver/File.php:382 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/magento2/vendor/magento/framework/Filesystem/Directory/Write.php(172): Magento\Framework\Filesystem\Driver\File->deleteFile('/Applications/X...') #1 /Applications/XAMPP/xamppfiles/htdocs/magento2/vendor/magento/framework/Code/GeneratedFiles.php(99): Magento\Framework\Filesystem\Directory\Write->delete('/var/.regenerat...') #2 /Applications/XAMPP/xamppfiles/htdocs/magento2/vendor/magento/framework/App/ObjectManagerFactory.php(110): Magento\Framework\Code\GeneratedFiles->cleanGeneratedFiles() #3 /Applications/XAMPP/xamppfiles/htdocs/magento2/vendor/magento/framework/App/Bootstrap.php(209): Magento\Framework\App in /Applications/XAMPP/xamppfiles/htdocs/magento2/vendor/magento/framework/Filesystem/Driver/File.php on line 382

There seems to be next to none information about it online, i found one dude who had this problem, but his solution is outdated, there have been some php changes it seems like.

I don't expect you guys to replicate this problem but, i want do know if Magento developers is doing it local and push using git, or it all is on a server running linux?


texts:
I am getting an error when i try to run setup:upgrade command third-party module,
PHP Fatal error:  Cannot declare class Tigren\Core\API\License\LicenseAPI, because the name is already in use in app\code\Tigren\Ajaxcompare\view\frontend\web\css\source\LicenseAPI\LicenseApi.php on line 14


texts:
I was wondering: Can I manually delete the system.log file in the var/log directory in the back end?

If I do this, will it have any negative effects on my web shop?

This file is using quite some disk space now.


texts:
When I visit my website it shows http://mywebsite.com/.

When I view any product, url shows as http://mywebsite.com/magento/productname/ where magento is my sub directory in which i installed magento.

What I want is, remove magento from the url.

How can I achieve it?


texts: Magento 2 Admin Action Logging Custom/Magento Module in M2 Community Version

texts:
I am creating a multiple stores website and there are many staff user So I want to track changes history.

How to track product information which update user staff in Magento and I want to revert if the wrong update.


texts:
I want to change header in template.

Hide cart , Login, wishlist etc.

from:

  https://zabezcen.pl/

to:

  http://zabezcen.pl/strona.png

Anyone help me how can I do ?

@Update

Thank you Guys, I did it this way - working perfect.

Last question,
Anyone help now, how to move block top search to top?


texts:
We are trying to fetch value from custom database & display related value for all rows [orders] .

but code is fetching only first row value in DB & displaying same value for all rows.

Database

Site

     foreach($order as $orderData)
    {
    $k = 0;
    $orderitems = $orderData['dproduct_id'];
    $orderitemsarray = explode(",", $orderitems);

    while ($k < count($orderitemsarray))
    {

    if ($orderitemsarray[$k] != '0')
    {
    $stmtorders = $user_home->runQuery("SELECT * FROM order_details");
    $stmtorders->execute(array(":dorder_id" => $orderData['dorder_id']));
  // $stmtorders->execute(array(":dorder_id" => $orderData['entity_id']));
    $roworders = $stmtorders->fetch(PDO::FETCH_ASSOC);

    if($data['type']=="admin")continue;

    if($data['dpaid_status']=='P'){$dorderStatus='Paid';}
    if($data['dpaid_status']=='U'){$dorderStatus='Unpaid';}
    if($data['dpaid_status']=='R'){$dorderStatus='Returned';}
    if($data['dpaid_status']==''){$dpaid_status='';}

    if ($roworders[

    'dproduct_id'] == '')
    {
    $dorderStatus = "Unpaid";
    }
    else
    {
    $dorderStatus = $roworders['dpaid_status'];
    }

    $productdetail = Mage::getModel('catalog/product')->load($orderitemsarray[$k]);
    $designer_id = $productdetail->getDesignerID() ;

    if($accountType == "admin"){
    $designerName = getDesignerName($productdetail->getDesignerID()) . " -(" . $productdetail->getDesignerID() . ")";
    $responce[] = array(
    $dorderStatus
    );
    }

    else
    {
    if( $designer_id== $_SESSION['userSession'] ){
    $designerName = getDesignerName($productdetail->getDesignerID()) . " -(" . $productdetail->getDesignerID() . ")";
    $responce[] = array(
    $dorderStatus
    );
    }
    }
    }

    $k++;
    $i++;
    }
    }

    echo json_encode($responce);

full code : http://pastebin.com/gn4paZWM


texts: What is the difference between insert and insertForce in Magento 2?

texts: I found an insertForce method being called in Magento Core module. What is the difference of insertForce and insert method?


texts:
My .xml file

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

It is not visible in admin panel under System->Advanced->modules

And the xml is located under app->Etc->modules


texts: Magento facing issues with Setting Shipping Method to Quote

texts:
I am setting Shipping Method to quote, For one particular method, shipping price is not added to quote but for other shipping methods it is working fine. Can anyone suggest on this, I have used below code,

// Collect Rates and Set Shipping & Payment Method
                $quote->getShippingAddress()->setCollectShippingRates(true)->collectShippingRates();
                $quote->getShippingAddress()->setShippingMethod($postParams['shipping_method']);

                $quote->getShippingAddress()->setPaymentMethod($postParams['payment_method']);

                //Set Sales Order Payment
                $quote->getPayment()->importData(array('method' => $postParams['payment_method']));

                // Collect Totals & Save Quote
               $quote->collectTotals()->save();


texts: how to get all images of a particular product

texts:
How to get all images of a particular product by using this code i am able to fetch only single image of the particular product..

Please help i am new to this.

<?php
// Get products in category
require_once('../app/Mage.php');//Path to Magento umask(0);

if(isset($_GET["categoryId"])){
  $categoryId=$_GET["categoryId"];
    $proxy = new SoapClient('http://www.prashant.com/index.php/api/v2_soap/?wsdl'); // TODO : change url
    $sessionId = $proxy->login('prash', 'prashant123@'); // TODO : change login and pwd if necessary

    $products= $proxy->catalogCategoryAssignedProducts($sessionId,$categoryId);

    $itemDetails=array();
    Mage::app();

  foreach ($products as $item) {

    $product2 = Mage::getModel('catalog/product')->load($item->product_id);
    $productMediaConfig = Mage::getModel('catalog/product_media_config');
    $baseImageUrl = $productMediaConfig->getMediaUrl($product2->getImage());
    $price2=0;
    $price2=$product2->getFinalPrice();
    if($price2==0){
    $price2=$product2->getPrice();
    }

    $desc=$product2->getDescription();
           if($desc==""){
            $desc="blank";
           }
           $baseImageUrl = $productMediaConfig->getMediaUrl($product2->getImage());
           if($baseImageUrl=="http://www.prashant.com/media/catalog/product/"){
            $baseImageUrl="http://www.prashant.com/customApi/icon.png";
           }

           //"desc"=>$desc,

           $statusp=$product2->getStatus();
    $statusen= Mage_Catalog_Model_Product_Status::STATUS_ENABLED;

    if($statusp==$statusen){
         $itemDetails[]=array(
      "productId"=>$item->product_id,
      "name"=>$product2->getName(),
      "price"=>$product2->getPrice(),
      "spprice"=>$price2,
      "desc"=>$desc,
      "imageurl"=>$baseImageUrl,
      );
    }

  }
  //return array of products
  //echo "<pre>";
  //print_r($itemDetails);
  //echo "</pre>";
  echo json_encode($itemDetails);
  exit();
}else{
  echo "error";
  exit();
}
?>


texts:
I want to upload image by custom module.In this module if i upload image the image name is

images (1).jpg

when image upload name saved it

images_1_.jpg

My code is

if (isset($_FILES['vendor_gallery']['name']) && $_FILES['vendor_gallery']['name'] != '') {
                try {
                    $path     = Mage::getBaseDir('media') . DS . 'vendors' . DS . 'profile';
                     $fname    = $_FILES['vendor_gallery']['name'];
                    $uploader = new Varien_File_Uploader('vendor_gallery');

                    $uploader->setAllowCreateFolders(false);
                    $uploader->setAllowRenameFiles(false);
                    $uploader->setFilesDispersion(false);
                    $uploader->save($path, $fname);
                }
                catch (Exception $e) {
                    echo 'Error Message: ' . $e->getMessage();
                }
            }

            if ($fname != "") {
                $data['vendor_gallery'] = $fname;
            }
            echo $fname;exit;

            try {
                $gallery = Mage::getModel('marketplace/gallery');
                if(isset($data['vendor_gallery']) && ($data['vendor_gallery'])!=''){
                $gallery->setData($data);
                $gallery->save();
                }

so how to do correct image name?


texts: Magento Import multiple custom options using magmi

texts: I want to import two custom option for single product in magento using magmi.


texts: Is there a way to tell if an event registration was made online through the web site form, or if it was entered directly into the system? (By a staff member for example.)


texts:
I cant seem to trace down the reason why I am getting a 500 error on my view.phtml or maybe this is not even the issue?
https://www.********.com/tools-equipment/testers/gold-testers

    <?php
/**
 * Category view template
 *
 * @see Mage_Catalog_Block_Category_View
 */
?>

<?php
    $_helper    = $this->helper('catalog/output');
    $_category  = $this->getCurrentCategory();
    $_imgHtml   = '';
    if ($_imgUrl = $_category->getImageUrl()) {
        $_imgHtml = '
htmlEscape($_category->getName()).'" title="'.$this->htmlEscape($_category->getName()).'" />
';
        $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
    }
?>
<?php $config1 = Mage::getStoreConfig('web/default/cms_home_page'); ?>

<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>

<?php if($_imgUrl): ?>
    <?php echo $_imgHtml ?>
<?php endif; ?>

<?php if(($config1=='elite_home_two')) { ?>
   <?php if($_description=$this->getCurrentCategory()->getDescription()): ?>

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

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

    <?php if($this->IsRssCatalogEnable() && $this->IsTopCategory()): ?>
        <a href="<?php echo $this->getRssLink() ?>" class="link-rss"><?php echo $this->__('Subscribe to RSS Feed') ?>
    <?php endif; ?>

<?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?>

<?php if($this->isContentMode()): ?>
    <?php echo $this->getCmsBlockHtml() ?>

<?php elseif($this->isMixedMode()): ?>
    <?php echo $this->getCmsBlockHtml() ?>
    <?php echo $this->getProductListHtml() ?>

<?php else: ?>
    <?php echo $this->getProductListHtml() ?>
<?php endif; ?>

any help would be greatly appreciated. Thanks.


texts: Extension Generates Custom Option at cart. How to move to Order?

texts:
I'm using an extension from a 3rd party manufacturer. This extension requires that we set an iframe to their product form on our site, then we use the index controller in their module to send their product data to the cart. Here's the important bits from the index controller:

$data = $this->getRequest()->getParams();
$sku = $data['gpart'];
$options['description'] = $data['description'];
$options['part_num'] = $data['part'];
$params['qty'] = $data['quantity'];

$cart = Mage::getSingleton('checkout/cart');
$prod = Mage::getModel('catalog/product');
$prod_id = $prod->getIdBySku($sku);
$product = $prod->load($prod_id);

$additionalOptions = array();

if ($additionalOption = $product->getCustomOption('additional_options')) {
    $additionalOptions = (array) unserialize($additionalOption->getValue());
}

foreach ($options as $key => $value) {
    $additionalOptions[] = array(
        'label' => $key,
        'value' => $value,
     );
 }

$product->addCustomOption('additional_options',serialize($additionalOptions));
$product->setProductOptions($data['description']);
$cart->addProduct($product, $params);
$cart->save();

$url = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB).'checkout/cart';

echo "<script type=\"text/javascript\">window.onload = window.top.location.href=\"$url\";</script>";

As you may be able to tell, this intercepts a request to a certain url and gets paramaters from it to build the quote item. The main issue I am having is with the $product->setProductOptions(); and $product->addCustomOption();

While this information is being saved to the table sales_flat_quote_item_option, this data is not being sent to the cart on checkout. In other words, 'additional_options' exists in 'sales_flat_quote_item_option', but does not transfer over to 'product_options' with the rest of the custom options in 'sales_flat_order_item'.

I'm lost. I've been working in magento for three weeks so I'm sure this is common stuff further down the road, but I'd really appreciate some help. Thanks!


texts: Forgotten password page: Show information about registered customer e-mail addresses

texts:
When someone goes onto the forgotten password page and enters an email address once they click submit it reloads the log in page even if the email address doesn't exist on the database. Is there a way to get magento to check the database and if the password doesn't exist throw up an error message, and if the password does exist throw a success message?

I cant believe this isn't in magento as standard or is it and im just missing it?

Thanks


texts:
I am working on a project based on Magento Commerce Cloud.

I am trying sync code from master to Staging branch but i am getting failure message.And when i view the logs,i am seeing merge conflict w.r.t some files.

Can anyone please guide on how can i fix this

Thanks!


texts: Consent Management Script must be on first place, how to do this?

texts:
as most of you know, it is now mandatory to have a Consent Managment Tool where visitors can decide f.e. whether they accept Google Analytics or not.
I have a tool for this but do have one problem implementing it into the pages.
The script must be the first at all to work properly.
I tried several things, but Magento is inserting the google-analytics/analytics.js always at the top of the page. Therefore as well before the script from my consent management tool.
This happens if I set "Move JS to bottom" to true, as well if I set it to false.
In any case google script is before my consent management script.
As I think somebody from you must have the same or similar problem, I hope that somebody has an idea how to fix this.
Looking forward to hearing from you.
Best regards
Chequille
PS: using Magento 2.3.5-p1


texts: Magento2 Complete path is not showing in breadcrumbs on product detail page

texts:
If I open category,subcategory and vertical the breadcrumbs that are showing properly

For reference please find the attached image.

If I open product from home page then breadcrumbs are not showing complete path. It is showing only Home and product name

For reference please find the attached image.

I need complete path like

  Home -> Category -> Subcategory -> Vetical -> product name

How can I get this one ?

Thank you.


texts: Could not apply patch! Skipping. The error was: Cannot apply patch XXXXXXXXXX.diff

texts:
I'm installing a code base which is created by others, then i remove the old when i run "composer install" and encounter show many this kind of error message.

Anyone know what is the problem?


texts: Create custom route in Custom module magento 2

texts:
How to create a custom route in Magento 2

http://127.0.0.1/magento8/trails/post/view/id/13

module:- trails

folder :-post

controller :- view

argument :-id/13

I want to http://127.0.0.1/magento8/slug/

anyone help me


texts:
How to fix this error.

Fatal error: Uncaught InvalidArgumentException: Unable to unserialize value. in /home/sbaelect/domains/sbaelectric.com/public_html/vendor/magento/framework/Serialize/Serializer/Json.php:52 Stack trace: #0
/home/sbaelect/domains/sbaelectric.com/public_html/vendor/magento/framework/Interception/Config/CacheManager.php(69): Magento\Framework\Serialize\Serializer\Json->unserialize('{"Magento\\\\Fram...') #1
/home/sbaelect/domains/sbaelectric.com/public_html/vendor/magento/framework/Interception/Config/Config.php(118): Magento\Framework\Interception\Config\CacheManager->load('interception') #2
/home/sbaelect/domains/sbaelectric.com/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(116): Magento\Framework\Interception\Config\Config->__construct(Object(Magento\Framework\ObjectManager\Config\Reader\Dom\Proxy), Object(Magento\Framework\Config\Scope), Object(Magento\Framework\App\Cache\Type\Config), Object(Magento\Framework\ObjectManager\Relations\Runtime), Object(Magento\Framework\Interception\ObjectMa in /home/sbaelect/domains/sbaelectric.com/public_html/vendor/magento/framework/Serialize/Serializer/Json.php on line 52

and, can't run command line


texts: After Migrating Magento 2.4 Category image lost after re-saving category backend issue How to i solve this ?


texts: Magento2 messages is not getting added & not getting displayed

texts:
Magento2 error message is not getting displayed, it gets displayed only after page refresh. I checked in console, the error msg is not getting added in messages:
  public function aroundExecute(
    \Magento\Catalog\Controller\Product\Compare\Add $subject,
    \Closure $proceed
    ){

      $count = $this->helper->getItemCount();
      if($count >= self::LIMIT_TO_COMPARE_PRODUCTS) {
        $this->messageManager->addError(
            'You can add the compared products under 3 item(s)'
        );

        /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
        $resultRedirect = $this->resultRedirectFactory->create();
        return $resultRedirect->setRefererOrBaseUrl();
      }

      return $proceed();
   }


texts: magento one order with multiple invoices per vendor

texts:
I am facing the following issue:

Suppose there are Two vendors A and B.  Vendor A has the product X and Vendor B has product Y.

If a buyer purchases both product from Vendors A and B, it creates one order.

Then how we can create different Ship and Invoice for the vendors for same order; or you can also say Main order has sub order according to vendor product?


texts: product listing load more time in category page

texts:
In website 150k products,I have installed varnish cache but when initial load category page it takes 10 second to load time and display 36 products in category page and I do not want to change 36 to less pagination. I want to load category page in less time so how can I optimize query product collection?

I think it needs to optimze Collection from block  Mage_Catalog_Product_List. and method used is _getProductCollection()
so how to optimize in collection in _getProductCollection() method. Please guide me. I am using dedicated server. If anyone can give another solution it will appreciated.

Edit: I have already enabled flat catalog option.


texts: How to get event list programmatically in magento

texts: i want  list of event in magento.I want a script, whenever it will run get list of events,which is belong to magento...


texts:
I am trying to install magento 2.3.4 on a LAMP stack on centos. Php version 7.3 and mysql 5.6. Initially setup was giving a 500 error. I searched google and found a suggestion to remove .htaccess. it worked. Now it gives 404 error for admin page after installation and homepage appears without any css and media. If I put the .htaccess back to root folder of magento, it gives 500 error for both admin and magento store.
Can you please help me find the problem.


texts:
I need to know that, When magento runs the indexer process on below phase.

      - Add to cart (While user add products on cart)
      - Add to wishlist (While user add products on wishlist)
      - Apply Coupon code
      - Submitting order

Your inputs are appreciable.


texts: CSS and Javascript files are not loading after Magento 2 installation

texts:
I've installed Magento 2 on local server successfully using composer but I'm not able to see frontend and admin panel designs. I see plain texts there. While looking at console I see following error.

TypeError: require.config is not a function requirejs-config.js
TypeError: require.config is not a function admin:59
TypeError: require is not a function admin:62
ReferenceError: Ext is not defined admin:68
ReferenceError: Fieldset is not defined admin:76
TypeError: require is not a function admin:83
TypeError: require is not a function


texts: How to add a layout handle before configurable product is loaded?

texts:
Synopsis

I need to add a layout handle for a configurable product view, this will allow me to insert necessary javascript into the page for JS based validation.  The server-side validation is outside of the scope of this question.

I have created a simple module that observers controller_action_predispatch_catalog_product_view I have implemented logging to see the observers is triggered, and sets a new handle which does nothing.

Although my JS files doesn't exist I would expect to see a 404 error.

Example

config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
    <modules>
        <Vendor_Example>
            <version>1.0.0</version>
        </Vendor_Example>
    </modules>
    <global>
        <models>
            <vendor_example>
                <class>Vendor_Example_Model</class>
            </vendor_example>
        </models>
        <events>
            <controller_action_predispatch_catalog_product_view>
                <observers>
                    <vendor_example>
                        <class>Vendor_Example_Model_Observer</class>
                        <method>setLayout</method>
                    </vendor_example>
                </observers>
            </controller_action_predispatch_catalog_product_view>
        </events>
    </global>
    <frontend>
        <layout>
            <updates>
                <vendor_example>
                    <file>Vendor_Example.xml</file>
                </vendor_example>
            </updates>
        </layout>
    </frontend>
</config>

Model/Observer.php

<?php

class Vendor_Example_Model_Observer
{
    public function setLayout(Varien_Event_Observer $observer)
    {
        $action = $observer->getEvent()->getControllerAction();

        if ($action instanceof Mage_Catalog_ProductController
            && $action->getRequest()->getActionName() == 'view'
        ) {

            $id          = $action->getRequest()->getParam('id');
            $product     = Mage::getSingleton('catalog/product')->load($id);
            $productType = $product->getTypeInstance(true);

            if ($productType instanceof Mage_Catalog_Model_Product_Type_Configurable) {

                $handle = 'vendor_example_configurable_plate';
                $action->getLayout()->getUpdate()->addHandle($handle);

            }

        }
    }
}

design/frontend/package/theme/layout/vendor_example.xml

<?xml version="1.0" encoding="utf-8"?>
<layout>

    <vendor_example_configurable>
        <reference name="head">
            <action method="addItem"><type>skin_js</type><name>example/test.js</name></action>
        </reference>
    </vendor_example_configurable>

    <vendor_example_configurable_plate>
        <update handle="vendor_example_configurable" />

        <reference name="before_footer_ends">
            <action method="addItem"><type>skin_js</type><name>js/test/ivalid.js</name></action>
        </reference>
    </vendor_example_configurable_plate>

</layout>


texts:
I have a CMS page Contact Us, which has the following

  {{block type=’core/template’ name=’contactForm’ template=’contacts/form.phtml’}}

However on the Contact Us page the block isn't being loaded, instead I've got an empty

 any idea's on what might cause this, I have a custom theme but the contact form isn't being overridden by that theme.


texts: Can Not View Content Blocks due to require.js error - Magento 2 theme change

texts:
I am facing problem with require.js on Magento 2 theme change
Content > Blocks
The page shows endless spinner and I can never view my imported blocks for my new theme. When I do Firebug on the page. This is the error message

  Error: Script error for: Magento_Ui/js/lib/key-codes
  htt://requirejs.org/docs/errorshtml#scripterror require.js (line 166,
  col 17)

  Error: Script error for: Magento_AdminNotification/toolbar_entry
  htt://requirejs.org/docs/errorshtml#scripterror require.js (line 166,
  col 17)

  Error: Script error for: Magento_Ui/js/core/app
  htt://requirejs.org/docs/errorshtml#scripterror require.js (line 166,
  col 17)

  Error: Script error for: Magento_AdminNotification/system/notification
  htt://requirejs.org/docs/errorshtml#scripterror require.js (line 166,
  col 17)

Can someone help me resolving this require.js issue?

Many thanks in advance :)


texts: Magento 2 : How to add virtual domain in localhost?

texts:
I have a magento2 folder on my localhost

var/www/html/magento2

I want to open a website like magento2.com instead of localhost/magento2.

How to achieve this.

i have read many tutorials but there are lots of issues.

Sometime Magento2.com opens the apache webpage, some times CSS issue on the front end.

please Help.


texts:
I am working with Magento2, so as per my requirement I need to override the "Magento\Checkout\Model\Cart.php" class, but the cart.php class look like as follow

namespace Magento\Checkout\Model;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Catalog\Model\Product;
use Magento\Checkout\Model\Cart\CartInterface;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\DataObject;

/**
 * Shopping cart model
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
 * @deprecated
 */
class Cart extends DataObject implements CartInterface {}

So, from the above, I am not sure how to override this class.
Kindly share your idea and thoughts it'll help me.


texts:
I have created a table in my database as part of my custom module.

I would like to add user information into a text field from the custom table based on parameters in the address bar.

So far I have created code that will pull the correct information from the database, although this code is placed in the index controller (just to see if it would work). I am now thinking on a more realistic/useable level how to utilise this code.

I have considered putting the code in a block or a model (i'm assuming a block is the thing to use) then calling that from the template file, but I cant work out where to put the code and how to call it.

I am guessing there will need to be more data in my layout file, but I don't know what it should be?

The code to get the data

    $params = $this->getRequest()->getParams();
    $prefs = Mage::getModel('prefcentre/prefcentre');
    $prefs->load($params['id']);
    $data = $prefs->getData();
    return $data

The layout file

<user_preferences>
    <block type="core/template" name="pref_options" output="toHtml" template="ps/prefcentre/preferences.phtml" />
</user_preferences>

The template

First Name
<input type="text" name="FirstName" id="FirstName" value="<?php //datahere ?>" class="text">
Last Name
<input type="text" name="LastName" id="LastName" value="<?php //datahere ?>" class="text">

I have tried to work out a solution myself by looking at customer/form/edit.phtml and customer.xml customer_account_edit node but i've not been able to work it out.

When looking at edit.phtml I could only find

    <input type="text" name="email" id="email" value="<?php echo $this->htmlEscape($this->getCustomer()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text required-entry validate-email" />

Where would is the first and last name boxes?

Summary of questions

how do I pass data from the database into an textbox
why is first name and last name not on the edit.phtml template


texts: How to create a cron job programatically?

texts:
How can I create a cron job in Magento without defining <run><model></model></run> in the XML?

I have a lot of jobs that need to be changed programmatically and we couldn't define all of these jobs in the XML as these need to be dynamic.

So far, this insert the job in the magento cron, however, there's no run/model defined:

Mage::getModel('core/config_data')
                ->load(self::CRON_STRING_PATH, 'path')
                ->setValue($cronExprString)
                ->setPath(self::CRON_STRING_PATH)
                ->save();


texts: How to include order comment in order confirmation email

texts:
same as title, how do I get order comment from checkout page to be included in the order confirmation email? I'm using Magento 1.9.

I can understand it is transactional email template that need to be edited.
But unfortunately I can't get the variable for order comment.


texts:
I want magento 2 to backup automatically.I have set all the things suggested on https://www.humcommerce.com/tutorial/schedule-backups-in-magento-2 .
But it is not working and not creating any backup for me.Maybe it is not creating cron job for backup.Please let me know what I am missing or suggest if there are any additional steps to create auto backup.Or how can I debug at my end.


texts:
listing file

<argument name="data" xsi:type="array">
    <item name="js_config" xsi:type="array">
        <item name="provider" xsi:type="string">faq_listing.faq_listing_data_source</item>
    </item>
</argument>
<settings>
    <spinner>faq_listing_columns</spinner>
    <deps>
        <dep>faq_listing.faq_listing_data_source</dep>
    </deps>
</settings>
<dataSource name="faq_listing_data_source" component="Magento_Ui/js/grid/provider">
    <settings>
        <storageConfig>
            <param name="indexField" xsi:type="string">faq_id</param>
        </storageConfig>
        <updateUrl path="mui/index/render"/>
    </settings>
    <dataProvider class="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider" name="faq_listing_data_source">
        <settings>
            <requestFieldName>faq_id</requestFieldName>
            <primaryFieldName>faq_id</primaryFieldName>
        </settings>
    </dataProvider>
</dataSource>
<columns name="customer_online_columns">
    <column name="customer_id">
        <settings>
            <filter>textRange</filter>
            ID
            <sorting>asc</sorting>
        </settings>
    </column>
    <column name="title">
        <settings>
            <filter>text</filter>
            title
        </settings>
    </column>
</columns>

/etc/di.xml

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <arguments>
        <argument name="collections" xsi:type="array">
            <item name="faq_listing_data_source" xsi:type="string">Magento\Faq\Model\ResourceModel\Faq\Grid\Collection</item>
        </argument>
    </arguments>
</type>

<virtualType name="Magento\Faq\Model\ResourceModel\Faq\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
    <arguments>

This error are comes to my screen so how to resolve this error ?

  Fatal error: Uncaught TypeError: Argument 2 passed to
  Magento\Framework\View\Element\UiComponentFactory::argumentsResolver()
  must be of the type array, null given, called in
  /var/www/html/magento_2_2_4/vendor/magento/framework/View/Element/UiComponentFactory.php
  on line 206 and defined in
  /var/www/html/magento_2_2_4/vendor/magento/framework/View/Element/UiComponentFactory.php:172
  Stack trace: #0
  /var/www/html/magento_2_2_4/vendor/magento/framework/View/Element/UiComponentFactory.php(206):
  Magento\Framework\View\Element\UiComponentFactory->argumentsResolver('faq_listing',
  NULL) #1
  /var/www/html/magento_2_2_4/vendor/magento/framework/View/Layout/Generator/UiComponent.php(135):
  Magento\Framework\View\Element\UiComponentFactory->create('faq_listing',
  NULL, Array) #2
  /var/www/html/magento_2_2_4/vendor/magento/framework/View/Layout/Generator/UiComponent.php(97): Magento\Framework\View\Layout\Generator\UiComponent->generateComponent(Object(Magento\Framework\View\Layout\Data\Structure),
  'faq_listing', Array, Object(Magento\Framew in
  /var/www/html/magento_2_2_4/vendor/magento/framework/View/Element/UiComponentFactory.php
  on line 172


texts: How to get the iteration index on text.phtm

texts:
I created 2 text fields from the custom options

The input from this text fields is used to call a third party js library.
Every time that the oniput event is triggered, this library should be called.
So I modified the following file:

  app/design/frontend/alonoraure/default/template/catalog/product/view/options/type/text.phtml

?>
<?php $_option = $this->getOption(); ?>

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

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

    <?php if ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_FIELD): ?>
        <input type="text" onchange="opConfig.reloadPrice()"  oninput="engraver.setText(1,document.getElementById('options_<?php echo $_option->getId() ?>_text').value)"  <?php if ($_option->getMaxCharacters()): ?> maxlength="<?php echo $_option->getMaxCharacters() ?>" <?php endif ?> id="options_<?php echo $_option->getId() ?>_text" class="input-text<?php echo $_option->getIsRequire() ? ' required-entry' : '' ?> <?php echo $_option->getMaxCharacters() ? ' validate-length maximum-length-'.$_option->getMaxCharacters() : '' ?> product-custom-option" name="options[<?php echo $_option->getId() ?>]" value="<?php echo $this->escapeHtml($this->getDefaultValue()) ?>" />
    <?php elseif ($_option->getType() == Mage_Catalog_Model_Product_Option::OPTION_TYPE_AREA): ?>
        <textarea id="options_<?php echo $_option->getId() ?>_text" onchange="opConfig.reloadPrice()" class="<?php echo $_option->getIsRequire() ? ' required-entry' : '' ?> <?php echo $_option->getMaxCharacters() ? ' validate-length maximum-length-'.$_option->getMaxCharacters() : '' ?> product-custom-option" name="options[<?php echo $_option->getId() ?>]" rows="5" cols="25"><?php echo $this->escapeHtml($this->getDefaultValue()) ?></textarea>
    <?php endif; ?>
    <?php if ($_option->getMaxCharacters()): ?>

<?php echo Mage::helper('catalog')->__('Maximum number of characters:')?> <?php echo $_option->getMaxCharacters() ?>

    <?php endif; ?>

as you can see, this is the line in question

oninput="engraver.setText(1,document.getElementById('options_<?php echo $_option->getId() ?>_text').value)

The problem is that I'm calling engraver.setText(1 for the 2 text fields, but the 1 should be the index of the iteration.

So for the first text filed that should be 1, but for the second it should be 2 and so on.
My question is: how could I access an index iterator so I can remove the hardcoded 1 and replace it with the iteratior index?

Thanks!


texts:
We want to make a menu in the sidebar, based on our attributes inside one magento web shop.

The example would be "Shop by" on this link: http://demo.magentocommerce.com/catalog/category/view/s/shirts/id/4/

We have created new attributes-sidebar.phtml and added following code inside local.xml

<catalog_product_view>
<reference name="left">
    <block type="core/template" name="attributes.sidebar" template="callouts/attributes-     sidebar.phtml"/>
</reference>
</catalog_product_view>

We are now trying inside that sidebar-attributes.phtml show the attributes with following code:

<?php

 echo "blablablablabla";
    $_helper = Mage::helper('catalog/category');
    $_product = Mage::registry('current_product');
?>

<?php if($_product->getPrice()): ?>

Attribute: <?php echo $_helper->productAttribute($_product, $_product->getPrice(), 'price') ?>

<?php else: ?>

No Attribute text here!

<?php endif; ?>

And we are getting nothing.. No errors, nor anything displayed.

Local xml is under:/app/design/frontend/default/our_theme/layout/

And attributes-sidebar.phtml is under: /app/design/frontend/default/our_theme/template/callouts/


texts: getStoreCategories() seems to not be working properly

texts:
Can this code (let's call this Method 1):

$categories = Mage::getModel('catalog/category')
        ->getCollection()
        ->addAttributeToSelect('*');
foreach($categories as $category) {
    [...]
}

be used a drop-in replacement for this (let's call this Method 2)?

$helper = Mage::helper('catalog/category');
$categories = $helper->getStoreCategories();
foreach($categories as $category) {
    [...]
}

The new theme I installed uses Method 2 to retrieve categories with which to populate the header menu. The code seems to be failing, and the header menu is empty.

Here is the relevant code:

public function renderCategoriesMenuHtml($momenu = FALSE, $level = 0, $outermostItemClass = '', $childrenWrapClass = '')
{
    $this->_isMomenu = $momenu;
    $activeCategories = array();
    foreach ($this->getStoreCategories() as $child) {
        if ($child->getIsActive()) {
            $activeCategories[] = $child;
        }
    }
    $activeCategoriesCount = count($activeCategories);
    $hasActiveCategoriesCount = ($activeCategoriesCount > 0);

    if (!$hasActiveCategoriesCount) {
        return '';
    }

    [...]

$this is of class Novaworks_Megamenu_Block_Mainmenu_Menu which extends Mage_Catalog_Block_Navigation.

I've verified that the getStoreCategories() method exists.

I did a var_dump $this->getStoreCategories() and it returned a massive object of class Varien_Data_Tree_Node_Collection which did not contain any category names.

Any code placed inside the above foreach ($this->getStoreCategories() as $child) loop had no effect.

So because apparently getStoreCategories() returns a non-usable result, the renderCategoriesMenuHtml function returns an empty string, and the header menu is not populated.

I was able to correctly retrieve a list of categories using Method 1 shown above, which I found by Googling.

In Method 1, $categories is an object of class Mage_Catalog_Model_Resource_Category_Collection. Each $category is an object of class Mage_Catalog_Model_Category.

Is Mage::helper('catalog/category')->getStoreCategories() producing an incorrect result on my setup? Is THAT what it's actually supposed to output?

And if so, can anyone explain why Mage::helper('catalog/category')->getStoreCategories() doesn't work for me, since it kind of looks like the conventional way of retrieving categories?

Thanks.


texts: Magento 2: How to route the page to catalogsearch/advanced/result/ page with abc/xyz.html Url

texts:
I created an observer to catch the event when a new url is requested with

<event name="controller_front_send_response_before">
    <observer name="brands_index_events_observer" instance="WiserobotT\ManufacturerinfoT\Observer\BrandObserver" />
</event>

I check the Url if it matches abc/xyz.html, then set routeName, ControllerName and ActionName:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        //get request object
$requestOb = $objectManager->get('Magento\Framework\App\Request\Http');
$requestOb->setRouteName('catalogsearch')
    ->setControllerName('advanced')
    ->setActionName('result');

I use var_dump($requestOb->getFullActionName());
and a get

string(29) `catalogsearch_advanced_result`

Good! But the page still shows: The page you requested was not found...

I want the page to have content like the catalogsearch/advanced/result page but still keep the old url.


texts: Magento 2 Google Universal Analytics code

texts:
In a Magento 2.1.2 store under Stores -> Configuration -> Sales -> Google Api I entered the Google Analytics code. After a couple of days I noticed no information coming in and my customer had a mail from Google saying the URL was no longer valid for the Merchant account.

I found that my customer had a Universal Analytics code (compared to the "old analytics code" and that Google demands it to be within the < head > tags whereas Magento 2.1.2 places it within the < body > tag. This Universal Analytics code has been around for 4 years and even with the old code it was recommended to place it within the < head > tags.

My question is, why is it that even in Magento 2 the Google Analytics code is placed within the body tags? Is there a good reason for it or am I missing something?


texts: Magento 2 searchCriteriaBuilder for multiple collection

texts:
I want to create search functionality for customer to search his invoice order etc.
For this I'm using searchCriteriaBuilder  and  \Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface

This collection processor has process method and it works on only one (table) collection.
But I want to implement this search on multiple tables.

Is this possible??

 $this->collectionProcessor->process($searchCriteria, $collection);

public function getFilteredList()
    {
        $this->searchCriteriaBuilder->addFilter('applied_rule_ids', true, 'null');
        $this->searchCriteriaBuilder->addFilter('weight', true, 'null');
        $collection = $this->orderItemRepository->getList(
            $this->searchCriteriaBuilder->create()
        );


texts: Magento 2 product collection getSelect Order by Case unException Unknown column 'name' in 'order clause'

texts:
I need to use ORDER BY CASE name which is product name

Query:

SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`,
`stock_status_index`.`stock_status` AS `is_salable`
FROM `catalog_product_entity` AS `e`
INNER JOIN `catalog_category_product_index` AS `cat_index`
ON cat_index.product_id=e.entity_id AND cat_index.store_id=1
AND cat_index.category_id='3'
LEFT JOIN `cataloginventory_stock_status` AS `stock_status_index`
ON e.entity_id = stock_status_index.product_id AND
stock_status_index.website_id = 0 AND stock_status_index.stock_id = 1
ORDER BY CASE WHEN `name` LIKE '%banana%' THEN 1
WHEN `name` LIKE '%apple%' THEN 2
ELSE 3 END

...
  $collection->addCategoryFilter($category)
  $collection->getSelect()->order(new \Zend_Db_Expr("CASE WHENnameLIKE '%banana%' THEN 1 WHENnameLIKE '%apple%' THEN 2 ELSE 3 END"));
 ...

Exception #1 (PDOException): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'name' in 'order clause'

If do setOrder instead of order then it Works but it just order alphabetically like so:

$collection->addCategoryFilter($category)->setOrder('name', 'ASC');

I need Expression what is going wrong?


texts: Beginner at magento 2 and i want to know how can i get the image id using the image path "/3/4/341467-1_1.jpg", how can i do this programmatically? any help is apreciated.


texts: How to override an installed language module in magento 2?

texts:
I installed this language module : https://github.com/Imaginaerum/magento2-language-fr-fr

Now, due to the Magento translation loading order :

Loading the module translations
Load theme translation file
Load translation package info
Load db tranlation. (Inline translation)

the app/design/frontend/COMPANY/PROJECT/i18n/fr_FR.csv file is not working (not prioritary).

I tried creating a new translation package, but it's not working neither...


texts:
How to fix missing permissions?

I'm using Magento 2.2.3.

Switched from production mode back to developer mode missing generated, var, pub permissions

Step 1

rm -rf generated/metadata/* generated/code/*
php bin/magento deploy:mode:set developer

And then ran php bin/magento setup:upgrade command. After running the command it will miss permissions again. How I can fix and don't miss the permission again?

Thank you!

sudo chmod -R -v 777 generated
sudo chmod -R -v 777 var
sudo chmod -R -v 777 pub

Before switching from developer mode to production mode command was running without any problem.

php bin/magento deploy:mode:set production -s --skip-compilation
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento setup:static-content:deploy

Now, I want back to developer mode but getting so many errors like:

main.CRITICAL: Can't create directory public_html/generated/code/Magento/Framework/App/Http/. in [Magento\Framework\App\Http\Interceptor] {"exception":"[object] (RuntimeException(code: 0): Can't create directory public_html/generated/code/Magento/Framework/App/Http/. in [Magento\\Framework\\App\\Http\\Interceptor] at public_html/vendor/magento/framework/Code/Generator.php:115)"} []

please let me know how I can fix it. Thank you very much!


texts:
All my magento products have 5 different images attached to them like so:

image       label       base       small       thumbnail

Image 1 -   view A       o           o             o
Image 2 -   view B
Image 3 -   view C
Image 4 -   view D
Image 5 -   view E

Based on the journey that the user has taken through the site and what they select i display a particular image on the product page (for example Image 3 with the label 'view C'

In my cart i have the following code to display the product image (gets thumbnail):

    <?php echo $this->getProductThumbnail()->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(280, null); ?>

In the cart I have the label value of what should show (i.e view C) so i just need to then show that particular image instead of the default thumbnail image.

Is it possible to show the image based on the label name in the cart?


texts: Adding Customer Email to adminhtml order grid breaks the ability to search

texts:
There are a couple of questions relating to adding a custom email field to the order grid.  For example, this and this.

However, both these create a problem when you try and filter. What happens is that whilst you can search the new email field, if you search via order ID, store, or Purchased On - then you are taken to the Dashboard, and when you return to the Order grid, you get an error.

For the sake of example, I am using the following code to make the join in _prepareCollection

$collection->getSelect()->joinLeft(
        array('myorder'=>'sales_flat_order'),
        'myorder.entity_id = main_table.entity_id',
        array('myorder.customer_email')
        );

and the following to call it in _prepareColumns:

$this->addColumn('customer_email', array(
            'header' => $this->helper('sales')->__('Customer Email'),
            'index' => 'customer_email',
            'filter_index' => 'myorder.customer_email',
        ));

Anyone any ideas what is wrong with this code?


texts:
Magento 1.9 I used the WSDL

  https://github.com/marouanbmm/magento-Apis/blob/master/code/local/Tecnifibre/SerienFlow/etc/wsdl.xml

file as part of my development Delphi win 32 to have access to the functions, arrays, objects etc... This was very helpful.

Actually I need to customize this module to use into Magento 2, so I must
use wsdl file in Magento 2.

Can anyone enlighten me ?


texts:
Im trying to run MEQP in magento 1.9.x version , but whenever I run
php vendor/bin/phpcs D:\xampp\htdocs\projectname --standard=MEQP1 from the command line I get this output:

dir=$(d=${0%[/\\]*}; cd "$d"; cd "../phpunit/phpunit" && pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
       # Cygwin paths start with /cygdrive/ which will break windows PHP,
        # so we need to translate the dir path to windows format. However
        # we could be using cygwin PHP which does not require this, so we
        # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
        if [[ $(which php) == /cygdrive/* ]]; then
                dir=$(cygpath -m "$dir");
      fi
fi

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/phpunit" "$@"

Please check the issues , let me know ur helpful comments .


texts: Magento 2.3.5-p1 CDN Configuration Content Security Policy directive

texts:
I just configured cloudfront to have a CDN for static files and media, but there's a big problem.
As soon as I entered the links to the CDN in the Magento 2 back office, no more CSS / JS / image files are displayed or executed.
I assume this is from the CSP module that was added.
However my question is:
How do we get the cloudfront not to be blocked like this?
Do we really have to create a module specifically for this?
Didn't they think about those who use CDN as cloudfront?
Thank you in advance for your answer.


texts: "A 404 error occurred" in Magento 2 installation

texts:
magento project directory is located in /var/www/html/site.com/public_html.

After extracted in magento directory, I visited site.com/magento. That redirects to site.com/magento/setup and shows like this

Some basic information :

OS: Ubuntu 16.04, Server: Nginx, Magento version : 2.2.1

I am using magento as a sub directory.
Please comment what more information should I provide?


texts: Magento webpage won't display and want to delete all public_html and re-install

texts:
I wanted to know whether is it fine if I delete the ENTIRE CONTENTS of /home/user/public_html directory of a user then re-install with a zip file?

I have a backup that I want to use because my magento website now is not working.

My problem was that I could not load my magento webpage (backend and frontend) due to an error within my public_html:

PHP Fatal error: class 'Mage_Admin_Helper_Data' not found in /home/company/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Admin.php on line 123

So recently I decided to install new update to a 1.9.1 version in magento however I disocvered later that the extensions I also want to download are not compatible with the newest version.

So I decided to delete the extension files I updated and upload the old extensions again within app/var/package

However this caused great error and now the frontend and admin of my website won't load.

So I just want to erase everything and install the backup and I was wondering how I can do this?

I don't want to loose any of my contents. I just want my website up and running again.


texts: Bug Magento 2.3.4 - After disabled Temando_Shipping products page Fatal error

texts:
I just disabled Temando_Shipping , i am getting following error,

Fatal error: Uncaught Error: Cannot instantiate interface
Temando\Shipping\Model\ResourceModel\Repository\PackagingRepositoryInterface
in
/var/www/html/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50
Stack trace: #0
/var/www/html/test/vendor/magento/framework/ObjectManager/ObjectManager.php(70):
Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Temando\Shippin...')
#1 /var/www/html/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(167):
Magento\Framework\ObjectManager\ObjectManager->get('Temando\Shippin...')
#2 /var/www/html/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(273):
Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array,
'Temando\Shippin...', NULL, 'packagingReposi...',
'Temando\Shippin...') #3
/var/www/html/test/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236):
Magento\Framework\ObjectManager\Factory\AbstractFactory->getResolvedArgument('Temando\Shippin...',
Array, Ar in
/var/www/html/test/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php
on line 50


texts:
How to avoid custom column in search collection filter?
Column not found: 1054 Unknown column 'show_in_custom_assistance' in 'where clause',

  $collection = $this->_autoSearchCollection->create();
    $collection->setVisibility($this->_catalogProductVisibility->getVisibleInCatalogIds());
    $collection->addAttributeToSelect('*')
    ->setStoreToFilter($storeid)
    ->addStoreFilter($storeid)
    ->addSearchFilter($search_arr)
    ->addMinimalPrice()
    ->addUrlRewrite()
    ->addTaxPercents();
    $collection->addCategoryFilter($category);
    // echo $collection->getSelect();

    return $collection;


texts: Magento 2 : Add to cart button change to go to cart after adding product

texts:
How to do the following -

Clicking on "Add to Cart" button adds the product to cart then Button Changes to "Go to Cart" and clicking on that redirect to Shopping Cart

Please help me in doing this functionality.


texts: Magento 2 How to create Hero image module to CMS page

texts:
I have created the hero image module for the CMS page. But the image is not uploaded and there is issue to save the image too. Is there any solution for that?

please suggest.


texts: Automatically Set Set Product as New to Date for 7 Days

texts:
how can I have Magento automatically set

  Set Product as New to Date

for 7 days whenever I create a new product, that way I don't have to be manually selecting the dates whenever I create a new product.


texts: Magento 2 find observe that fill the table sales_order_item

texts: I want to add data in the table sales_order_item, but for that i need to know what Observer fill this table. If someone know ?


texts: Using controller for image download results in slow load and error in console

texts:
I have a custom controller which is outputting file information (image/png) that has been uploaded to the server. Short version looks like this:

class MyController extends \Magento\Framework\App\Action\Action {
    public function execute(){
        // $fullpath becomes abs path on server to my png
        $info = [];
        $info['quote_path'] = $fullpath;
        $info['order_path'] = $fullpath;
        $info['title']      = "quote item";
        // @var $this->download \Magento\Sales\Model\Download
        $this->download->downloadFile($info);
    }
}

This works fine on my local server, but on my remote server the file doesn't download. Nor does it display properly on my page. I am using the controller path as my img's src attribute and I get an error in chrome:

net::ERR_SPDY_PROTOCOL_ERROR 200

The image appears to load, albeit excruciatingly slow, but then it fails.

Any idea why this may be happening?

Not sure if this is related but the Expires header returned with the image is a year in the past.

The file is 15.8KB


texts:
I have many payment methods, and they will appear depending on the shipping method selected. How can I put as a default one of them? For example the first payment method from the list, I want that his radio button appears checked.

I am trying in methods.phtml but I don't know what I have to do.


texts:
I'm new to Magento 2 so I still don't have the best experience to debug it.

I recently encountered this issue :

The path "_requirejs/frontend/Magento/luma/en_US:///var/www/html/magento/pub/static/var/www/html/magento/pub/static/" is not writable

This directly triggers on the home page. I have no idea how to fix it.

Any suggestion would be greatly appreciated as I'm still trying to figure out how this new CMS is working.