texts: Magento 2: Creating Data Objects with Immutable State?

texts:
Dovetailing off a comment in another Magento 2

  If you need to share some calculated value, put the calculation behavior to separate object and call it from blocks that require that value. Registry is discouraged because it's global mutable state and you are never sure what you will get from there.

Is there a way to create an Object in Magento 2 with immutable state?  Using the registry (Magento\Framework\Registry) is discouraged because it's global mutable state (presumable because, although the register method doesn't let you change an existing key, you can unset and then reset that key).

However -- the same problem exists for any object in Magento 2.   If I were to create an object

namespace Pulsestorm\Helloworld\Model;
use Magento\Framework\DataObject;

class ViewVars extends DataObject
{
}

Then automatic constructor dependency injection ensures that anyone could grab that shared object.  If the object is unshared, then the view/block can't grab it.

In theory, we could do something like

namespace Pulsestorm\Helloworld\Model;

class ViewVars
{
    protected $_data=false;
    protected function setData($data)
    {
        if($_data)
        {
            throw new Exception("Immutable");
        }
        $this->_data = $data;
    }

    public function getData()
    {
        return $this->_data;
    }
}

But that seems like a lot of work for a task as common as setting individual variables for a view.  Is there a better way in Magento 2 to create immutable data objects I'm not aware of?


texts: How to disable a swatch, once it is been selected in Magento2.2?

texts:
I am trying to disable a swatch, once after it has been selected. So it should not be deselected...

How to do it in Magento2.2.x ?


texts: Magento version upgrade from EE 1.11.2.0 to EE 1.14.2.0

texts:
I need help regarding the Magento upgrade from EE 1.11.2.0 to EE 1.14.2.0, I have the below quires.

1)Can I able to upgrade it directly from current version EE 1.11.2.0 to EE 1.14.2.0 and run all the scripts provided under shell folder like

umt113_conflict.php
umt113_redirect.php
url_migration_from_1_13_0_0_to_1_13_0_2.php
url_migration_to_1_13.php

But there is no information given about the sequece of running them.

2)Or I have to upgrade it in steps like

From EE 1.11.2.0 to EE 1.13.0.0 and run the patche provided under shell folder for URL related issue fixes.

url_migration_to_1_13.php
then from 1.13.0.0 to 1.13.0.2 and run the below script for URL related issue fixes.

url_migration_from_1_13_0_0_to_1_13_0_2.php
then at last from EE 1.13.0.2 to EE 1.14.2.0 and run the below scripts for URL related issues fixes.

umt113_redirect.php

umt113_conflict.php


texts: Search not working any more with Magento 1.9.3.1

texts:
Unfortunately research no longer gives any matches with Magento 1.9.3.1, what could be the reason? are there known bugs?
example here: http://test.arredomobilionline.com/catalogsearch/result/index/?q=tavolo

I've reindexed, cleared cache and attribute name is enabled for research.


texts: Can't reset the AUTO_INCREMENT value of the custom table

texts:
I can't set the value of the auto-increment to '1' (table is already truncated) the query is:
ALTER TABLE 'mam_color_codes' AUTO_INCREMENT=1;

and if I check the table status:
SHOW TABLE STATUS FROM 'ass' WHERE 'name' = 'mam_color_codes';

it shows again 34

What it can be? I have found a solution - remove the index field and create it again, but I don't like it...


texts: How can I integrate the escrow payment gateway in my custom payment method in Magento 2?


texts:
Im new in magento and have some questions.
I have created a webshop, where evrything works fine.
Now i want to change the language from english to croatian.
That for example all basic stuff like my cart,login and registration will be displayed in croatian.
How can i do this?


texts: Magento2: Equivalent catalogsearch/layer getFilterableAttributes

texts:
What is the equivalent in magento2 of

$query = Mage::getModel('catalogsearch/layer');

$filterableAttributes = $query->getFilterableAttributes();


texts: Getting Current Customer Group Price, and Tier Price

texts: I am Using Magento 1.9.1.0 CE. Now I need to display or get the current group groupprice and Tier Price. I have google it, Most of the answer Related to ver 1.7 Magento .but its not resolving the Magento 1.9.1.0 or Need to check whether Tier Price and Group Price set the particular Customer Group.


texts: Address regions synchronize with an external API

texts:
I am developing a module that connects to an API of a transport company that sends me the calculation of shipments. I'm Sending the product data and destination.

Currently I have three dropdowns 1 for countries, 1 for regions and one for cities. (Using data from my bdd working properly, now I want to do with the data from the API)

The process is simple, the user chooses a country, the regions dropdown are updated with the provinces that I have in the "directory_country_region 'table.

Now I'm in the step of sending to the API the region code and want to recieve the list of cities that I will put in the dropdown city.

I'm considering the option to add 2 columns to the table "directory_country_region" called api_region_id and api_region_name, with the IDs and names that gives me the carrier. I will add this fields manually so they are well synchronized (magento region id / api region id)

Do you consider its a good choice? or add these two fields can create problems?

Or

Do you think that it would be better to remove all current regions and insert only the regions that API returns me? What would happen in a future magento update?

Edit: I think one good option is create a new table only with the IDS "magento region id" and the "api region id". And in my helper make a query before to send the data to the API.

Thanks in advance, I hope I've explained well.


texts: Product and Category name not showing as page title

texts:
My page title only show the suffix page title, i need to uncheck the page title in category page and add the page title manually so the page title will show up and for product i need to fill the meta title, i need the category name or product name as page title as default. In system configuration i already set the title prefix to default value and in my head.phtml i use this code to get title:

<?php if(Mage::app()->getRequest()->getRouteName() === 'cms') :  ?>
<title><?php echo Mage::getStoreConfig('design/head/default_title'); ?></title>
<?php else: ?>
<title><?php echo $this->getTitle() ?></title>
<?php endif; ?>


texts: Magneto2 remove widget via xml in custom page

texts:
In all cms pages i use widget. How can i remove widget by id on specific CMS pages? For remove block i use:

    <referenceBlock name="block_name" remove="true"/>


texts: Sidebar of category page on bottom of category

texts:
My sidebar from the category pages shows up on the bottom of my category. I wasn't like this yesterday, but it doesn't come to the side. Where can i adjust this or where could it be changed cause it cant be showed to my customers like this.

http://www.thefixedgearshop.com/nl/accessoires/zadels that is the category shown below.

<catalog_category_default translate="label">
    <reference name="left">
            <action method="unsetChild"><alias>catalog.leftnav</alias></action>
            <action method="insert"><blockName>catalog.leftnav</blockName><before>athlete_sideblock_banners</before></action>
    </reference>
    <reference name="product_list">
        <block type="cms/block" name="athlete_empty_category" as="athlete_empty_category">
            <action method="setBlockId">
                <block_id>athlete_empty_category</block_id>
            </action>
        </block>
    </reference>
</catalog_category_default>

This is the code that is related towards it: Catalog_category_default

Also i found this one:

<reference name="root">
        <action method="setTemplate">
            <template>page/2columns-left.phtml</template>
            <action method="setIsHandle">
                <applied>1</applied>
            </action>
        </action>
        <action ifconfig="athlete/layout/fluid" method="addBodyClass"><classname>grid-fluid</classname></action>
    </reference>

I edited the options_base_nl.css file and edited the following code:

.col2-layout .sidebar  { width: 20.41%;}
.col2-layout .col-main { width: 74%;}
.col2-left-layout .col-main-wrap { margin-left: 30px;}
.col2-right-layout .col-main-wrap { margin-right: 300px;}
.col2-layout .col-main { width: 100%;}
.col2-layout .sidebar  { width: 245px;}

But when i set col2-layout .col-main { width:74% } towards 100% it drops my sidebar on the category page to the bottom again. When i set it towards 74% it makes the sidebar come up, but the product page gets the 26% of the missing width as a sidebar width in the page (see photo below)(the left white part should be like the photo afterwards). It creates a weird looking messy product page. I haven't had this problem before, what can it be?


texts: When an order is placed in Magento 2.3 It is sending sales email from magemojo@domain.com instead it should send from info@domain.com as configured from backend. I tried applying the patch but it's not working.


texts:
Good afternoon,
I recently upgraded from version 2.3.0 to 2.3.1 through composer
It happens that some modules were disabled during the upgrade, I would like to know the reason and what I do with them (remove?)

List of disabled modules:

  Magento_InventoryDistanceBasedSourceSelection
  Magento_InventoryDistanceBasedSourceSelectionAdminUi
  Magento_InventoryDistanceBasedSourceSelectionApi
  Magento_InventoryElasticsearch
  Magento_InventorySetupFixtureGenerator


texts: Magento 2 (EE) : Custom theme is not fully working

texts:
I have created a custom theme and activate that theme from admin. The custom theme is not fully loaded on the frontend. In custom theme, we have overridden many core theme modules template files.I have set one parent theme which is also a custom theme.

I have done following steps to resolve this issue but the issue still persists.

set the custom theme from admin
bin/magento setup:upgrade
bin/magento setup:static-content:deploy
bin/magento  indexer:reindex

Note: some of templates files has overridden.

Magento version 2.1

Thanks in advance.


texts:
I dont know what is the problem with magento.My whole site was working fine when I left my office at evening but next morning when I opened the site,the site was looking as if no css has been used.
It happened one more time that the site was not looking with proper css,but next day it was looking and working fine.

Now I am not able to understand whats going on with the magento,is something generating dynamically which is effecting my site.

I am having too much problem with this,,Can u pls give the solution for this.


texts: Including a custom module model / block into template

texts:
I'm trying to follow this guide. But I want to add the template directly into the homepage using cms.xml, something like: <block type="trendingproducts/data" name="trending.products" template="blocks/bestsellers.phtml"/> where my template is in templates/blocks/bestsellers.phtml.

How can I tie this tutorial class into the template if it is saved as something like: app/code/local/Company/Trending/Block/Data.php with the class defined as: class Company_Trending_Block_Data extends Mage_Core_Block_Template?

I've also set the config.xml inside the Trending/etc module directory as something like:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Company_Trending>
            <version>0.0.1</version>
        </Company_Trending>
    </modules>
    <global>
        <blocks>
            <Company_Trending>
                <class>Company_Trending_Block</class>
            </Company_Trending>
        </blocks>
    </global>
</config>


texts: Magento 2 - How to find out where certain blocks are defined?

texts:
I try to remove some blocks on the 404 site:

but I have no idea where they are defined.
I searched in the layout file vendor\magento\module-catalog-search\view\frontend\layout\catalogsearch_result_index.xml and searched other catalogsearch_result_index.xml files but I am unable to figure out where these are defined so I can remove them.


texts: Magento 2 how to add external css and js library with RequireJS?

texts:
I'm struggling trying to add this js library AOS

This is what I've tried to add both, css and js:

in Theme/Magento_Theme/layout/cms_index_index.xml i have this code:

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="css/bootstrap.css" />
         <css src="https://unpkg.com/aos@2.3.1/dist/aos.css" src_type="url" />
    </head>
</page>

The reason of why i'm using cms_index_index.xml instead of default_head_blocks.xml is because I want the library just be available in the home page.

Now for javascript I have this:
Theme/Magento_Theme/requirejs-config.js

var config = {
    paths: {
            'bootstrap':'Magento_Theme/js/bootstrap.bundle',
            'aos':"https://unpkg.com/aos@2.3.1/dist/aos"
    } ,
    shim: {
        'bootstrap': {
            'deps': ['jquery']
        },
        'aos': {
            'deps': ['jquery']
        },
    }
};

Bootstrap is working fine by the way.

Finally in Theme/Magento_Theme/templates/html/header.phtml i have this code:

<script type="text/javascript">require(['bootstrap','aos']);</script>

I practically did the same as I did for bootstrap, because bootstrap is working fine, but I don't know why AOS is not working. It should work just by adding classes like bootstrap.

Thanks and greetings!


texts: Where is the code that the output  determines in Magento 2.2.5

texts:
Can someone indicate me where I can find the code that the lang attribute for the html tag determines?
I'd like to make the lang attribute to show <html lang="en-US"> instead of <html lang="en">


texts:
The problem is that the special prices are showing in case they are actually filled for a specific product. The dates are set correctly, meaning the date on which is tested is outside the period that should activate the special price. Caches have been cleared, index reindexed (multiple times) etc etc. All without any positive result. A while ago the hosting company activated HHVM on the server but due to several problems this was deactivated a couple of weeks back. Could this still have some effect on the special prices still showing? Or should I look in a entirely different direction?

Magento version 1.9.0.1 BTW


texts: Updated translation keys in en_US not working

texts:
I have added/updated the translation keys in en_US file. When I had added the translation it was working but once I have updated the keys. It stop working.

E.g in en_US file

I have added

In en_US.csv

"abc","test translation"

In phtml file

__("abc") displays "test translation"

The above works without any error

but when I have updated it to

In en_US.csv

"abc product- name","test updated translation"

In phtml file

__("abc") . ' ' . $_product->getName() displays "abc product- name"

it should display "test updated translation"

Is there anything more to do?


texts: approach not overriding the template file

texts:
I wanted to override vendor/magento/module-sales/view/adminhtml/templates/items/column/name.phtml template.

And created new layout xml update as:
File: app/code/MagePsycho/CustomInvoice/view/adminhtml/layout/sales_order_invoice_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="column_name_downloadable">
            <!-- Unfortunately this is not working -->
            <!--<arguments>
                <argument name="template" xsi:type="string">MagePsycho_CustomInvoice::sales/items/column/downloadable/invoice/name.phtml</argument>
            </arguments>-->
            <action method="setTemplate">
                <argument name="template" translate="true" xsi:type="string">MagePsycho_CustomInvoice::sales/items/column/downloadable/invoice/name.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

My Question here is, why this XML code

<arguments>
    <argument name="template" xsi:type="string">MagePsycho_CustomInvoice::sales/items/column/downloadable/invoice/name.phtml</argument>
</arguments>

is not overriding the name.phtml file?
I think Magento recommends to avoid <action method="setTemplate"> approach.


texts: Set aliase for index using php client library in elasticsearch?

texts: I am creating search application using elasticsearch. I want to make indexing with zero downtime. I found one solution using aliases with client library in php. But I don't know how to implement it using client library in php.


texts: How to get cart / quote programmatically without session?

texts:
It's really common to get the quote with an existing session.

Mage::getSingleton('checkout/session')->getQuote();

But now I want to get the quote by user without any session (Magento 1.9). Do you have an advice for me?


texts:
If I'd like to have a table with three columns:

firstname,
lastname and
username (a combination of firstname and lastname)

I'd like the table to auto generate the username as soon as a record is inserted with a first & lastname.

Please note that I would like it to do so in an automated fashion, without the use of a cronjob or something as such.

How can I set this up efficiently? From what I understand MySQL does not support declarative computed fields.

According to this page:  MySQL 5.0 Reference Manual :: 18 Stored Programs and Views :: 18.3 Using Triggers

  MySQL triggers activate only for changes made to tables by SQL statements. They do not activate for changes in tables made by APIs that do not transmit SQL statements to the MySQL Server; in particular, they are not activated by updates made using the NDB API

I am using version 5.0.95 which should support triggers. Do you think Magento's ORM will be compatible with this?


texts: Magento directing all link for pages and admin to old domain except the homepage

texts:
I have done all magento things which were supposed update the core_config data table
setup:di:compile

setup configured base_url through command line  and also done with n98
My site home page is only working fine but I try to direct it to other pages and admin
then It replace new domain URL with old URL
My menu Items are also not shown after migration
Kindly help


texts: How to remove item from di.xml in magento2?

texts:
<type name="Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\Composite">
    <arguments>
        <argument name="modifiers" xsi:type="array">
            <item name="downloadablePanel" xsi:type="string">Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\DownloadablePanel</item>
            <item name="links" xsi:type="string">Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\Links</item>
            <item name="samples" xsi:type="string">Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\Samples</item>
            <item name="usedDefault" xsi:type="string">Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\UsedDefault</item>
        </argument>
    </arguments>
</type>

I want to remove below code from di.xml

    <item name="samples" xsi:type="string">Magento\Downloadable\Ui\DataProvider\Product\Form\Modifier\Samples</item>

Can anyone help how to achieve this?

i want to remove below code from product edit page:


texts:
[TL:DR]
I have Core_Class_A and Core_Class_B extends Core_Class_A.
I need to rewrite both of them and add a common functionality.

So I made this:
Custom_Class_A extends Core_Class_A.
The question is which one from below should I use (thumbs up and thumbs down for each):

Custom_Class_B extends Custom_Class_A
Custom_Class_B extends Core_Class_B

[Full Version]
I'm working on an extension that adds a new filter in the layered navigation: in stock / out of stock (you will see it public in a few days).
The code, no big issue so far, the strategy...I have my doubts.
Because there are no events I can use in the layered navigation section to add my new filter, I had to rewrite 2 blocks: Mage_Catalog_Block_Layer_View and Mage_CatalogSearch_Block_Layer.  (If someone has better ideas, please share, but this is not in the scope of the question).

For the Mage_Catalog_Block_Layer_View I did it like Vinai thought me indirectly (see this review about one of Vinai's extensions).
I added the methods I wanted to rewrite, just called parent::methodName() and dispatched an event that everyone can observe.

Here is an example for the method _initBlocks. My new method looks like this:

protected function _initBlocks()
{
    parent::_initBlocks(); //call the parent method
    //dispatch an event that I can observe and add my logic.
    Mage::dispatchEvent('catalog_layer_view_init_blocks', array('block' => $this));
}

But the problem comes for Mage_CatalogSearch_Block_Layer. This block extends the first one Mage_Catalog_Block_Layer_View.

For example I need to rewrite the method _initBlocks as shown above. But the problem is that Mage_CatalogSearch_Block_Layer does not have its own _initBlocks method. it uses the one from the parent class Mage_Catalog_Block_Layer_View.
What do I do here?
Should I use the same system as above or should I just make my new class [Namespace]_[Module]_Block_Catalogsearch_Layer extend my own class I created for rewriting Mage_Catalog_Block_Layer_View and just copy the different methods from Mage_CatalogSearch_Block_Layer?.


texts: Upgrade to Magento 2.2.2 problem with Zend/CLI

texts:
i'm upgrading to Magento 2.2.2.

After:

# composer require magento/product-community-edition 2.2.2 --no-update

and:

# composer update

I received:

Your requirements could not be resolved to an installable set of packages.

Problem 1
 - The requested package magento/product-community-edition could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read
<https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

So I downloaded the RC from github and used his composer.json.

With this the update has started to download the new packages.

Then I cleaned:

# rm -rf var/cache/*
# rm -rf var/page_cache/*
# rm -rf var/generation/*

But trying to launch some command from CLI gives me the following error:

Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for Magento\Setup\Mvc\Bootstrap\InitParamListener#0 /home/pippo/public_html/vendor/zendframework/zend-mvc/src/Application.php(156): Zend\ServiceManager\ServiceManager->get('Magento\\Setup\\M...')
#1 /home/pippo/public_html/vendor/zendframework/zend-mvc/src/Application.php(281): Zend\Mvc\Application->bootstrap(Array)
#2 /home/pippo/public_html/lib/internal/Magento/Framework/Console/Cli.php(57): Zend\Mvc\Application::init(Array)
#3 /home/pippo/public_html/bin/magento(22): Magento\Framework\Console\Cli->__construct('Magento CLI')
#4 {main}


texts: Magento 2 login error : SSM Number" is a required value. "Username" is a required value

texts:
Im using magento 2.2.1 , suddenly not able to create account for customer
Showing error (SSM Number" is a required value. "Username" is a required value. "Regulation" is a required value)

Please guide on how to resolve the issue

really appreciate kind assistance

URL : https://www.mycliks.com/


texts: I am currently using the freego magento 2 theme. My category pages do not display the pagination in the toolbar. I have triple checked settings, tried using the blank theme and the luma theme as well but it is still not displaying the pagination. What am I missing. I am new to magento. I found the toolbar code in the vendor/magento/module-catalog/view/frontend/templates/product/list folder. I see <?php echo $block->getPagerHtml() ?> there.


texts:
I'm trying to implement the https://github.com/googlemaps/js-store-locator into a website, however something really strange seems to occur. When I load the Jquery file

<script src="<?php echo $this->getSkinUrl(); ?>js/jquery/2.1.3/jquery.min.js"></script>

the functionalities seem to work, (it loads the data) but it messes up other JS and with that, my layout. On top of that, it returns errors. I've used all of the exact same files from the store locator github.

![working but broken layout (showing searchbar and store selector so everything shows lower than it should][1]

![not fully functioning but showing correct layout][2]

So the upper image shows correct functionality but wrong layout(all of the sudden my storeselector and search bar show up) And the lower image is the correct layout, but it doesn't return any data/markers.

Does anybody have any idea what could cause this?  By the way, Jquery is already loaded by default through page.xml. So in fact adding the jquery is twice which is probably why it crashes.


texts: Textbox Below Size Attribute in product page

texts:
i want to add textbox names like notes under size in products page.

Could you please any one tell me how to do. i have tried to via attribute but it doesn't help me.


texts: jQuery not working for custom checkbox on checkout page

texts:
I am looking to create a custom checkbox field on the checkout process that a customer can click to define if they are a business customer or a consumer.

To do so I made a module with the file SomeProcessor.php:

    <?php
namespace BusinessCheckout\CustomCheckout\Block\Checkout;

class SomeProcessor
{
    /**
     * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
     * @param array $jsLayout
     * @return array
     */
    public function afterProcess(
        \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
        array  $jsLayout
    ) {

        $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
        ['shippingAddress']['children']['shipping-address-fieldset']['children']['custom_checkbox'] = [
            'component' => 'Magento_Ui/js/form/element/abstract',
            'config' => [
                'customScope' => '.custom_checkbox',
                'template' => 'ui/form/field',
                'elementTmpl' => 'ui/form/element/checkbox',
                'options' => [],
                'id' => 'custom-field'
            ],
            'dataScope' => '.custom_checkbox',
            'label' => 'Is this a business order? Business T&C\'s apply.',
            'provider' => 'checkoutProvider',
            'visible' => true,
            'validation' => [],
            'sortOrder' => 50,
            'id' => 'custom-field'
        ];

        return $jsLayout;
    }
}
?>

All good so far and the checkbox appears on the checkout page as expected.

Now I've added the following jQuery to the footer of the site:

<script type="text/javascript">

jQuery(document).ready(function() {

  jQuery('form input[name="custom_checkbox"]').attr('checked', false)
  jQuery('form input[name="company"]').prop("disabled", true);

  jQuery('form input[name="custom_checkbox"]').click(function() {

    if (jQuery(this).prop("checked") == true) {

      jQuery('form input[name="company"]').prop("disabled", false);

    } else if (jQuery(this).prop("checked") == false) {

      jQuery('form input[name="company"]').prop("disabled", true);

    }

  });

});

</script>

It seems working when I enter it directly into console but not on the site footer.

The expected functionality is to have the checkbox unchecked when the page loads and the company field disabled. Then if the user clicks the checkbox the company field becomes enabled.

Any thoughts on how I can get this working?


texts: How to set cc_number_enc on order saving?

texts:
I need to save credit card number with encryption. Where i need to add something to encrypt it from cc_number?
Maybe write plugin or observer for some method?


texts:
In the image below you can see the structure of my module:

This is the content of Block/Product/View.php:

  <?php

    class NetGroup_Attributegrouping_Block_Product_View extends Mage_Core_Block_Template
    {
        function _construct(){

             $this->setTemplate('netgroup/attributegrouping/list.phtml');
        }
         function indexAction(){
               $this->setTemplate('netgroup/attributegrouping/list.phtml');
         }
    }

This is the content of etc/config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Netgroup_Attributegrouping>
            <version>1.0.0</version>
        </Netgroup_Attributegrouping>
    </modules>

    <global>
        <blocks>
            <netgroup_attributegrouping>
                <class>Netgroup_Attributegrouping_Block</class>
            </netgroup_attributegrouping>
        </blocks>

        <helpers>
            <netgroup_attributegrouping>
                <class>Netgroup_Attributegrouping_Helper</class>
            </netgroup_attributegrouping>
        </helpers>
    </global>

    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <netgroup_attributegrouping after="Mage_Adminhtml">Netgroup_Attributegrouping_Adminhtml</netgroup_attributegrouping>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>

    <adminhtml>
        <layout>
            <updates>
                <netgroup_attributegrouping>
                    <file>netgroup_attributegrouping.xml</file>
                </netgroup_attributegrouping>
            </updates>
        </layout>
    </adminhtml>

    <frontend>
        <layout>
            <updates>
                <netgroup_attributegrouping>
                    <file>netgroup_attributegrouping.xml</file>
                </netgroup_attributegrouping>
            </updates>
        </layout>
    </frontend>

</config>

In the design/frontend/netlogiq/default/layout/netgroup_attributegroping.xml content is:

<?xml version="1.0"?>
<layout>

    <catalog_product_view>

        <reference name="product.info">
            <block type="netgroup_attributegrouping/product_view" ></block>
        </reference>

    </catalog_product_view>

</layout>

In the design/frontend/netlogiq/default/template/netgroup/attributegrouping/list.phtml content is:

<?php

    echo 111111111111;

?>

AND finally in the app/design/frontend/netlgiq/default/template/catalog/product/view.phtml i have :

 TEST

     <?php echo $this->getChildHtml('netgroup_attributegrouping'); ?>

I want to display my product in catalog/product/view.phtml. It does not display "1111111111" . I know there is a lot of mistakes, but what should i do , to make my module to work ? thx


texts:
I am using a custom theme and then a child theme for the custom theme. I believe the easiest way to overide the themes css is to use _extend.less in the <MYCOMPANY>/<MYTHEME>/web/css/source directory. This works, however, some of the parent themes rules override the _extend.less rules.

Upon further investigation the less files get converted into "different" css files that load in the wrong order. For example:

_extend.less becomes part of pub...../<MYCOMPANY>/<MYTHEME>/en_AU/css/styles-l.css
The css I'm trying to overide gets loaded in pub...../<MYCOMPANY>/<MYTHEME>/en_AU/css/config_1.css

Which gets loaded in that order so the config_1.css does not get overideen unless I add !impotant to everythin which we know is not best practice.

So how can I make it so that _extend.less loads last? Or do I need to load a new css file and make that load last? - Please advise on how to do this or reference another post.

Thanks


texts: Where are robot tags for categorysearch and tag pages set?

texts:
when I try to set the robots tags by xml or programatically in _preparelayout, it doesn't work. Instead they are always NOINDEX, FOLLOW. This also happens for categorysearch but I cannot find the code where the robots-tags are changed and actually set.

in local.xml I tried:

<tag_product_list translate="label">
        <label>Tagged Products List</label>
        <!-- Mage_Tag -->
        <reference name="head">
        <action method="setRobots"><value>INDEX,FOLLOW</value></action>
    </reference>
</tag_product_list>

in Tag/Block/Product/result.php I tried

$head = $this->getLayout()->getBlock('head');
$head->setDescription($description);
$head->setRobots('index, nofollow');

Setting the description works fine. But the robot-tags are always set to NOINDEX,FOLLOW.

Can anyone tell me, where the robot-tags for tag pages or catalogsearch pages are set?

Thanks


texts:
I'm trying to access my website but it's showing this thing instead of showing a normal home page. I didn't change anything in any files and I didn't even touch the database, yet it started showing this error suddenly:

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   Mage
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

if (version_compare(phpversion(), '5.2.0', '<')===true) {
    echo  '

Whoops, it looks like you have an invalid PHP version.

Magento supports PHP 5.2.0 or newer.
Find out how to install
 Magento using PHP-CGI as a work-around.

';
    exit;
}

/**
 * Error reporting
 */
error_reporting(E_ALL | E_STRICT);

/**
 * Compilation includes configuration file
 */
define('MAGENTO_ROOT', getcwd());

$compilerConfig = MAGENTO_ROOT . '/includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;
}

$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
$maintenanceFile = 'maintenance.flag';

if (!file_exists($mageFilename)) {
    if (is_dir('downloader')) {
        header("Location: downloader");
    } else {
        echo $mageFilename." was not found";
    }
    exit;
}

if (file_exists($maintenanceFile)) {
    include_once dirname(__FILE__) . '/errors/503.php';
    exit;
}

require_once $mageFilename;

#Varien_Profiler::enable();

if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
    Mage::setIsDeveloperMode(true);
}

#ini_set('display_errors', 1);

umask(0);

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';

Mage::run($mageRunCode, $mageRunType);

Anyone's having any idea? Please help, please.


texts: Magento 2 : Is there any way to stop to sending email to customer while importing customer?

texts:
Is there any way to stop to sending email to customer while importing customer ?

Is Disable Email Communication : OFF this helpful for that ?


texts: magento 2 apply a custom filter in the grid

texts:
I have a grid and I want to apply a custom filter on it, is there a way do that ?
Thank you


texts: Magento 2.0 Catalog Product table list view

texts:
I have a error in product catalog table grid header is not working properly. Kindly share your answers.

this error only comes in aws server online only. the same file i will use in local this error not appear.
Thank You..


texts: Magento Send Email Button on order not working

texts:
Magento is not sending emails when you click the Send Email button in admin on Sales>order.

Please Help.

All other mail are send. but this one is not working.

like order,order conform, invoice etc. all mail are sent


texts: Magento 2 Tables Being Created Ending in "_cl"

texts:
After doing a diff on the tables from a production server to a local server I have noticed that new tables have been created all ending with _cl. These are:

#        TABLE: catalog_category_product_cl
#        TABLE: cataloginventory_stock_cl
#        TABLE: catalog_product_price_cl
#        TABLE: catalog_product_category_cl
#        TABLE: customer_dummy_cl
#        TABLE: catalogrule_product_cl
#        TABLE: catalog_product_attribute_cl
#        TABLE: catalogsearch_fulltext_cl
#        TABLE: design_config_dummy_cl
#        TABLE: catalogrule_rule_cl

Seeing as these are all related to indexes within Magento, I assume that they are "change Logs" or suchlike (if this could be confirmed I would appreciated it!).

I have a two part question around this, how are these tables populated, and how often / how are these tables cleaned?

Any help on this would be greatly appreciated.


texts: Magento2: How make public a backend route?

texts:
I defined a backend route (etc/adminhtml/routes.xml)

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etcroutes.xsd">
    <router id="admin">
        <route id="test_backend" frontName="test">
            <module name="{Company}_{Module}" />
        </route>
    </router>
</config>

And 2 controller files,

{Company}/{Module}/Controller/Adminhtml/AbstractTestController

abstract class AbstractTestController extends Magento\Backend\App\Action
{
protected $_publicActions = ['index'];

protected function _isAllowed()
{
    return true;
}

{Company}/{Module}/Controller/Adminhtml/Test/Index

class Index extends AbstractTestController
{
    public function execute()
    {
        print_r("test");exit();
    }
}

But when I access http://magento_base_url/admin/test/index
I'm redirected to http://magento_base_url/admin/admin/index.
Once logged, url works.

Does anybody know how make this url public? (no admin session required)


texts: I am trying to understand the test results as I don't fully understand what these numbers means. Can someone please explain what these numbers mean and which result is better? I have results from two different magento stores. Which is better?


texts: Magento 2.3 : Error while submitting the contact form

texts:
When I try to submit the default contact us form, this is the error that I get.

  Warning: preg_replace(): Compilation failed: invalid range in
  character class at offset 39 in
  /home/hudsonpa/public_html/xxxxx/vendor/pelago/emogrifier/Classes/Emogrifier.php
  on line 1507

Anybody knows what this is?

This is the form

<form class="form contact"
                  action="<?= $block->escapeUrl($block->getFormAction()) ?>"
                  id="contact-form"
                  method="post"

On inspecting the final html, it points to

<form class="form contact" action="https://domain.com/xxxx/index.php/contact/index/post/" id="contact-form" method="post" style="float:unset; width:unset;" data-hasrequired="* Required Fields" novalidate="novalidate">

--- edit ---
added screenshot

--- edit 2 ---

Also found the Emogrifier.php line 1507 has this

        $roughXpath = preg_replace(array_keys($this->xPathRules), $this->xPathRules, $trimmedLowercaseSelector);

and the $xPathRules array looks like this

private $xPathRules = [
        // attribute presence
        '/^\\[(\\w+|\\w+\\=[\'"]?\\w+[\'"]?)\\]/' => '*[@\\1]',
        // type and attribute exact value
        '/(\\w)\\[(\\w+)\\=[\'"]?([\\w\\s]+)[\'"]?\\]/' => '\\1[@\\2="\\3"]',
        // type and attribute value with ~ (one word within a whitespace-separated list of words)
        '/([\\w\\*]+)\\[(\\w+)[\\s]*\\~\\=[\\s]*[\'"]?([\\w-_\\/]+)[\'"]?\\]/'
        => '\\1[contains(concat(" ", @\\2, " "), concat(" ", "\\3", " "))]',
        // type and attribute value with | (either exact value match or prefix followed by a hyphen)
        '/([\\w\\*]+)\\[(\\w+)[\\s]*\\|\\=[\\s]*[\'"]?([\\w-_\\s\\/]+)[\'"]?\\]/'
        => '\\1[@\\2="\\3" or starts-with(@\\2, concat("\\3", "-"))]',
        // type and attribute value with ^ (prefix match)
        '/([\\w\\*]+)\\[(\\w+)[\\s]*\\^\\=[\\s]*[\'"]?([\\w-_\\/]+)[\'"]?\\]/' => '\\1[starts-with(@\\2, "\\3")]',
        // type and attribute value with * (substring match)
        '/([\\w\\*]+)\\[(\\w+)[\\s]*\\*\\=[\\s]*[\'"]?([\\w-_\\s\\/:;]+)[\'"]?\\]/' => '\\1[contains(@\\2, "\\3")]',
        // adjacent sibling
        '/\\s+\\+\\s+/' => '/following-sibling::*[1]/self::',
        // child
        '/\\s*>\\s*/' => '/',
        // descendant
        '/\\s+(?=.*[^\\]]{1}$)/' => '//',
        // type and :first-child
        '/([^\\/]+):first-child/i' => '*[1]/self::\\1',
        // type and :last-child
        '/([^\\/]+):last-child/i' => '*[last()]/self::\\1',

        // The following matcher will break things if it is placed before the adjacent matcher.
        // So one of the matchers matches either too much or not enough.
        // type and attribute value with $ (suffix match)
        '/([\\w\\*]+)\\[(\\w+)[\\s]*\\$\\=[\\s]*[\'"]?([\\w-_\\s\\/]+)[\'"]?\\]/'
        => '\\1[substring(@\\2, string-length(@\\2) - string-length("\\3") + 1) = "\\3"]',
    ];

When i individually take the patterns and compile them, there seems to be a problem in the third pattern (and a few others) at this spot

[\\w-_\\/]+

If I change it to

[\\w\\-_\\/]+

Then the pattern compiles.

Is this a good move?


texts: Disable Category Page Description Content from showing on Sorted Results

texts:
Our category pages the description attribute shows at the top of the page. This section is really helpful for the initial category experience.

Problem:
When the user sorting in the category, the description still displays.

Question:
How can we limit the description from only showing on the non-sorted version of the category page?

Eg. show on:
http://www.uretilalt.dk/dameure

Hide on:
http://www.uretilalt.dk/dameure?dir=asc&limit=36&mode=grid&order=name


texts: Install Magento 2 Extensions on localhost?

texts:
Is it possible to install Magento 2 extensions on localhost?

I currently have the latest version 2.2.3 on Windows 10 using XAMPP but when trying to install an extension, it fails due to cron job not running.


texts: Magento 2 remove "Estimate shipping costs and tax" from cart

texts:
I want to get rid of the "Estimate Shipping costs and Tax" block in the cart. The devdocs tell Disabling a component is the way to go, so I tried the following:

<body>
    <referenceBlock name="checkout.cart.shipping">
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="block-summary" xsi:type="array">

                        <!-- My custom part: -->
                        <item name="config" xsi:type="array">
                            <item name="componentDisabled" xsi:type="boolean">true</item>
                        </item>

                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>
</body>

No effect. Also tried:

<referenceBlock name="checkout.cart.shipping" remove="true"/>

This way, my totals block is totally empty.

Does anyone have suggestions?


texts: Magento 2: How to Change shipping message?


texts: where is magento2 admin bundle product special price file

texts: bundle product in magento2 admin special price. I want edit the file but i can't find the file path. can anyone please help me.


texts:
I'm looking for a solution for configuration product in Magento. Please see this website http://www.photomart.com.au/product/print/

Customer can upload multiple images in product frontend
Relationship between product attributes. For example: Attribute Paper Type and Presentation only display once "Product Size" selected.
When you change "Product Size" value, its children atributes (paper type and presentation) values will be changed as well.

Do you guys know any extension in Magento meet this requirements?

Thank you for your time!


texts: Generating preview images of style x fabric x color

texts:
I am looking into rendering preview images of products (furniture) automatically. For a furniture webshop it is impossible to manually take pictures of all possible combinations of style, fabric and color. The main products sold will be sofas in different styles with different options of fabric and color.

Is it somehow possible to create those images based on some base images of the product and an image of the fabric? Or any other ideas of how to tackle this problem?


texts: Customize the pagination template in category page - Magento 2

texts:
I'm trying to change how the page selector works on category pages for this:

To:  "Page 1 of 6"

But I cant seem to find the file the code sits in to do this. Any ideas?


texts: Magento2 category class getting removed from body tag

texts:
I used below code to set the category class in body tag, but the issue I am facing is that it always get removed when cache is cleared
$category = $this->registry->registry('current_category');
   if($this->context->getRequest()->getFullActionName() == 'catalog_product_view'){
      $subject->getConfig()->addBodyClass('current-category-'.$category->getName());
   }
return [$response];

Can any one guide me w could be the issue?


texts:
I'm overriding one template, in order to allow multiple payments, so it have to have a button to call an aditional form, the thing is the button is already disable when the template is loaded.

The template is:

default\template\checkout\onepage\payment.phtml,

the HTML code of the button is this:

<input type="button" value="Registrar" name="ekl-btn-registrar" id="ekl-btn-registrar" class="button" disabled="" autocomplete="off">

Notice that the disabled attribute is empty (is not equal to enabled). I've trying to enabled it or just drop the attribute by using jQuery, with no success. Anyway, IMHO the simpliest solution is find out where the disabling is happening and "disable the disabling", the question is: where?


texts:
I am Trying to upgrade from 2.3.0 -> 2.3.1

This issue began as I'm trying to add my logo to the top of emails and have been told the upgrade has a fix to the bug.

i am used the luma theme.

Error message I receive after inputting access keys :

  Invalid response line returned from server: HTTP/2 401

I've been advised to create a curl.php file and save it to

  lib/internal/Magento/Framework/HTTP/Client/Curl.php

I don't have this directory / folder path mine is I don't have this path on my system, mine is lib/internal{GnuFreeFont / LinLibertineFont}.

Do I create the folder path?

Please advise on this..


texts:
I have a ZIP file. I want it so when a user clicks a link on a page, it will download the ZIP file.

I have the ZIP under pub/media/downloadable and inside there's a .htaccess file, and currently this is the content inside:

<IfVersion < 2.4>
    order allow,deny
    deny from all
</IfVersion>
<IfVersion >= 2.4>
    Require all denied
</IfVersion>

AddType application/octet-stream .zip

And the link on my page is this:

Download ZIP Here

But clicking on the link simply redirects to /pub/media/downloadable/zipfile.zip instead of downloading, which brings a 404.

== UPDATE ==

To make the link downloadable, all I had to do was add the download attribute to the , like this:

Download ZIP Here

However, when I tried to download it, Google Chrome said "Failed - No File". The path is correct and the file is there, with permissions 644.


texts: Programatically deleting items from cart leaves 'ghost' items;

texts:
I am using the observer checkout_cart_save_after to programatically delete some cart items.

public function execute(Observer $observer)
{
    $cart = $observer->getCart();
    $quote = $cart->getQuote();
    $cartItems = $quote->getAllItems();

    foreach ($quote->getAllItems() as $item) {
        $cart->removeItem($item->getItemId())->save();
    }
}

Whilst this does delete the cart items, it still shows the checkout page as an empty table like so:

But if I delete all the items manually on the frontend, I get a much nicer page after I delete the last item:

What am I missing?


texts:
I did not even change any code or configure other than changing image in my slide show, which I have done earlier but I am continuously receiving these two errors on some of my pages including homepage and I have no idea why. Could anyone from the community please help me how to solve these errors? I am still learning Magento.

Below is the error:

  PHP Fatal error:  Maximum execution time of 30 seconds exceeded in
  /home/ommobhm2/public_html/narzary/app/code/core/Mage/ConfigurableSwatches/Helper/Data.php
  on line 82

  PHP Fatal error:  Maximum execution time of 30 seconds exceeded in
  /home/ommobhm2/public_html/narzary/app/code/core/Mage/ConfigurableSwatches/Helper/Mediafallback.php
  on line 90


texts: How to add country code dynamically in telephone field on Checkout in Magento 2

texts: I want to develop custom module that is used for adding country code field before telephone field on checkout page in magento 2.3.4.


texts: Only last email from file array being loaded

texts:
I'm running into the following problem:
I have a list of emails in a file. I want to loop through these and create customers, then I want to do something with the customer. However in my script it's only loading the last customer.

I have the following code:

require_once("./app/Mage.php");
Mage::app();

$file = fopen("Test.txt", "r");
if ($file) {
    $emails = file("Test.txt");
    foreach($emails as $email) {

    echo $email . "
"; // < shows all emails

    // load up the customer
    $customer = Mage::getModel('customer/customer')
    ->setWebsiteId(1)
    ->loadByEmail($email);

    echo $customer->getId() . "
"; // < returns blank except for the last email line

    // if we found the customer
    if ($customer->getId()){
        echo $customer->getId() . "adsf
"; // < only shown on last line
        //.. do something
    }
    }

    fclose($file);
} else {
    // error opening the file.
}

I have also tried

while(!feof($file)){
    $email = fgets($file);

and

while (($email = fgets($file)) !== false)

but same result, so it appears it's not something wrong with the php code. Can someone help me?


texts:
Layout code

<reference name="content">
            <block type="hello_world/sample" name="world.sample" template="hello/world/simple_page.phtml"/>
</reference>

It does not render template file. But It does with block type="page/html"

What would be the problem. Is anybody here having solution?

My Block code that is in Hello/World/Block/Sample.php

class Hello_World_Block_Sample extends Mage_Core_Block_Template {

    function get_something(){
        return "hai";
    }
}


texts:
I have successfully installed a fresh Magento 2 instance on my mac however none of the CSS is loading. Could someone advise of a fix?

The following folders dont exist
/pub/static/frontend/
/pub/static/adminhtml/

However looking at the htaccess rules it seems they shouldnt as it gets routed to static.php is that correct?


texts: elasticsearch in 2.4.0 in a one click installation

texts:
I have installed magento 2.4.0 on shared hosting through godaddy using their one click installation.
this didn't require to have elasticsearch set up in advance
I have an elasticsearch deployment set up in elasticloud (7.10.1)
I've entered the details of the deployment in the backend of magento stores/confguration/catalog/catalog/search engine
but when I test the connection I get the error message about no alive nodes on my Cluster
is there a way to get this working?


texts: Convert currency of the store but keep the default billing currency

texts:
We would like to have a currency switcher that doesn't affect the billing currency.

As far as I understand with the default Magento currency switcher the customer will also be billed in the selected currency (correct me if I'm wrong), but we don't want that.


texts: The product tabs on the product item page in Magento, how would I go making all the tabs collapsed by default on mobile view?


texts:
Having problem with cache_lite getting the below error. Please Help

  Fatal error: require_once(): Failed opening required
  'lib/Sm/BasicProducts/Cache_Lite/Lite.php'
  (include_path='/home/ribs/public_html/masterskart.com/app/code/local:/home/ribs/public_html/masterskart.com/app/code/community:/home/ribs/public_html/masterskart.com/app/code/core:/home/ribs/public_html/masterskart.com/lib:.:/opt/cpanel/ea-php56/root/usr/share/pear') in
  /home/ribs/public_html/masterskart.com/app/code/local/Sm/BasicProducts/Block/List.php
  on line 105


texts:
I wanna show in my mysql query of all attributes name,product name, product status is 1 and sku but in my query its not showing product name and status so could you help me in my this query ?
 SELECT  ce.entity_id ,s.attribute_set_name,sk.sku,a.attribute_id FROM catalog_product_entity_int ce
LEFT JOIN catalog_product_entity sk ON sk.entity_id = ce.entity_id
LEFT JOIN eav_attribute_set s ON sK.attribute_set_id = s.attribute_set_id
LEFT JOIN eav_attribute a ON a.attribute_id = ce.attribute_id WHERE a.attribute_code LIKE 'status' AND ce.value = 1

it showing below result


texts: Magento 2.3.3 we making two order at a time and same browser different tab till payment gateway page

texts:
we making two order at a time and same browser different tab till payment gateway page.  we are using PayU payment Gateway
example:-
first time order :  #00000210 and
second time order : #00000211
Now i making transaction successful order for #00000210
but getting sucsess order #00000211, but i was pay for order #00000210
please help me ,how can placed order by transaction id or any other idea


texts: How to override core vendor/magento/zendframework1/library/Zend/Locale/Data/ar_SA.xml

texts:
I want to override vendor/magento/zendframework1/library/Zend/Locale/Data/ar_SA.xml because for my Arabic store currency symbol was not working.

By referring to this URL I got the solution.

But which is come under core changes. we should not change the core. So, I need to override this file. Did anyone have any idea?

Thanks in Advance.


texts: why the product image leaves a big white space?

texts:
On the product view page . the images takes more white space than ushual?

As shown on image how to full up hese big white space?

Any solution?


texts: Show filters in empty category layered navigation page 1.9

texts:
In a web shop I am currently developing (CE 1.9.2.2) I would like to always show filterable attributes in the layered navigation category page, even if the category displayed holds no products.
Is there a way to achieve this? Or to get a collection of all the filterable attributes?


texts:
I am using a cronjob to export products and customers via an export profile. This cronjob generates the files export_customers.csv and export_products.csv for me. This works really great, but sometimes I am getting a weird output file like this:

"firstname";"lastname";"email";"website";"password_hash";"group";"sku";"weight";"name";"qty";"image";"price"
"";"";"";"";"";"";"";"";"";"";"";""
"";"";"";"";"";"";"";"";"";"";"";""
"";"";"";"";"";"";"";"";"";"";"";""

...

In this case it seems that the cronjob mix up the profiles by generating this two files and the results are two csv files, but one of them is broken. The cronjob for customers and products export runs for testing purposes every 5 minutes.

The Cron.php looks as follows:

<?php
class Fox_ImEx_Model_Cron {

    public function exportProducts() {

        $startTime = time();

        $profileId = 1;

        $profile = Mage::getModel('dataflow/profile');
        $userModel = Mage::getModel('admin/user');
        $userModel->setUserId(0);
        Mage::getSingleton('admin/session')->setUser($userModel);

        $profile->load($profileId);
        if (!$profile->getId()) {
            Mage::getSingleton('adminhtml/session')->addError('ERROR: Incorrect profile id');
        }

        Mage::register('current_convert_profile', $profile);
        $profile->run();
        $recordCount = 0;
        $batchModel = Mage::getSingleton('dataflow/batch');
        Mage::unregister('current_convert_profile');

        $duration = time() - $startTime;

        Mage::log('[ImEx] export products (duration: '.$duration.')');

    }

    public function exportCustomers() {

        $startTime = time();

        $profileId = 5;

        $profile = Mage::getModel('dataflow/profile');
        $userModel = Mage::getModel('admin/user');
        $userModel->setUserId(0);
        Mage::getSingleton('admin/session')->setUser($userModel);

        $profile->load($profileId);
        if (!$profile->getId()) {
            Mage::getSingleton('adminhtml/session')->addError('ERROR: Incorrect profile id');
        }

        Mage::register('current_convert_profile', $profile);
        $profile->run();
        $recordCount = 0;
        $batchModel = Mage::getSingleton('dataflow/batch');
        Mage::unregister('current_convert_profile');

        $duration = time() - $startTime;

        Mage::log('[ImEx] export customers (duration: '.$duration.')');

    }

}

Is there a way to avoid this problem?


texts: How to add something to result of a method with a plugin

texts:
How in magento I can add something using plugin to result of a method.
Having this dummy class and trying to change bar() methods return:

class A
{

    public function foo($str)
    {
        return $str;
    }

    public function bar()
    {
        return $this->foo('Some msg!!!');
    }

}

Thank you.


texts:
<?php

namespace Modulename\Merchant\Controller\Adminhtml\Document;

class Filedownload extends \Modulename\Merchant\Controller\Adminhtml\Document
{
protected $_downloader;

private $logger;

protected $_directory;

protected $_documentFactory;

public function __construct(
    \Magento\Backend\App\Action\Context $context,
    \Psr\Log\LoggerInterface $logger,
    \Magento\Framework\Registry $coreRegistry,
    \Adolmedia\Merchant\Model\DocumentFactory $documentFactory,
    \Magento\Framework\App\Response\Http\FileFactory $fileFactory,
    \Magento\Framework\Filesystem\DirectoryList $directory,
    \Magento\Framework\View\Result\PageFactory $resultPageFactory
) {
    $this->_downloader = $fileFactory;
    $this->logger = $logger;
    $this->_documentFactory = $documentFactory;
    $this->_directory = $directory;
    $this->resultPageFactory = $resultPageFactory;
    parent::__construct($context, $coreRegistry);
}

public function execute()
{
    $documentId = $this->getRequest()->getParam('document_id');

//        try {
        $document = $this->_documentFactory->create()->load($documentId);

        $filePath = $document->getFilePath();

        $fileName = $document->getFileName();

        $file = $this->_directory->getPath("media") . $filePath . $fileName; // do your validations /** * do file download */
        return $this->_downloader->create($fileName, @file_get_contents($file));
 //        }
 //        catch (\Exception $e) {
//            $this->logger->critical($e->getMessage());
//        }
}
}

when I click download link it shows in browser.

The web page at http://127.0.0.1/magento23/admin/merchant/document/filedownload/document_id/2/key/8800ab485374f4bb24103af1e0472723f66314f9f2914d220fe3ba69738ad509/ might be temporarily down or it may have moved permanently to a new web address.

How can I solve this issue??


texts: how to retrieve the list of pending invoices

texts:
I am currently developping a module which to create email recovery for customers who have not paid.

I wanted to know what is the method to get the list of invoices awaiting a specific mode of payment such as payement order.

i think this method is in the class : Mage_Sales_Model_Order_Invoice.

thank you for your help


texts: How to create sub accounts for my clients

texts: Trying to create sub-accounts for my clients, so their employees have access to store as well, can anyone help me with this?


texts: magento running apache virtualhost, backend not saving changes

texts:
I have setup two websites, http://www.firstsite.com and http://www.secondsite.com on one server using apache virtualhost.

The issue is when I login to http://www.secondsite.com/index.php/admin I can edit but not save the changes.  If i try to save it redirects  back to http://www.secondsite.com

Note: If i delete the var/cache then I able to save the changes.  But i have to keep doing this every time.

Anyone know where the issue might lie?  Or maybe point me in the right direction?


texts: I want to move billing address form under shipping address with a default checkbox in magento 2.1

texts: I want to move billing address to shipping address with a default checkbox in Magento 2.1?


texts: Leftover product attributes due to reindex failure

texts: I have on my frontend catalog page some product attributes that are not existing eny more, but due to bad reindexing, they are still appearing in the catalog page as filters. How can I remove them? The reindexation process is funky and always clogs at some reindex (either Catalog flat data, or Catalog search index, or some other one), so I doubt it has to do with reindaxtion. Any idea on how to overcome this? There is always some reindaxtion process going on, if not one, then the other. How to clear indexes completely? I tried setting the max_execution_time to 3600 in Mage.php, and it didn't help.


texts: CRITICAL: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction in magento2

texts:
[2019-01-30 11:52:41] main.CRITICAL: SQLSTATE[40001]:  Serialization
  failure:  1213 Deadlock found when trying to get lock; try restarting
  transaction,  query was: INSERT INTO sales_order_grid (entity_id,
  status, store_id, store_name, customer_id, base_grand_total,
  base_total_paid, grand_total, total_paid, increment_id,
  base_currency_code, order_currency_code, shipping_name,
  billing_name, created_at, updated_at, billing_address,
  shipping_address, shipping_information, customer_email,
  customer_group, subtotal, shipping_and_handling,
  customer_name, payment_method, total_refunded,
  signifyd_guarantee_status) SELECT sales_order.entity_id AS
  entity_id, sales_order.status AS status, sales_order.store_id AS
  store_id, sales_order.store_name AS store_name,
  sales_order.customer_id AS customer_id, sales_order.base_grand_total
  AS base_grand_total, sales_order.base_total_paid AS
  base_total_paid, sales_order.grand_total AS grand_total,
  sales_order.total_paid AS total_paid, sales_order.increment_id AS
  increment_id, sales_order.base_currency_code AS
  base_currency_code, sales_order.order_currency_code AS
  order_currency_code, TRIM(CONCAT_WS(' ',
  IF(sales_shipping_address.firstname <> '',
  sales_shipping_address.firstname, NULL),
  IF(sales_shipping_address.lastname <> '',
  sales_shipping_address.lastname, NULL))) AS shipping_name,
  TRIM(CONCAT_WS(' ', IF(sales_billing_address.firstname <> '',
  sales_billing_address.firstname, NULL),
  IF(sales_billing_address.lastname <> '',
  sales_billing_address.lastname, NULL))) AS billing_name,
  sales_order.created_at AS created_at, sales_order.updated_at AS
  updated_at, TRIM(CONCAT_WS(' ', IF(sales_billing_address.street
  <> '', sales_billing_address.street, NULL),
  IF(sales_billing_address.city <> '',
  sales_billing_address.city, NULL),
  IF(sales_billing_address.region <> '',
  sales_billing_address.region, NULL),
  IF(sales_billing_address.postcode <> '',
  sales_billing_address.postcode, NULL))) AS billing_address,
  TRIM(CONCAT_WS(' ', IF(sales_shipping_address.street <> '',
  sales_shipping_address.street, NULL),
  IF(sales_shipping_address.city <> '',
  sales_shipping_address.city, NULL),
  IF(sales_shipping_address.region <> '',
  sales_shipping_address.region, NULL),
  IF(sales_shipping_address.postcode <> '',
  sales_shipping_address.postcode, NULL))) AS shipping_address,
  sales_order.shipping_description AS shipping_information,
  sales_order.customer_email AS customer_email,
  sales_order.customer_group_id AS customer_group,
  sales_order.base_subtotal AS subtotal,
  sales_order.base_shipping_amount AS shipping_and_handling,
  TRIM(CONCAT_WS(' ', IF(sales_order.customer_firstname <> '',
  sales_order.customer_firstname, NULL),
  IF(sales_order.customer_lastname <> '',
  sales_order.customer_lastname, NULL))) AS customer_name,
  sales_order_payment.method AS payment_method,
  sales_order.total_refunded AS total_refunded,
  signifyd_case.guarantee_disposition AS signifyd_guarantee_status
  FROM sales_order  LEFT JOIN sales_order_address AS
  sales_shipping_address ON sales_order.shipping_address_id =
  sales_shipping_address.entity_id  LEFT JOIN sales_order_address AS
  sales_billing_address ON sales_order.billing_address_id =
  sales_billing_address.entity_id  LEFT JOIN sales_order_payment ON
  sales_order.entity_id = sales_order_payment.parent_id


texts:
I'm using graphql to get data to my PWA frontend project.Following is my schema.graphqls
type Query {
    comparelist: [ComparelistOutput]  @resolver(class: "NeoSolax\\CompareList\\Model\\Resolver\\ComparelistItemResolver")  @doc(description: "An array of items in the customer's compare list")
}

type ComparelistOutput {
    id:String
    sku:String
    url_key:String
}

ComparelistItemResolver.php
class ComparelistItemResolver implements ResolverInterface
{
     use NeoSolax\CompareList\Helper\getCompareList;
        public function __construct(
            getCompareList $getCompareList,

        ) {

            $this->getCompareList = $getCompareList

        }
        public function resolve(
                Field $field,
                $context,
                ResolveInfo $info,
                array $value = null,
                array $args = null
            ) {
                /** @var ContextInterface $context */
                $customerId = $context->getUserId();

                $comparelistItems = $this->getCompareList->getCompareListItems($customerId)->getItems();
                $data = [];
                foreach ($comparelistItems as $comparelistItem) {
                    $itemProduct = $comparelistItem->getData();
                    $data[] = [
                        'id' => $itemProduct['product_id'],
                        'sku' => $itemProduct['sku'],
                        'url_key'=>$itemProduct['url_key']
                    ];
                }
                return $data;

            }
}

Following is how I get my data to pwa frontend
const {data,loading:comparelistLoading}=useQuery(getCustomerCompareList);

data gets a empty array comparelist.What is wrong with my code?Please help


texts: How to specify a fixed shipping rate for each product separatly?

texts:
I'm using magento C.E 1.7.0.2. I have given table rate shipping for the countries except US with the condition price vs destination per order.

Now I want to give some fixed shipping rates for some special products when they are shipped internationally (other than US). I mean, I want exempt these products from the table rate and apply special shipping price.

How can I achieve this? I tried shopping cart price rule. But it provides only a discount for the total amount at the order review not in the shipping price.


texts:
When I edit something in system -> configuration, it doesn't matter where, for example i want to edit the store contact address, it doesnt save my edit.
I can change and add products but I cant edit anything in the configuration.
The System log and exception log are empty and no errors are shown.
Is says "The configuration has been saved."
Does someone know how to fix this.
Magento version: 1.9.3.6
EDIT:
I have noticed that this problem has occurred when we applied patch SUPEE 11219 When i revert that patch we can save config in the backend again.
Any idea?


texts: Magento 2 Integration Tests issue for custom attributes

texts:
I have created 2 new product attributes that are mandatory (required),
"vendor_id" and "delivery_country".

After creating this two attributes the integration tests are failing.

I executed the testes just for one module to see what is happening:

<directory suffix="Test.php">testsuite/Magento/AdvancedCheckout</directory>

When running the integrations tests for this module it gives me fatal error:

Magento\AdvancedCheckout\Controller\CartTest::testConfigureFailedActionWithDownloadableProduct

  Magento\Eav\Model\Entity\Attribute\Exception: The value of attribute
  "vendor_id" must be set in
  /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111

I have noticed that this module is using this two files for products:

dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable.php

and

dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple.php

I added the new attributes in the above files, after executing tests again they are passing.

The problem is that there are many files that are creating products for integration tests and I don't see as a solution to modify this files.

Is there a way to set this new attributes on all the products that are created for integration tests without modifying all the fixture files.


texts: DIV block creation in magento 2.1 using xml layout

texts:
I am trying to integrate custom template in magento2.1 as well as div container into footer block.

I am using below code in my layout but not working.

<container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" >
    <container name="footerContainer" htmlTag="div" htmlId="cart-container-id" htmlClass="cart-container" before="-">
    </container>
</container>


texts: Magento2 How can I use helper function in config

texts:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <head>
    <css src="Pwa_PaywithAmazon::pwa/css/paywithamazon.css"/>
    <block type="core/text" name="pwa.js">
      <action method="setText">
        <text helper="paywithamazon/addPWAJs"/>
      </action>
    </block>
  </head>
  <body>

I am calling this in my custom module in magento2 default.xml config


texts: Post-order Price Indexing Issues, Possible to Off-load? / High Sales Volume CE Site

texts:
Possibly related to:  Slow Save Order Due To Re-Index

CE 1.9.2.4 (soon to be 1.9.3.x)
150+ orders per hour on CyberMonday and later in the holidays
40k SKUs
3 websites, 3 stores
2 customer groups
DB has been upgraded from 1.3 -> 1.5 -> 1.6 -> 1.9.x
OMS pulling down orders to warehouse every 15 mins

This is a legacy client of mine hosted at Nexcess.  They continually have post-order pricing indexing queries hang and lock up tables and subsequently the whole site. I've done substantial comparison to vanilla CE database and I'm 95% sure we're not missing an index.

We have all automatic indexing disabled and have attempted to use the hackathon AsyncIndex extension.  https://github.com/magento-hackathon/AsyncIndex  It does appear to help but doesn't stop the queries hanging.

Has anyone attempted to off-load those indexes similar to how Ivan C describes in the question above?  Other than throw additional hardware at it, I'm thinking that could be the best solution.

My gut feeling is that it happens when two orders are saved simultaneously.

Usually the queries that hang are:

INSERT INTO `catalog_product_index_price` (`entity_id`, `customer_group_id`, `website_id`, `tax_class_id`, `price`, `final_price`, `min_price`, `max_price`, `tier_price`, `group_price`) SELECT `catalog_product_index_price_tmp`.`entity_id`, `catalog_product_index_price_tmp`.`customer_group_id`, `catalog_product_index_price_tmp`.`website_id`, `catalog_product_index_price_tmp`.`tax_class_id`, `catalog_product_index_price_tmp`.`price`, `catalog_product_index_price_tmp`.`final_price`, `catalog_product_index_price_tmp`.`min_price`, `catalog_product_index_price_tmp`.`max_price`, `catalog_product_index_price_tmp`.`tier_price`, `catalog_product_index_price_tmp`.`group_price` FROM `catalog_product_index_price_tmp` ON DUPLICATE KEY UPDATE `entity_id` = VALUES(`entity_id`), `customer_group_id` = VALUES(`customer_group_id`), `website_id` = VALUES(`website_id`), `tax_class_id` = VALUES(`tax_class_id`), `price` = VALUES(`price`), `final_price` = VALUES(`final_price`), `min_price` = VALUES(`min_price`), `max_price` = VALUES(`max_price`), `tier_price` = VALUES(`tier_price`), `group_price` = VALUES(`group_price`)

And

INSERT INTO `catalog_product_index_price_tmp` SELECT `catalog_product_index_price`.* FROM `catalog_product_index_price` WHERE (entity_id IN('###', '###'))

Though we occasionally get an integrity constraint.  Presumably because an earlier query was killed manually.

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '24683-0-1' for key 'PRIMARY', query was: INSERT INTO `catalog_product_index_price_tmp` SELECT `catalog_product_index_price_final_tmp`...

DB server is a few years old but has 24GB RAM.  We could move over to AWS and use RDS potentially.  Could simply be hardware limitation.

Thanks for your thoughts on offloading the post-order price indexer or any suggestions for Magento optimizations or possibly for additional MySQL indexes that could help.

Wilson


texts: Magento order grid purchased from store on one line

texts:
this is not the most constructive question for Magento development. But this is certainly one that keeps me boggled ...

On the magento order grid in the backed we see that an order takes up multiple lines of space. 3 instead of 1 [in column Purchased From (Store)]. This is because we have a multistore. The resukt is that we see 1/3rd of the normal number of orders on 1 screen. No biggie, but something I want to change.

My question: How can I change the text in the column Purchased From (Store)? I would like it to be store view name or store domain. And maybe on mouseover a title is shown that does show the whole sequence. Example below.

I am looking at /app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php but dont know how to go from there and actually change this.

@Mage/Ebay: Also I think this should be something to set on/off in config for future versions.


texts:
I face following issue:

  Uncaught CredisException: Connection to Redis 127.0.0.1:6380 failed

after 2 failures.Last Error :

  111) Connection refused

Does anyone know to solve it ? Thanks in advance.


texts: Automatically set a batch of pages to go live

texts: Is there a built in method, 3rd party add on, or macro that could help us put mages live without manually doing so? My goal is to set pages live at midnight but sometimes that's not possible so things get postponed.


texts:
As time has passed, the Magento core team has added more and more default language packs to the

app/locale

folder.  Is there a canon way to manage your own translation files such that they don't interfere with future system upgrades?  i.e. I want to change some labels in Magento, so I edit

app/locale/en_US/Mage_Sales.csv

directly.  If we upgrade Magento, my changes will be wiped out.   Is the theme locale feature enough for this? (does it handle module specific files, or just translate.csv).  Or is it better to rewrite the translation models to load files from a different location?  Or something else?


texts: Autoload error: An abstract factory could not create an instance in magento2

texts:
After I created a new module in Magento 2, I'm getting this error. Does anyone have a solution for this?

Running:

$ bin/magento module:status

Error:

  Autoload error: An abstract factory could not create an instance of magentosetupconsolecommandconfigsetcommand(alias: Magento\Setup\Console\Command\ConfigSetCommand).root


texts: Magento 2.3: Round Brackets Issue In Product Meta Fields

texts:
I'm using Magento 2.3.4, I don't know why this is happening but when I enter round brackets () in Meta Fields e.g Meta Title Meta Keyword Meta Description and save product it gives me an error like: A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

If anyone know what is the issue please let me know.


texts: Each visit is counted twice in Google Analytics after installing Fooman Google Analytics Plus

texts: After installing the Fooman Google Analytics+ Magento plugin (http://www.magentocommerce.com/magento-connect/fooman-google-analytics.html) on Magento Community 1.8.1 each visit is counted twice. How can this be fixed?


texts: Admin/Manual Order - Why is Adding Items slower after order custom attribute installation?

texts:
I'm working in an organisation that makes use of the admin/manual order functionality within the Magento Admin Panel. I've recently added a custom module which has absolutely killed the performance of the page; where products would normally add within a couple of seconds they now take at least 5, rising to 25-30 seconds per item once there are a dozen or so items in the basket. This is too slow when you're trying to process a customer who's on the phone.

The custom module added an attribute to the order (here's the install script):

$installer = new Mage_Eav_Model_Entity_Setup('core_setup');

$installer->startSetup();

$salesInstaller = new Mage_Sales_Model_Resource_Setup('core_setup');

$entities = array(
    'quote',
    'order'
);

$options = array(
    'type'     => Varien_Db_Ddl_Table::TYPE_BOOLEAN,
    'visible'  => true,
    'required' => false,
    'grid'     => true
);
foreach ($entities as $entity) {
    $salesInstaller->addAttribute($entity, 'customer_first_order', $options);
}

$installer->endSetup();

Apart from that, the module simply observes sales_order_save_after

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <WS_FirstOrder>
            <version>0.0.7</version>
        </WS_FirstOrder>
    </modules>
    <global>
        <resources>
            <ws_firstorder_setup>
                <setup>
                    <module>WS_FirstOrder</module>
                </setup>
            </ws_firstorder_setup>
        </resources>
        <fieldsets>
            <sales_convert_quote>
                <customer_first_order>
                    <to_order>*</to_order>
                </customer_first_order>
            </sales_convert_quote>
        </fieldsets>
        <models>
            <ws_firstorder>
                <class>WS_FirstOrder_Model</class>
            </ws_firstorder>
        </models>
        <events>
            <sales_order_save_after>
                <observers>
                    <first_order_handle>
                        <class>ws_firstorder/observer</class>
                        <method>handleCustomerFirstOrder</method>
                        <type>singleton</type>
                    </first_order_handle>
                </observers>
            </sales_order_save_after>
            <customer_first_order>
                <observers>
                    <first_order_record>
                        <class>ws_firstorder/observer</class>
                        <method>recordCustomerFirstOrder</method>
                        <type>singleton</type>
                    </first_order_record>
                </observers>
            </customer_first_order>
        </events>
    </global>
    <frontend>
    </frontend>
</config>

Moving the observer to frontend seems to make no difference. The module is functioning otherwise as expected. The only other thing I've done was update the admin order grid to show the new attribute. I've tried disabling module output (through admin) and disabling the module altogether (through config XML) and this all has made no difference.

Does anybody have any ideas why this may have slowed that down so much, and what I can do to get the performance back?

Update 1
I've set the threshold for MySQL Slow Query logging at 0.5 seconds and restarted the server. It doesn't seem to be catching any queries related to the order process - which is odd because NewRelic is reporting that /sales_order_create/loadBlock is making a call to MySQL catalog_product_entity_decimal select that is taking 900ms on average. The WebTransaction itself is reported at 1041ms average.


texts: Notice: Undefined offset: 234 in ... Modifier/Eav.php on line 614

texts: since today I can't edit products as I see the error attached:


texts: Magento 2 - How to retrieve product informations

texts:
I want to use functions like getName(), getPrice(), etc. of product to retrieve product information in Magento 2.

Can anyone show me how can I achieve that ?


texts: isModuleOutputEnabled | Resolving module conflict

texts:
I had two modules extending same core helper class and causing a conflict:

class Amasty_Methods_Helper_Payment_Data extends Mage_Payment_Helper_Data

and

class Ebizmarts_SagePaySuite_Helper_Payment_Data extends Mage_Payment_Helper_Data

I have now made a temporary fix to them and it looks like this now:

class Amasty_Methods_Helper_Payment_Data extends Mage_Payment_Helper_Data

and

class Ebizmarts_SagePaySuite_Helper_Payment_Data extends Amasty_Methods_Helper_Payment_Data

The above temporaty fix resolved the module conflict however I have a different problem. If I disable the Amasty module, it will stop the Ebizmarts module from working. I want to make sure that both modules don't depend on each other and are working regardless if any of them is disabled.

UPDATE:

This is the full content of the Ebizmarts helper class:

class Ebizmarts_SagePaySuite_Helper_Payment_Data extends Amasty_Methods_Helper_Payment_Data
{

    public function getPaymentMethods($store = null)
    {
        $_methods = parent::getPaymentMethods($store);

        if (isset($_methods['sagepaysuite'])) {
            unset($_methods['sagepaysuite']);
        }
        return $_methods;
    }
}

Now, can you help me use isModuleOutputEnabled method the get them both working.

I have something like this but not sure how to finish it and get it working:

if (Mage::helper('sage pay... not sure what')->isModuleOutputEnabled('ammethods')) {
    class Ebizmarts_SagePaySuite_Helper_Payment_Data extends Amasty_Methods_Helper_Payment_Data {}
}
else {
    class Ebizmarts_SagePaySuite_Helper_Payment_Data extends Mage_Payment_Helper_Data {}
}

class Ebizmarts_SagePaySuite_Helper_Payment_Data extends Amasty_Methods_Helper_Payment_Data
{

    public function getPaymentMethods($store = null)
    {
        $_methods = parent::getPaymentMethods($store);

        if (isset($_methods['sagepaysuite'])) {
            unset($_methods['sagepaysuite']);
        }
        return $_methods;
    }
}

Am I even close to get that right?

Is there a different way to solve my issue?


texts:
Magento AJAX form does not post any data. Also does not show any error / success message.

I used form in Popup

In Console it shows 302 Found

My form

<img src="<?php echo $this->getSkinUrl('images/proxelle/txt_1.png');?>">

<img src="<?php echo $this->getSkinUrl('images/proxelle/txt_2.png');?>">

          <form class="my-form" name="myForm" id="proxelle">
            <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
            <input type="text" name="fname" id="only-text" placeholder="Enter Your Name Here" required="true" autocomplete="off"/>
            <input type="email" name="email" placeholder="Enter Your Email Id Here" required="true" autocomplete="off"/>
            <input type="submit" name="Go">

<img src="<?php echo $this->getSkinUrl('images/proxelle/txt_3.png');?>">

            Loss
        </form>

Super

Ajax Script

Popup Script


texts: Magento 2: how to change default Country option on checkout page

texts:
I'm using magento 2.0.7 and I'm trying to change the default Country on the checkout page, from United States to United Kingdom.
I have already set from STORES > CONFIGURATION > SALES > SHIPPING METHODS, the method option to specific country, and only selected UK, but it still doesn't work, probably because I have to edit any file.


texts:
i am getting

  "Not registered handle cms_page_listing_data_source "

When i load my cms/page/index controller


texts:
I have created tables, models etc for an extention and can get collections from each model individually fine.

Here are the tables in question:

  orders_table

entity_id | magento_order_id | is_successful
--------- | ---------------- | -------------

  orders_history_table

entity_id | parent_id | state | updated_at
--------- | --------- | ----- | ----------

So the history table relates to the order table usinghistory.parent_id and orders.entity_id

Here is the current code I have to join the 2 collections:

$collection = $this->getCollection();

$collection->getSelect()->join(
    array('orders' => 'untitledprimanet_orders_orders'),
    'orders.entity_id = main_table.parent_id',
    array('prima_order_id', 'magento_order_entity_id', 'is_successful', 'is_manual')
);

Now this joins the history table and orders table fine. The issue I have is that the history table holds multiple records related to an order record e.g an entry in the orders table could have up to 4 records associated to it in the history table.

And where I am stuck is I need to only join the latest entry in the history table to its related order in order to get the latest state. So i need to use the updated_at attribute in the history table to get the latest entry for every item in the orders collection.

Any ideas? I've tried explaining as best as possible but if you need any more details let me know

EDIT
I have worked up the raw SQL query i need to create with magento:

select
    *
from (
    select
        distinct orders_history.parent_id,
        orders_history.response_state
    from
        orders_history
    order by
        orders_history.created_at desc
) as history_temp
join
    orders_orders on orders_orders.entity_id = history_temp.parent_id
group by
    history_temp.parent_id

I aam performing the Join ok but i cant work out how to add the subquery to the from clause, any ideas?

Thanks


texts: Custom under maintenance page when bin/magento maintenance:enable

texts:
I have a local magento 2 shop running and I would like to set up an under maintenance page when maintenance mode is enabled. Right now when enable maintenance mode it only shows:
1 exception(s):
Exception #0 (Exception): Unable to proceed: the maintenance mode is enabled.

Exception #0 (Exception): Unable to proceed: the maintenance mode is enabled.
<pre>#1 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:40]
</pre>

How can I set up a custom page? Thanks in advance!


texts: Flat Catalog module has a limit of 64 filterable and/or sortable attributes . How to Increase this Limit for 500 Attributes

texts:
I created 300 filterable and Sort able Attribute in Magento.
I also Enabled Flat category option in Catlog.
But When I Indexed  The New Added Product It says.
The Flat Catalog module has a limit of 64 filterable and/or sortable attributes. Currently there are 329 of them. Please reduce the number of filterable/sortable attributes in order to use this module
when I disable Flat Category of Product it working fine.
How can Solved this issue.


texts:
I'm trying to install Magento 2 on AMPPS locally, I read the requirement here ,All the requirement is installed but Magento installer still give me an error without details :

Environment :

PHP 5.6.11
MySQL 5.6.25
Apache 2.4.12

I checked all the required PHP extensions in phpinfo(), All is enabled.

I do not know what can I do more .. I restart/reinstall the AMPPS, I clear the browser history .. nothing change !


texts: Magento 1.9: Save custom image after click on Add to cart

texts:
We have custom button in product view page , once user "upload image or Add text" & click on "save design", its saving custom image in server.

save design :

app/design/frontend/rwd/Theme1/template/aitcg - js_styles1.phtml

we need similar feature for "Add to cart" button along with adding product to cart. so i am trying below code in addtocart.phtml  [ using same id as save design" ] & inserted above script in addtocart.phtml. but its not saving custom image when we click on "add to cart"

app/design/frontend/rwd/Theme1/template/catalog/product/view - addtocart.phtml

 <button id="submit-editorApply-{{rand}}"

onclick="productAddToCartForm.submit(this)">ADD TO CART</button>

save design : https://pastebin.com/9h4QGuFK , addtocart.phtml : https://pastebin.com/RK71bjGJ

Image


texts: Importing Images with Labels using addImageToMediaGallery

texts:
I am assigning multiple images onto a product in my magento store with the below:

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

$images_array = array("image1.jpg","image2.jpg","image3.jpg");
$_product->setMediaGallery (array('images'=>array (), 'values'=>array ()));

$i = 1;
foreach($images_array as $img){
    $img_url = $path.$img;
    if(file_exists($img_url)){
        if($i==1){
            $_product->addImageToMediaGallery ($img_url, array ('thumbnail','small_image','image'), false, false);
        }else{
            $_product->addImageToMediaGallery ($img_url, null, false, false);
        }
        $i++;
    }
}

I am missing the ability to set the image label during the addImageToMediaGallery method. Is this possible?


texts: Magento 2, Text Swatch, can't turn off "Visible on catalog pages"!

texts:
On Text Swatch Attributes - i have found that you cannot turn off the "Visible on Catalog Pages on Storefront".
For Visual swatch this does work.

even with v2.0.7, whenever switch between NO or Yes it is not saving.


texts: Sorting Cross-Sell Products in Magento 2.1

texts:
If I retrieve the cross-sell products for a particular product:

$_product->getCrossSellProductCollection();

How do I sort those products in the same order as the administrator has defined via the admin interface?


texts: Pull Configurable SKU instead of Simple Product SKU in Transactional Emails and Invoices

texts: Is it possible to have Magento pull the SKU of a configurable product instead of the individual simple product SKU in transactional emails and on invoices?


texts: SEO: Product Meta Title, Keywords and Description

texts:
Trying to boost SEO and came across an article that suggests tweaking the Meta Title, Keywords and Description for all products and categories.

The amount of products I have would just be impossible to do this.

Can I just not use the meta tag in my view.phtml and list.phtml to achieve the same result for the Title and Description?

Example:

<title><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></title>

<meta name="description"="<?php echo $this->__(' ') ?><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?>" />

The above would save on space in the database, is there any reason why one couldn't just use the above code instead of entering it in for each product?

Also, I seem to remember reading that adding keywords and descriptions are viewed negatively by search engines as they determine what is valid. Please correct me if I'm wrong?

If I am wrong, is there a simple way to generate keywords based on the database contents?


texts: How to override a phtml file from a custom module in magento 2?

texts:
I need to override

/vendor/magento/module-catalog/view/frontend/templates/product/view/gallery.phtml.

For this, in app/code/namespace/Customtab/view/frontend/layout/catalog_product_view.xml

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

    <referenceContainer name="content">
        <referenceBlock name="product.info.addtocart">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">namespace_Customtab::product/view/gallery.phtml</argument>
            </action>
        </referenceBlock>
     </referenceContainer>
</body>

paste the custom phtml file in

app/code/namespace/Customtab/view/frontend/templates/product/view/gallery.phtml.

But it didn't works.Please help me to find a solution.


texts: JQuery message im magento 1, need to be adjusted for non-repetition and translation-ready

texts:
I have two issues in this code:

1: if I keep clicking on the radio button the message will be repeated.
2: I cannot translate the message to other language.

Here is my jquery code:


texts: I have one issue with logout page. When I sign out, sign out page will display after 5 seconds it will redirect to home page. But before the redirect, if you log in then you get logout page and then redirect to the home page.


texts: fatal error: Call to a member function getCollection() on a non-object in magento

texts:
I am trying to get a collection of objects of a table of our database. Unfortunately the following code was leading to an error.

my code is

  <?php

class Ics_EasyLife_Block_Template extends Mage_Core_Block_Template
{
    public function methodblock()
    {

        //on initialize la variable
        $retour='';

        $collection = Mage::getModel('easylife/easylife')->getCollection()->setOrder('id_ics_easylife','asc');

        foreach($collection as $data)
        {
            $retour .= $data->getData('nom').' '.$data->getData('prenom').' '.$data->getData('telephone').'
';
        }

        Mage::getSingleton('adminhtml/session')->addSuccess('Cool Ca marche !!');
        return $retour;
    }
}

//config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Ics_EasyLife>
            <version>0.0.1</version>
        </Ics_EasyLife>
    </modules>
    <frontend>
        <routers>
            <icscontroller>
                <use>standard</use>
                <args>
                    <module>Ics_EasyLife</module>
                    <frontName>display</frontName>
                </args>
            </icscontroller>
        </routers>
        <layout>
            <updates>
                <easylife>
                    <file>easylife.xml</file>
                </easylife>
            </updates>
        </layout>
    </frontend>
    <global>
        <blocks>
            <easylife>
                <class>Ics_EasyLife_Block</class>
            </easylife>
        </blocks>
        <models>
            <easylife>
                <class>Ics_EasyLife_Model</class>
                <resourceModel>easylife_resource</resourceModel>
            </easylife>
            <easylife_resource>
                <class>Ics_EasyLife_Model_Resource</class>
                <entities>
                    <easylife>

ics_test

                    </easylife>
                </entities>
            </easylife_resource>
        </models>
        <resources>
            <easylife_write>
                <connection>core_write</connection>
            </easylife_write>
            <easylife_read>
                <connection>core_read</connection>
            </easylife_read>
        </resources>
    </global>
</config>

//Model->Easylife.php

<?php

class Ics_EasyLife_Model_Easylife extends Mage_Core_Model_Abstract
{
    public function _construct()
    {
        parent::_construct();
        $this->_init('easylife/easylife');
    }
}

//Model->Resource->Easylife.php

<?php
class Ics_EasyLife_Model_Resource_Easylife extends Mage_Core_Model_Resource_Db_Abstract
{
    public function _construct()
    {
        $this->_init('easylife/easylife','id_easylife');
    }
}

?>

//Model->Resource->Easylife->Collection.php

<?php
class Ics_EasyLife_Model_Resource_Easylife_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract
{
    public function _construct()
    {
        parent::_construct();
        $this->_init('easylife/easylife');
    }
}

//sql->install-0.0.1.php

<?php

$installer = $this;
/* @var $installer Mage_Core_Model_Resource_Setup */

$installer->startSetup();

$installer->run("

--DROP TABLE IF EXISTS {$this->getTable('easylife')};
CREATE TABLE {$this->getTable('easylife')} (
'id_easylife' INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
'nom' VARCHAR( 50 ) NOT NULL ,
'prenom' VARCHAR( 50 ) NOT NULL ,
'telephone' VARCHAR( 20 ) NOT NULL,
 PRIMARY KEY ('id_easylife')
);ENGINE=InnoDB DEFAULT CHARSET=utf8;

");

$installer->endSetup();

can anyone tell me where I went wrong?

thanks in advance.


texts: Magento ensure module config is loaded last

texts:
Is there a way to ensure that a module and its config xml is loaded last in Magento, or at least after a specific other module?

I want to avoid using the <depends> tag because it may not be 100% that the module i want my configuration loaded after will be installed.


texts: Magento only shows 9 search results per page

texts:
I am developing in magento

When I perform a search, I 'm getting 9 search results per page.
But in the top bar it shows "12"
http://overpic.net/viewer.php?file=x12x90jyind7m6rjvabsx.png

I need to get 12 results per page.

I know it is used the same block than the category page, but in category page i am getting 12 results per page, as it should be.

I am using Grid mode in both.

I have tried the following:

Change "Products per Page on Grid Default Value", "Products per Page on Grid Allowed Values" values in System > config > Catalog > Catalog > Frontend

(The category page and search result page  does not obey any value from here, I do not know where they get the current values)
 Doesn't work

Edit xml file:

-app/design/frontend/default/THEME/layout/catalogsearch.xml
with parameter like:

<action method="addPagerLimit"><limit>12</limit></action>
<action method="setDefaultGridPerPage"><limit>12</limit></action>

(still show 9)

Doesn´t work

Find some other xml file containing limitations with this number .
I didn´t find

EXTRA INFORMATION:

I have installed a custom theme.
I have Installed this module: https://www.bubbleshop.net/es/magento-elasticsearch.html to use elastic search engine.

Thanks for help.


texts:
How could I get all active domains of current Magento Store? For active store view I can use:

$this->getRequest()->getHttpHost()

which gives me "www.example.com". But I wan't an array of all Magento store domains without leading http:// and / at the end.

Thanks!