texts: Trying to filter by 'In Stock' or 'Out of Stock' on product admin grid

texts:
I have successfully been able to get whether a product is 'In Stock' or 'Out of Stock' in the Magento admin product grid using an observer in the way set out below. However when I try to filter by 'In Stock' or 'Out of Stock' it simply doesn't work.

I believe this is to do with the filter index and ensuring that the collection associates the stock column with the joined table for filtering. I'm unsure how to get this working - if anyone has any suggestions it would be much appreciated. I have set out my existing code below:

etc/config.xml

<config>
<global>
    <models>
        <stockcolumn>
            <class>Creare_Stockcolumn_Model</class>
        </stockcolumn>
    </models>
</global>
<adminhtml>
    <events>
       <eav_collection_abstract_load_before>
            <observers>
                <stockcollection>
                    <class>stockcolumn/observer</class>
                    <method>onEavLoadBefore</method>
                </stockcollection>
            </observers>
        </eav_collection_abstract_load_before>
        <adminhtml_block_html_before>
            <observers>
                <addstockcolumn>
                    <class>stockcolumn/observer</class>
                    <method>onBlockHtmlBefore</method>
                </addstockcolumn>
            </observers>
        </adminhtml_block_html_before>
    </events>
</adminhtml>
</config>

Model/Observer.php

class Creare_Stockcolumn_Model_Observer {

public function onBlockHtmlBefore(Varien_Event_Observer $observer) {
    $block = $observer->getBlock();
    if (!isset($block)) return;

    switch ($block->getType()) {
        case 'adminhtml/catalog_product_grid':
            $block->addColumn('stock_status',
                array(
                       'header'=> 'Stock Status',
                       'width' => '60px',
                       'index' => 'stock_status',
                       'filter_index'=>'inv.stock_status',
                       'type'  => 'options',
                       'options' => array('1'=>'In Stock','0'=>'Out Of Stock'),
                ));
            break;
    }
}

public function onEavLoadBefore(Varien_Event_Observer $observer) {
    $collection = $observer->getCollection();
    $collection->joinTable( array('inv' => 'cataloginventory/stock_item'), 'product_id = entity_id', array("stock_status" => "is_in_stock") )->addAttributeToSelect('stock_status');

}
}


texts:
In Magento 1.x the backend session timeout was set via:
Backend -> System -> Configuration -> Admin -> Security -> Session Lifetime (seconds)

Initially, my question was how to set this in Magento 2.0, but apparently there are differences between Magento 2.0 and Magento 2.1

For Magento 2.0: Arkadii Chyzhov has pointed out how to set this (see below).

For Magento 2.1: fschmengler has suggested a solution (see below).

However, M 2.1 appears not to provide a straightforward solution via the backend.
Can anybody come up with an additional solution for M 2.1?


texts: I can't grab region or region_id in Admin Controller - Magento 1.7

texts:
I grab the customer through their email in a backend controller:

$baseCustomer = $customerModel->loadByEmail($creationEmail);

Then I grab $customer['default_billing'] to get the ID of the billing address information.

    $cloneBilling = $baseCustomer['default_billing'];
    $baseAddress = Mage::getModel('customer/address')->load($cloneBilling);

From there I'm able to grab the customers firstname, lastname, street, city, postcode, country_id, and telephone.

$cloneCountryId = $baseAddress['country_id'];
        $clonePostcode = $baseAddress['postcode'];
        $cloneCity = $baseAddress['city'];
        $cloneTelephone = $baseAddress['telephone'];
        $cloneStreet = $baseAddress['street'];

TLDR Question: I have the customer and they have an address how do I grab the region and region_id also known as the state?


texts:
I am trying to implement two currencies for single store.. It is based on the user selection, whatever will he select the payment should be done based on that.. The currencies are pound and euro. Please help me to do so...
thanks


texts:
In my custom theme   swatch option not  display in category page in magento 2
configuration option is  not display in the category page

refer image : https://prnt.sc/nvegd1


texts: Custom Magento 2 module doesn't seem to recognize any files after registration.php (MagentoEE ver. 2.1.9)

texts:
I'm attempting to create my first module for Magento 2. This module will be my own version of "hello world". I'm simply attempting to add "test" to a product page. Currently I'm attempting to target just after the add to cart button due to the abundance of tutorials.

So far I have:
Namespace/MyPlugin/registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Namespace_MyPlugin',
    __DIR__
);

and Namespace/MyPlugin/etc/module.xml

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Namespace_MyPlugin" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Catalog"/>
            <module name="Magento_Sales"/>
        </sequence>
    </module>
</config>

At this point I setup and enabled the module (per the tutorial). It shows up under registered modules now.

Now, I suspect the problem may be before this next file as I can put blatant XML errors in this file and it still loads the page without throwing an exception. Read, nothing I purposefully add to this page to get a reaction changes anything.

Namespace/MyPlugin/view/frontend/layout/catalog_product_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="product.info">
            <block class="Namespace\MyPlugin\Block\Catalog\Product\Myplugin"
                    name="product.info.Colorswatches"
                    template="Namespace_MyPlugin::catalog/product/myplugin.phtml"
                    after="-">
            </block>
        </referenceBlock>
    </body>
</page>

I also have files created for the two files declared in the catalog_product_view.xml but again I can throw PHP die(); into them and it seemingly never gets loaded.

Namespace/MyPlugin/view/frontend/templates/catalog/product/myplugin.phtml
Namespace/MyPlugin/Block/Catalog/Product/Myplugin.php

It's also worth noting I'm new to Magento 2 in general and this could be compilation issues as I'm still not overly familiar with when I need to build, etc.


texts: Is there a way to query Magento Database for part OR all of an unserialized string?

texts:
I would like to know how to query a column for all or part of a string. I have created a module which uses data additional_information column from the Sales_Flat_Order_Payment table which I have been able to unserialize and display in a grid. However, when serching/filtering this column the user has to enter the full value which can be time consuming so I would like to filter using ANY value.

At the moment my filter is setup using strlen but I would like to know if there is a better way for me to do it please?

  protected function _paymentFilter($collection, $column)
    {
                case "additional_information_column":
                {

                    $this->getCollection()->getSelect()->where(
                        "sfop.additional_information like ?"
                        , '%column";s:'.strlen($value).':"%'.$value.'%');
                    break;
                }
    }

Any ideas are much appreciated...


texts: How can we get the session id from a Quote object?

texts:
Is it possible to get sessionId from a quote object? I'm looking for a method like,

$quote->getEncryptedSessionId()


texts: How to get Magento Currency Selector as a pop-up window

texts:
The Currency Selector is already there in header. But I would like to have it as a pop-up window, where customers can choose their desired currency.
Is it possible?


texts: index.php executes directly by PHP from the user created for the website

texts:
I have a strange issue on CE 1.9.2.4. It happens in some random or undefined conditions and when happens it takes about a minute for the website to become unresponsive (because all CPUs are maxed out).

What I see in the tasks is that index.php is started directly by /usr/bin/php from the account used by the website (and these processes are increasing rapidly!), AFAIK index.php should only be requested by HTTP, so that is very strange.

I have searched the source of the project for some command which may start that by shell command, but had found nothing. It feels like it happens when a lot of cache is in the storage and when flushed or cleared partially but do not happens always. I have checked the cron configuration and it is fine.

Anyone have some suggestions/ideas?

Edit:
I have found that these processes are started from /usr/bin/php on HTTP POST requests but not on GET requests. The PHP_SAPI however returns cgi-fcgi when logged from index.php, is that normal? The actual problem is that sometimes from action in the admin panel which makes POST request, appears the problem of increasing of these processes.


texts: Unable to access backend after attempting database backup

texts:
After initiating a backup procedure to back-up our database, the back-end became unresponsive yet the front end does still work. When I reset my browser cookies, thus destroying my session, logging in gives me the following:

Now, clicking the error log hyperlink really redirects me to a page which, in turn, shows me the same except it brings me a new log ID. Clicking that redirects me to a new log ID, etc etc.

I'm not really sure on what to do now. The front end is perfectly accessible yet the back end fails on me. We are using Magento 1.8.1.0.


texts:
When I went to system configuration in Setup Wizard to enter and save my keys, it saved them but then gave me the following error:
Command "show" failed: [InvalidArgumentException] Package magento/framework not found show [--all] [-i|--installed] [-p|--platform] [-a|--available] [-s|--self] [-N|--name-only] [-P|--path] [-t|--tree] [package] [version]
when I go to Component Manager, it just spins non stop. If I look at the Chrome code inspector, I see the following 500 error:

  Failed to load resource: the server responded with a status of 500 (Internal Server Error)   /setup/index.php/componentGrid/components

Any help would be appretiated!


texts: How to give 'custom menu' permissions to a role?

texts:
Some weeks ago I created a new custom menu in backend. Now I want to select this new menu in order to give permissions (or not) to the roles that I have on my website.
The problem is that this new custom menu doesn't appears in the resources of the role. You can see this menu only if you have all the access granted.

Anyone knows how to solve this ?

Thanks.


texts:
I am making a rent module and I want to send a price attribute "rent_price" to cart page when customer click on rent button and normal price(base/special) when they click on add to cart.
Please help.


texts: Magento checkout add custom calculation in backend

texts:
i want to override checkout flow and add custom field in table based on user who checkout :

suppose customer with id 10 completed checkout , i want to do entry in table with customer id and same custom value .

where have i to write code ??.. which magento event should i override in my custom module


texts: How to get Categories of products In Observer?

texts: I need to add a condition for my category in the observer, how can I call category?


texts: InvalidArgumentException: Package magento/product-enterprise-edition not found

texts:
composer show magento/product-enterprise-edition 2.3.* --all | grep -m 1 versions

  [InvalidArgumentException]   Package
  magento/product-enterprise-edition not found

  show [--all] [-i|--installed] [-p|--platform] [-a|--available]
  [-s|--self] [-N|--name-only] [-P|--path] [-t|--tree] [-l|--latest]
  [-o|--outdated] [--ignore IGNORE] [-m|--minor-only] [-D|--direct]
  [--strict] [-f|--format FORMAT] [--] [] []

I'm sure I used the right key for enterprise, but it was wrong。Help!!!


texts: Magento 2.3 configurable product price not showing

texts:
I have a problem with my 2.3.0 installation. Configurable product's price is not showing either on the catalog page or product page.

The second thing is this MSI. I may not fully understand it, but I think when a product is in stock in one of the three sources I set up, it should be "available" in the frontend.

Also, I have a problem with configurable product options not showing on product page, when one child product is set to "in stock", but with zero qty. This one worked with 2.2.6.


texts: Module Cronjob not running on Magento 1.7.0.2

texts:
i am trying to run a custom cronjob, however it doesn't seem to do anything. cron.php is running (is on crontab and writes to log after modification).

The cron_schedule table has entries, but doesn't list the cronjob of my module.
I also cleared the cache.

Here is the part of my xml dealing with the cronjob:

<global>
    <models>
        <vendor_foobar>
            <class>Vendor_FooBar_Model</class>
        </vendor_foobar>
    </models>

    <crontab>
        <jobs>
            <vendor_foobar>
                <schedule>
                    <cron_expr>* * * * *</cron_expr>
                </schedule>
                <run>
                    <model>vendor_foobar/observer::checkFoo</model>
                </run>
            </vendor_foobar>
        </jobs>
    </crontab>
</global>

There is a path Vendor/FooBar/Model in app/local and it has a file called Observer.php with a class called Vendor_FooBar_Model_Observer:

class Vendor_FooBar_Model_Observer {
   public function checkFoo(){
       # ...
   }
}

I tried various things to make the effect of checkFoo visible: Writing to logs, throwing an exception, even sending an email. But it doesn't seem to be called at all, which fits the observation, that it isn't listed in cron_schedule.

Maybe there is something wrong with my code, maybe there is some requirement i am missing. But if not: Where in the core can i put debugging points to show what is going wrong? The mechanism indicated in cron.php seems a bit cryptic :/


texts:
I am trying to install Magento 1.9.3 on my localhost.
I download ZIP -> unzip it -> put the entire folder in htdocs of MAMP.
When i run the folder it shows an error -->

This page isn't working.

Above steps work well version 2.1.5.

I tried to change the php version of my system to 5.6
Also the folder has permissions 777.

Kindly let me know what else can be done. I need help urgently.

Thank you in advance.


texts: SUPEE-6285 patch, what has been changed?

texts:
OK, somebody has to ask this: today, 7/7/2015 a new security patch for Magento < 1.9.2 has been released.

  update your shops ASAP!

But what has been changed? Are there known exploits of the covered security issues? What's the worst that could have happened?

And is there anything that can break? Like with SUPEE-5994 where it wasn't possible to apply the patch if the downloader directory was missing...


texts: Modify the From address of the Contacts email

texts:
I send emails from Contact form, e.g. template='contacts/form.phtml', to an osTicket system.

My problem is that the customer's email address is set as the ReplyTo header of the email sent by this form, but my osTicket system needs the customer's email set as the From header.

How could I modify the From header in the email sent from the Contact form of Magento website?


texts: Filtering a collection by product entity_id results in collection missing products

texts:
I'm having issues trying to create a collection of child / associated products given a particular parent / configurable product.

I have no issue creating the collection for the parent (i.e. configurable) products that I want, no issue getting my entity IDs for the child products (that is, in the below code snippet, $childIds contains the correct values) but when I attempt to build my collection, $childrenCollection->getSize() is sometimes different than count($childIds[0]), even though I'm filtering based on those values.

<?php

include_once('app/Mage.php');
Mage::app();

$attCodeBrand = 'brand';

$attBrand = Mage::getModel('catalog/product')->getResource()->getAttribute($attCodeBrand);

$brandId = $attBrand->getSource()->getOptionId('Sears');

$configurableCollection = Mage::getResourceModel('catalog/product_collection')
        ->addAttributeToFilter('type_id', array('eq' => 'configurable'))
        ->addAttributeToFilter('brand', array('eq'=>$brandId));

while ($parent = $configurableCollection->fetchItem())
{
        $parentId = $parent->getId();

        $childIds = Mage::getSingleton('catalog/product_type_configurable')->getChildrenIds($parentId);

        $childrenCollection = Mage::getResourceModel('catalog/product_collection')
        ->addAttributeToFilter('entity_id', array('in'=>$childIds[0]));
}
?>

I thought perhaps that my associated products somehow linked to a product with a bad ID, but I have tested explicitly loading the products that are missed in $childrenCollection and there's no issue there.

Is there some sort of implicit filtering that's going on that I'm not aware of?

Edit: Magento version is 1.14.2.4 EE.


texts: How to avoid having to run "setup:upgrade" and "static deploy" each time a change is made?

texts: Whenever i make changes in knockout.js files and html file inside web folder. I have to run "setup:upgrade" and "static deploy" again. Is there any solution to avoid doing this?


texts:
I have Created Custom Category Grid Module for backend. But problem is that when I click on Grid->Recipe (created module) getting blank page.
so can anyone tell me what is the reason for getting blank page.
I am new in Magento and using magento 1.9.2.3 version. Below is the link of my custom grid.
  http://127.0.0.1/magento/index.php/admin/categoryrecipe/index/key/0630b5710a2a8926b253d04f755a684f/


texts:
I am following this article. I would like to fetch Customer details like first name, last name and email using Mage::getModel('sales/order').

Can anyone say how can I do that??


texts: What is the difference in these two snippets?

texts:
Is there really a difference between these two code snippets?

First, getting the cart_count using getItemsCount()

    $cart_count = Mage::getSingleton('checkout/cart')->getItemsCount();

and this one getting the cart, first:

    $cart = Mage::helper('checkout/cart')->getCart();
    $cart_count = $cart->getItemsCount();


texts: Try to use Fabian Schmenglers Site Audit tool but getting an error

texts:
I try to use this tool

https://github.com/schmengler/magento-audit

But I am getting this error

wget: option requires an argument -- 'O'

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

What am I missing?!


texts: Can someone please tell me why this price rule only works if the quantity 2 of the same SKU?  I want the rule to work when any 2 SKU's are added to cart with the sample attribute.


texts: I aspire to become a Magento developer -- what skills are needed?

texts:
I have an interest in both e-commerce and web development and I would love to do this professionally a few years down the road, particularly Magento development.

I wanted to hear from experts like all of you in this community, which languages/technologies/other skills you feel are relevant to be successful in this industry. I would love if you could break it down by category like server side, client side, software, etc.

For example, I've been using Windows 7 ever since I got into web development, and I wonder if i want to get serious about Magento development do I need to run linux or OSX? Do I need advanced knowledge of server adminstration?

I would like to know which technologies/skills you guys have that assists you in daily development.


texts: Magento2 REST API products list and out of stock

texts:
In the api call V1/products i get also out of stock products, even though I've set in Stores->configuration->catalog->inventory "Display out of stock products" to No.
there's a way to get rid of this annoing missing feature?


texts: Checkout Add-to-Cart Returns to an Ajax Request URL Instead of Catalog Page

texts: Magento is redirecting the page to the last "URL request", meaning if the catalog page has an ajax call, it would return to that URL. Which is odd because after adding an item to the cart, it would display a JSON response which came from the last Ajax request made by the catalog page. My setting upon adding an item to the cart is to return to the catalog page instead of redirecting the user to the Cart page. Any idea?


texts:
I am developing a magento store where customer places the order without payment. The payment is done after some duration on batch i.e all orders during that time interval should be paid automatically by cron job.

For credit card storage, I am thinking of Authorize.net CIM.

Is it possible to do so? How can I achieve this?

Regards


texts:
I am trying to modify third-party code that adds a discount and then reloads the cart.
What I want to do is skip reloading the cart and updating the totals via JS.
To be able to do this, I need to pass the updated totals via JSON, and here is my problem:
I know the formatting of the totals is done by rendertotals() in Mage_Checkout_Block_Cart_Totals, but how can I access this code?

I can access the cart with Mage::helper('checkout/cart')->getCart(), and I know there's Mage::helper('checkout/cart')->getCart()->getQuote()->getTotals(), but this returns an array while I'd like to call the same formatting procedure that is called when the cart is displayed initially to be sure the update procedure is visually compatible.

I guess it's trivial, but I am not yet familiar with the calling syntax of Magentos helpers and singletons.

Thank you for reading!


texts: Enterprise 1.13 Persistent Shopping cart with disabeld products

texts:
I have been having some issues where customers have added sale items to their basket. We have disabled the products and the customer can still purchase the products after they have been disabled if they are in their basket that has been saved using persistent shopping cart.

Is there a way of making sure that if the customer does checkout using this saved shopping cart products that have been disabled are either removed from the basket or a notice informs them that the item is no longer available


texts: Magento 2 data migration - MySQL versions (source/destination)

texts:
I have always migrated from a Magento 1 server database copy that is local and restored on MySQL 5.7 (on the same database host as my Magento 2 migrate database).

I would usually use <direct_document_copy>1</direct_document_copy> in config.xml, but now I want to do a migration test from a live Magento 1 website - so I need to do this:
0

My question though : this live Magento 1 database is running on MySQL 5.6x, and I am aware that Magento 2.2+ runs on MySQL 5.7.  I need to test migrate:delta (delta migration) eventually, the databases I always ran tests on was offline (so no database triggers will have any effect).

How would I do this migration when my source database version and destination database versions aren't the same?

Can I just run the migration on the live site?  I can't upgrade to MySQL 5.7 on the production server - because of the Magento 1 database.

Thanks!


texts: addColumn to sales_flat_order_grid table with CASE data

texts:
Using Magento ver. 1.9.0.1

Using this amazingly well written answer "Add Column to a grid (observer) - Column ‘store_id’ in where clause is ambiguous issue" I have added new basic columns to the sales_flat_order_grid table.

However, the next part of my requirements has me stumped! I am trying to add a new column to the sales_flat_order_grid table with data manipulated using CASE MYSQL. The idea is that a new column is added showing when an order has been paid, part paid or still awaiting payment based on data from the sales_flat_order_payment table.

In MYSQL the query would look like this:

SELECT `order_grid`.*,
CASE
WHEN `order`.`total_paid` > `order`.`grand_total` AND `order`.`total_paid` > 0 THEN 'part_paid'
WHEN `order`.`total_paid` = `order`.`grand_total` THEN 'paid'
ELSE 'not_paid'
END AS `payment_status`
FROM `sales_flat_order_grid` AS `order_grid`
LEFT JOIN `sales_flat_order` AS `order`
ON `order`.`entity_id` = `order_grid`.`entity_id`

I was able to work out that the Zend equivalent looks something like this:

/*
=================
Code sample from modified version of
/app/code/community/Example/SalesGrid/sql/example_salesgrid_setup/install-0.1.0.php
(See linked example above)
=================
*/

$adapter = $this->getConnection();
$select = $adapter->select();

$case_payment_status = $adapter->getCaseSql('', array(
    'order_payment.amount_paid  0' => '"part_paid"',
    'order_payment.amount_paid = order_payment.amount_ordered' => '"paid"'
), '"not_paid"');

$select->join(
    array('order_payment'=>$this->getTable('sales/order_payment')),
    $this->getConnection()->quoteInto(
        'order_payment.parent_id = order_grid.entity_id'
    ),
    array(
        'payment_status' => $case_payment_status
    )
);

I know this code works as the new payment_status column is correctly populated with data from this case on installation/upgrade /app/code/community/Example/SalesGrid/sql/example_salesgrid_setup/install-0.1.0.php

# Question #

My question is, how can I add this new CASE created payment_status column to the resource using the addVirtualGridColumn? The code below gives an unknown error on order update/save...

class Example_SalesGrid_Model_Observer {

    public function addColumnToResource(Varien_Event_Observer $observer) {
        // Only needed if you use a table other than sales/order (sales_flat_order)

        $resource = $observer->getEvent()->getResource();

        $adapter = $resource->getReadConnection();
        $case_payment_status = $adapter->getCaseSql('', array(
            '{{table}}.amount_paid  0' => '"part_paid"',
            '{{table}}.amount_paid = {{table}}.amount_ordered' => '"paid"'
        ), '"not_paid"');

        $resource->addVirtualGridColumn(
            'payment_status',
            'sales/order_payment',
            array('parent_id' => 'entity_id'),
            $case_payment_status
        );
    }
}

I really hope someone can help or point me in the right direction as I think the solution is very close but can't quite reach it alone.

Please let me know if you have questions of if I've not explained the issue well enough.

Thanks in advance!


texts: customer dataflow advanced profile export retrieve field updated_at in xml action with map name doesn't work

texts:
I am trying to export customers and want to export also the field updated_at which is in the table customer_adress_entity.

As in the advanced profile dataflow export there is no choice to choose that field I tried it with the xml actions possibility.

I added the following line

    <map name="updated_at"><![CDATA[updated_at]]></map>

but an empty value is the result. Even if there are values in the table.


texts:
A Magento installation that I'm working on has the EM Quickshop module. In their layout/em_quickshop.xml file they have:

<quickshop_index_view>
    <update handle="catalog_product_view"/>
</quickshop_index_view>

<quickshop_index_view_FINAL>
    ...

In <quickshop_index_view_FINAL> they <remove /> blocks that we want to keep. Probably just because "final" is such a common word, I'm having a hard time finding anything out about this. But what it seems is that my_handle get's loaded, and then my_handle_FINAL gets loaded, and nothing can come after that.

Therefore, the only way that I can see to un-remove the blocks that they are removing, is to edit their file directly. Is that correct?


texts: what shipping method or extension to use?

texts:
I've searched online for 3 days but couldnt find a solution at all... hope someone can give me a solution....

The idea is quite simple. I offer free shipping to lower 48 states.
and charge extra shipping to PR, AK, and Hawaii, also Canada.
Simple right ??

the tricky part is, I charge different shipping fee depend on the item and locations.

for example, we charge $7 to ship to PR, AK, HI/$20 to ship to Canada for product A.
and charge $11 to ship to PR, AK, HI, $30 to Canada for product B and so on..

actually it can be done with table rate (weight vs destination)..
but the problem is all items must ship separately.

so if a customer from PR bought two product A, shipping would be $7x2
if bought one product A and one product B, shipping would be $7 + $11
and shipping would be $33 if customer from PR bought three of product B.

is there anyway I can accomplish this?
or an extension can do the job? Please point me to the right direction.


texts:
I have just installed 1.9.0.1 locally on my MAC.

My local url is http://jim.local.com and also matches the base urls in the phpAdmin panel.

I am getting errors for all of the urls other than the home page for example, navigation urls are broken.  For the nav it appears they should be pointing to jim.local.com/index.php/accessories.html for example but the hyperlinks are defaulting to jim.local.com/accessories.html and creating 404.

Any ideas?


texts: Magento Multi domain setup complete guide setup index.php .htaccess

texts:
i am searching complete guide to setup multidomain guide, specially changes in index.php and .htaccess, what i find in google search is here, but its not complete

  Blockquote

 switch ($_SERVER['HTTP_HOST']) {
    case 'www.aaa.nl':
    case 'aaa.nl':
        $params = $_SERVER; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'base';
        $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
        $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
        $app = $bootstrap->createApplication('Magento\Framework\App\Http');
        $bootstrap->run($app);
        break;
    case 'www.bbb.nl':
    case 'bbb.nl':
        $params = $_SERVER; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'uspnl';
        $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
        $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
        $app = $bootstrap->createApplication('Magento\Framework\App\Http');
        $bootstrap->run($app);
        break;
    case 'www.ccc.nl':
    case 'ccc.nl':
        $params = $_SERVER; $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'tidnl';
        $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
        $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
        $app = $bootstrap->createApplication('Magento\Framework\App\Http');
        $bootstrap->run($app);
        break;

    default:
        Mage::run();
    break;
}

  Blockquote

Please clear this enough what should do in .htaccess ?? or there need to make sudir i mean for other website ?


texts: Is it possible to merge several attribute values and show it under single attribute name in the filtering?

texts:
We sell shoes online and have EUR, UK and US sizes. In the filters this appears very messy and also misleading as if you filter by UK11, the shoes that come in a European sizes would not be showing, even though there is a EUR 45 that would be the equivalent.

Is it possible to have one filtering option for, for example "UK 11/US 12/EUR 45" instead of having one for UK 11, one for US12 and one for EUR45?


texts: Added function to class core not returning anything

texts: I want add a function to the core class. To do this I have added a file to extend the class core but when I call the function it's returning nothing.


texts: Select different product packaging (select between different SKU's)

texts:
I would like to know if there is a possibility to select different product packaging options while viewing one of packaging types. My aim is to display all packaging options separately (to display price for each packaging option) while enabling an option to select different packaging option within product view.

From practical aspect: I have a food supplement with 30 and 60 tablets. I would like to achieve that user could select a product with 60 tablets within viewing product with 30 tablets and vice versa. Also, the price and SKU has to change to the selected product. Is that achievable with Magento? I have tried through bundle options and custom attributes but couldn't find a workable solution for me.

I would be thankful for any solution.


texts: Not enough data in Product\CollectionFactory, how can I get the rest?

texts:
I need to get several info from each single product in the catalog, so I used the Magento\Catalog\Model\ResourceModel\Product\CollectionFactory to get a collection of products.

Iterating through them I notice I cannot get all the data related to each product.

E.g.

$product->getData('name') returns the Product Tile
$product->getData('qty') dosen't work
$product->getData('quantity_and_stock_status') returns 1 (just the number like a string)

In the last example $product->getData('quantity_and_stock_status'), if I load the product with Magento\Catalog\Model\Product, then instead of returning 1, I get an array with 2 values qty and is_in_stock, which is what I want.

Just a quick note, loading each product with Magento\Catalog\Model\Product is taking ages, so I'd avoid it.

Is it possible having all the info related to the product with the Product\CollectionFactory?


texts:
In /app/design/frontend/base/default/template/mana/filters/items/list.phtmlfile
there is a line
$_item->getCount()
I am looking for getCount() function as my website's layered navigation filter is not working properly, and found it in few files. These are the files

/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Attribute.php
/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php
/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php
/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item.php
/app/code/core/Mage/CatalogIndex/Model/Attribute.php
/app/code/core/Mage/CatalogIndex/Model/Price.php
/app/code/core/Mage/CatalogIndex/Model/Resource/Attribute.php
/app/code/core/Mage/CatalogIndex/Model/Resource/Price.php
/app/code/core/Mage/Reports/Block/Product/Abstract.php
/app/code/core/Mage/Reports/Block/Product/Viewed.php
/app/code/core/Mage/Reports/Model/Product/Index/Abstract.php
/app/code/core/Mage/Tag/Block/Customer/View.php
/app/code/core/Mage/Tag/Block/Product/List.php
/app/code/local/AW/Advancedreports/Model/Additional/Reports.php

I renamed getCount() method in all these files and still this line
$_item->getCount() is working fine. It is still showing count for filters. Anyone could help me locate this function and if this function is in above files then why it is still working after I have renamed the function.

It is related to magento core functionality, and I have looked in /app/code/local folder also for this function, if anyone had override the function, but could not find it.


texts:
I have a problem while doing search in magento store...

Getting following error:

Fatal error: Call to a member function getId() on a non-object in
The line that is giving error is the last line in the below code:

Code I used is:

<?php
    $_productCollection=$this->getLoadedProductCollection();
    $_productCollection->addAttributeToSelect('news_from_date')
        ->addAttributeToSelect('news_to_date');
    $_helper = $this->helper('catalog/output');
    $store = Mage::app()->getStore();
    $code  = $store->getCode();
?>
<?php $_helper = $this->helper('catalog/output');?>
<?php $_category_detail=Mage::registry('current_category');?>
<?php
    $products_count = Mage::getModel('catalog/category')->load($_category_detail->getId())->getProductCount();
?>


texts: Magento email cron not working in Godaddy Hosted site

texts:
I have my client's site hosted at Godaddy Server.

Magento version: CE-1.9.2.4.

Now I have setup cron to autorun every 1 minute like below:

/web/cgi-bin/php5 /home/acmeimpex/public_html/rootfolder.com.au/cron.php

But this cron isn't running and I ain't getting any New Order emails.

Can anyone suggest something ?


texts: configurable products don't show up shipment method in checkout

texts:
I am trying to make a configurable product (clothes with size and color) shipped. When I create a simple product I see shipment method :

But when I select a configurable product (choose the size and the color), I don't see the shipment method and I'm forwarded directly to the payment page. And I must say these products have weight.

When I see to the DB (table catalog_product_entity), I see the main product is Configurable while the others (combination size-color) are virtual. I hanged the "virtual" attribute to "simple" , still didn't work


texts: How to call payumoney function in customized page?

texts: I have redirected to payment method and then while placing order what are the required parameters to pass in Payment Method. Here I only have amount value. I am not placing any order.


texts: How to check if billing and shipping address are equal?

texts:
I'm trying to check if billing and shipping address are equal when creating invoice PDFs.

What I've tried so far was:

$order = $invoice->getOrder();
if( $order->getBillingAddress()->getData() != $order->getShippingAddress()->getData() )

or

$order = $invoice->getOrder();
if( $order->getShippingAddress()->getData('same_as_billing')!='1' )

but neither works. I was also trying to get the quote by using $order->getQuote() but that didn't work either.

Is there any way to check if billing and shipping address are equal?


texts: Magento Cache, what function does it have?

texts:
What function does the cache have in magento?

Thankfull for an answer!


texts: Observe payment_method_is_active only for front end not working

texts:
I am trying to hide some specific payment method from frontend only.
I have tried with observer and plugin.
Both working fine if my di.xml and events.xml placed in global config i.e

app/code/Vendor/Module/etc/di.xml
app/code/Vendor/Module/etc/events.xml

Problem is, if I move them to frontend they stop working.

app/code/Vendor/Module/etc/frontend/di.xml
app/code/Vendor/Module/etc/frontend/events.xml

Thanks in advance


texts: Adding attributes as a dropdown in Main Category Navigation

texts:
I'm working on a site that has main categories and there are product attributes that appear in the layered nav such as brand, type, color.

I would like to have a dropdown when hovering on a category link in the main nav that would have links for some attributes under that category

For example the categories are "Men's Shoes" "women's shoes" and under each one would be links for "by color: white, brown, etc." by occasion: casual, dress, etc."

How would go about creating something like this?


texts: How to Use Session or Cookie in Magento 2.0

texts: I am going to add Age verification block on Home page. for that i want to set session or cookie variable. so that i can check it through out all pages of store weather age verification session or cookie set or not.


texts:
I want to change default home page to login page in Magento 2.3

Mean that want to see customer login instead of homepage


texts: Location of error report in magento Enterprise edition

texts:
I am not able to get the location of error report while working in Magento Enterprise Edition 1.14.

I did not get anything in var folder of the site please help me.


texts:
I need to programm a extension that checks a PDF our customer uploads for things like the right format (in terms of size for example 210 x 297 mm) or if there is 3 mm bleed on the PDF.

I really dont know how to handle this, I would need to extend magento with some external libarys.

Can someone help me out, how would you guys get something like this to work?


texts:
Every time GIT push source code to Magento Cloud, it will show 'Service Temporarily Unavailable'
I have googled found some solution that deletes the .maintenance.flag file in /var.
But this action I need to do it after every GIT push action. is it has another method to solve this problem?

Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.


texts: Why my product type in magento 2 don't have the advanced price?

texts:
I created special product type. I want to set advanced price but form has no Advanced price.

Simple product:

My special product type:

How can I fix this?


texts: Create Product at Magento 2.3.3 Using REST in C#

texts:
I'm trying to create simple Product by Rest Api status code is ok

Although I can not see the product in Magento2, Here is my code :

Token = this.GetAdminToken("admin", "password");
 var request = CreateRequest("/V1/products", Method.POST, Token);
 var product = new M2Product();
 product.Sku = "BA3245";
 product.Name = "PRoductx";
 product.Price = 100;
 product.Status = 1;
 product.Visibility = 4;
 product.AttributeSetId = 4;
 product.TypeId = "simple";

string json = JsonConvert.SerializeObject(product);
request.AddParameter("application/json", json, ParameterType.RequestBody);
 var response = Client.Execute(request);
if (response.StatusCode == System.Net.HttpStatusCode.OK){
    }else{
    }

I wonder if the installation or configuration of something is missing
Thanks in Advance!!


texts:
I try to upload a file using Zend.

I made a standard form with a submit button which calls a controller.

In this controller, I have :

<?php
class Mine_Custoptiontypev5_UpfileController extends Mage_Core_Controller_Front_Action
{
    public function updatefileAction()
    {
        $post = $this->getRequest()->getPost();

    try {
            if (empty($post) || empty($_FILES)) {
                echo 'Invalid form data.';
                return $this;
            }

        $_order_id = $post['order_id'];
        $_item_id = $post['item_id'];
        $_option_id = $post['option_id'];
        $_action = $post['options_'.$_option_id.'_file_action'];

        $upload   = new Zend_File_Transfer_Adapter_Http();
        $file = 'options_' . $_option_id . '_file';

        $runValidation = $upload->isUploaded($file);
            if (!$runValidation) {
                return $this;
            }

        $fileInfo = $upload->getFileInfo($file);
        $fileInfo = $fileInfo[$file];
        $fileInfo['title'] = $fileInfo['name'];

    }
    catch (Exception $e) {
            // when file exceeds the upload_max_filesize, $_FILES is empty
            if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['CONTENT_LENGTH'] > $this->_getUploadMaxFilesize()) {
                $_option->setIsValid(false);
                $value = $this->_bytesToMbytes($this->_getUploadMaxFilesize());
                Mage::throwException(
                    Mage::helper('catalog')->__("The file you uploaded is larger than %s Megabytes allowed by server", $value)
                );
            }
        }

        /**
         * Option Validations
         */

        // Image dimensions
        $_dimentions = array();
        if ($_option->getImageSizeX() > 0) {
            $_dimentions['maxwidth'] = $_option->getImageSizeX();
        }
        if ($_option->getImageSizeY() > 0) {
            $_dimentions['maxheight'] = $_option->getImageSizeY();
        }
        if (count($_dimentions) > 0) {
            $upload->addValidator('ImageSize', false, $_dimentions);
        }

        // File extension
        $_allowed = $this->_parseExtensionsString($_option->getFileExtension());
        if ($_allowed !== null) {
            $upload->addValidator('Extension', false, $_allowed);
        }
        else {
            $_forbidden = $this->_parseExtensionsString(Mage::getModel('Mine_Custoptiontypev5_Model_Catalog_Product_Option_Type_Xfiletype')->getConfigData('forbidden_extensions'));
            if ($_forbidden !== null) {
                $upload->addValidator('ExcludeExtension', false, $_forbidden);
            }
        }

        // Maximum filesize
        $upload->addValidator('FilesSize', false, array('max' => $this->_getUploadMaxFilesize()));

         /**
         * Upload process
         */

         $this->_initFilesystem();

        if ($upload->isUploaded($file) && $upload->isValid($file)) {

            $extension = pathinfo(strtolower($fileInfo['name']), PATHINFO_EXTENSION);

            $fileName = Mage_Core_Model_File_Uploader::getCorrectFileName($fileInfo['name']);
            $dispersion = Mage_Core_Model_File_Uploader::getDispretionPath($fileName);

            $filePath = $dispersion;
            $fileHash = md5(file_get_contents($fileInfo['tmp_name']));
            $filePath .= DS . $fileHash . '.' . $extension;
            $fileFullPath = $this->getQuoteTargetDir() . $filePath;

           $upload->addFilter('Rename',
           array(
                'target' => $fileFullPath,
                'overwrite' => true
            ));

            try {
            $upload->receive();
            Zend_Debug::dump($upload->getFileInfo());}
            catch (Zend_File_Transfer_Exception $e) {
                Zend_Debug::dump($e->message());
            }
…

But my file is not moved to the desired destination path (../quote/x/x/xxxxxxxxxxxxx.xxx)

Could you help me please?


texts:
How to use V1/search to get the names and SKU's of the magento products?

I need a text based search to get the names and SKU's of the magento products. While using V1/products API, the response is too much. I just need the name and the SKU, just like google suggestions come up when you type something.

I tried wit the V1/search api but no luck:http://192.168.1.180/magento/index.php/rest/V1/search?searchCriteria[filter_groups][0][filters][0][field]=name&searchCriteria[filter_groups][0][filters][0][value]=%nike%&searchCriteria[filter_groups][0][filters][0][condition_type]=like


texts:
I'm using the following formula to show pergentage discount on frontend

$sconto =  100 - ($_product->getFinalPrice() / $_product->getPrice())*100);

It's working well with > 1 € prices, but failes with this case:

Full price 0,90 €
Discounted price 0,86 €
Discount (by catalog price rule): 5%
Discount showed: 4%

I think it is a round problem, but I don't now how to solve.


texts: Show out of stock product "variants" for configurable products

texts:
do you know how to show the product "variants" (sorry if this terminology is incorrect) even if it is out of stock and possibly show "Out of stock" instead of the price?

So for example I have a T-shirt configurable product, so I have added a green single product and an orange single product as Associated products. The orange product is out of stock, I still want it to be displayed in the dropdown menu so customers know that there's an orange option but it should be out of stock so the customer can't order.

Does anybody know?


texts: Magento : “index” append to email template url

texts:
Magento ver. 1.7.0.2

In email templates facing one issue.

When I use

it give me o/p like

But I want like following

Now If I add

It give me o/p like

But I want like following

Now If I add

It give me o/p like (/index/index automatically appended)

But I want like following

And when I click on link it will navigate me to /service page not service/contact page.

Any idea what's this going on?


texts: payment method is not visible after installing an extension

texts:
I installed extension in magento site.

after installing extension  i can not able to see the paymnet methods under checkout page.

app > code > local > extension_name > controllers > frontend > checkout > onepagecontroller.php

onepagecontroller.php code  = http://codepad.org/y4GVDLYL

check above code and help me what is the problem that why payment methods are not displaying?

please help me to find solution.

thanks in advance.


texts: Product Review post action rewriting not working

texts:
I wrote this code in config.xml, trying to rewrite product review post action.

<rewrite>
            <namespace_module>
                <from><![CDATA[#^/review/product/post/#]]></from>
                <to>/module/review/post/</to>
            </namespace_module>
</rewrite>

But but when I sumit form this redirecting me to homepage.

I have used this code too Overriding controller.

include_once"Mage/Review/controllers/ProductController.php";
class Namespace_Module_NewController extends Mage_Review_ProductController
{

please suggest what I am missing.


texts: Configurable products in Catalog price rule

texts:
I have set up a catalog price rules that provide a bulk discount for products in certain categories. It works fine for simple products but unfortunately it seems to ignore configurable products. My rule is to have 15% discount on all selected categories.

The associated products in the configurable products doesn't associated with any category, as those won't get displayed independently on front-end. If I bind all associated products to the category the price rule works.

Do I need to bind all associate products to respective category?

Update:
I have checked the catalogrule_product_price table and it have discount applied to product ID of configurable product and not to its associated simple product.


texts: How to create model containing list of product tax classes?

texts:
My current model is:

<?php
namespace Vendor\Modulename\Model\Config;

class Taxes implements \Magento\Framework\Option\ArrayInterface
{
    protected $_tax;

    /**
    * to option array
    *
    * @return array
    */
    public function __construct(
        \Magento\Tax\Model\Calculation\Rate $taxModelConfig){
        $this->_tax = $taxModelConfig;
    }

    public function toOptionArray()
    {
        $taxes = Array();
        foreach($this->_tax->getCollection()->getData() as $tax){
            //echo '<pre>';var_dump($tax);echo '</pre>';
            array_push($taxes, ['value' => $tax['code'],'label' => $tax['code']]);
        }
        return $taxes;
    }
}

It lists all tax rules. Is there any similar (without direct database query) way to list all Product Tax Classes (like default "Taxable Goods")?

Thank you in advance for any help.


texts: I want to show some payment method option if grand total amount greater than 3000 in checkout page

texts:
Need to show one checkbox in product details page and if customer choose these checkbox then need to show only one payment method option in checkout page.
Condition is:
if grand total amount greater than 3000 and customer choose checkbox.Is it possible in magento?


texts: Magento2 - Remove Sample Data using Mysql Script

texts: Did anyone know how to remove the Sample data from Database using Mysql script, I know we can remove using CLI, But i need a script to remove in Database.


texts: Controller redirect on jquery post request from phtml template

texts:
I want to redirect user on button click from .phtml template file, however, really struggle to find a working solution.

Here is my controller with path of /batchorder/index/addtocart:

public function execute()
    {
        $this->_redirect('checkout/cart/index');
    }

Here is my template file with the post request:

$("#addToCart").click(function(){
     let controllerUrl = "<?php echo $block->getUrl('batchorder/index/addtocart'); ?>"
     $.post( controllerUrl );
 }

When I navigate to www.mydomain.com/batchorder/index/addtocart in my browser, the redirect is working fine, however, when hitting the button with id #addToCart the redirect is not working.

Is this even possible with the jQuery post request? Is there alternative way? I am sending some information to the controller with the post request and want to redirect in the controller once the operations are finished.

Any guidance will be highly appreciated.


texts:
i have add a customer attribute Salesman (select type, admin will asign salesman to customer at backend from list), any customer will have asigned a salesman who is responsible for contact with this customer.

Problem is, when i'm trying to access this attribute, i only get option_id number.

app/code/local/Mage/Adminhtml/Block/Customer/Grid.php
-----
 $this->addColumn('salesman', array(
            'header'    => 'Salesman',
            'index'     => 'salesman'
        ));

returns number not a text value.

accessing this way:

$customerObj  = Mage::getModel('customer/entity_attribute ')->load($customer_id);
$attr = $customerObj->getAttributes('salesman');

returns the same number "option_id".

Is there any way to access value of this specific attribute?
I would not preffer to change all select attributes to return value :)

Can anyone help me with it?  All previous replies for similar questions, wasn't helpful.


texts: When do pictures of products get resized? How long do they stay there?

texts:
I've got pictures of some products in the folder:

media/catalog/product/cache/2/small_image/168x168/9df78eab33525d08d6e5fb8d27136e95

But actually not all of them.
That size would exactly fit for a site I try to generate (where I'd like to include product pictures).

How can I create images in that size in this folder of all products that I've got in the shop?

How have those been created that are already there?

And how long do the images stay there? Is it safe to link there from a product catalogue?


texts: How do I remove index/index from controller URL?

texts:
I have :

<?php
class Example_Module_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()

which I can call with http://www.example.com/module/index/index or http://www.example.com/module/ where index/index is inferred.

However I want to be able have different params in the URL and a short URL. Therefore I want to send anything that goes to http://www.example.com/module/ to my module and regard anything after 'module' as parameters.

Therefore rather than http://www.example.com/module/index/index/id/5 I want http://www.example.com/module/id/5

How can I achieve that?


texts: Unable to create menu in magento admin panel

texts:
I need to create menu in the magento admin panel. I am not able to create menu in my admin panel. Here below is my xml code. The following code contains the adminhtml part using which I need to create the menu. Please provide possible reasons for it is not working.

<adminhtml>
<acl>
    <resources>
        <all>
            <title>Allow Everything</title>
        </all>
        <admin>
            <children>
                <pincode translate="title" module="pincode">
                    <title>Pincode</title>
                    <sort_order>1000</sort_order>
                    <children>
                        <pincodebackend translate="title">
                            <title>Pincode Import</title>
                        </pincodebackend>
                        <pincode translate="title">
                            <title>Manage Pincode</title>
                            <sort_order>0</sort_order>
                        </pincode>
                    </children>
                </pincode>
            </children>
        </admin>
    </resources>
</acl>
<layout>
    <updates>
        <pincode>
            <file>pincode.xml</file>
        </pincode>
    </updates>
</layout>
</adminhtml>


texts: how to join Query for particular customer group and custom customer_entity_varchar attribute?

texts:
Here in my collection -> Table structure is :

1,id,                mydb,table_name,INT UNSIGNED,,10,3,0
2,userid,            mydb,table_name,INT UNSIGNED,,10,5,0
3,transctionid,      mydb,table_name,TEXT,,65535,15,0
4,requesttime,       mydb,table_name,TIMESTAMP,,19,19,0
5,creditamount,      mydb,table_name,SMALLINT,,5,4,0
6,creditedtime,      mydb,table_name,TIMESTAMP,,19,19,0
7,status,            mydb,table_name,SMALLINT UNSIGNED,,5,1,0

other_is_dummy_cm =  is customer attribute.

In This collection I need only customer group id = 9 and other_is_dummy_cm = 0  should be in table else not

So my collection is :

$collection = Mage::getModel('user/transaction')->getCollection()
    ->addFieldToFilter('status', array('eq' => 3));
$collection->getSelect()->joinLeft(array(
    'account'=> 'campusm_account'),
    'account.userid = main_table.userid',
    array('account.accountno', 'account.ifsc', 'account.bankaddress', 'account.bankname','account.pancard_no.')
);

$firstnameAttr = Mage::getModel('eav/entity_attribute')->loadByCode('1', 'firstname');
$lastnameAttr = Mage::getModel('eav/entity_attribute')->loadByCode('1', 'lastname');
// trying to put but getting error.
$dummyAttr = Mage::getModel('eav/entity_attribute')->loadByCode('1', 'other_is_dummy_cm');

$collection->getSelect()
    ->join(array(
        'ce1' => 'customer_entity_varchar'),
        'ce1.entity_id=main_table.userid', array('firstname' => 'value')
    )
    ->where('ce1.attribute_id='.$firstnameAttr->getAttributeId()) // Attribute code for firstname.
    ->join(array(
        'ce2' => 'customer_entity_varchar'),
        'ce2.entity_id=main_table.userid', array('lastname' => 'value')
    )
    ->where('ce2.attribute_id='.$lastnameAttr->getAttributeId()) // Attribute code for lastname.
    ->columns(new Zend_Db_Expr("CONCAT(`ce1`.`value`, ' ',`ce2`.`value`) AS fullname"));


texts: How to add visitor count in magento admin page?

texts: I want to add visitors count in magento admin page. Please anyone help me how to do?


texts: Magento2 Quote Table to Order items table?

texts:
How Magento Copies data from Quote table to Sales order items?
If I want to save one field from Quote to Sales order items , Which files I need to change?


texts: loadLayout() how can I find the according template?

texts:
If I do see this function in my controller - how does Magento knows which layout (and templates) it needs to load/show?

public function upsellAction()
{
    $this->loadLayout();
    $this->renderLayout();
}


texts: Magento2: Product created from front-end is not adding to cart,it results "We can't add this item to your shopping cart right now."

texts:
However the sample products are adding in cart,this is problem with products that has been added programmatically. Below is the code I am using to create the product programmatically.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $product = $objectManager->create('\Magento\Catalog\Model\Product');
        $product->setSku($productData['sku']);
        $product->setAttributeSetId(9);
        $product->setCreatedAt(strtotime('now'));
        $product->setName($productData['productname']);
        $product->setWebsiteIds(array(1));
        $product->setDescription($productData['productdesc']);
        $product->setShortDescription($productData['short_description']);
        $product->setAttributeSetId(4);
        $product->setStatus(1);
        $product->setWeight($productData['productweight']);
        $product->setVisibility(4);
        $product->setTaxClassId($productData['tax_class_id']);
        $product->setTypeId('simple');
        $product->setPrice($productData['price']);
        $product->setSpecialPrice($productData['special_price']);
        $product->setSellerId($productData['sellerId']);
        $product->setCategoryIds($productData['categories']);
        $product->setStockData(
                    array(
                        'use_config_manage_stock' => 0,
                        'manage_stock' => 1,
                        'is_in_stock' => $isInStock,
                        'qty' => $quantity
                    )
                );

        $product->save();   </i>


texts: Magento 2- Admin Reorder of Gift card order with custom giftcard amount not working after cancelling the order

texts:
Customer ordered a Gift card with custom amount(custom_giftcard_amount).Admin canceled  that order and then trying to Reorder from backend.  But it is not working.Getting this error "Please specify a gift card amount."
The Scenario is working for fixed amount(giftcard_amount)
Note
I found the issue. After admin canceled  the order, I checked  the product_options column of sales_order_item tables. giftcard_amount and custom_giftcard_amount field is not there for custom amount order items.  Anybody have an idea about this?


texts: Show Empty Categories on Catalog Page - Magento 2

texts:
I want to show all categories, even if they have no products in them.

How can I achieve something like this?


texts:
I create a module for Magento 2 to add a custom javascript to the theme head but my custom js file is loaded in front off all javascript files and this come with the error:

ReferenceError: jQuery is not defined

I add my file here:

app/code/MyModule/Customjs/view/frontend/web/js/custom.js

I create requirejs-config.js file here

app/code/MyModule/Customjs/view/frontend/

var config = {
    map: {
        '*': {
            custom: 'MyModule/Customjs/js/custom'
        }
    }
};

I add app/code/MyModule/Customjs/view/frontend/layout/default.xml

<?xml version="1.0"?>
<page xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <head>
        <script src="MyModule/Customjs::js/custom.js"/>
   </head>
</page>

What is wrong?

Thank you


texts: catalog grid custom filter function is too specific

texts:
To my catalog grid ive added an extra column, which contains an attribute value, better said a color value.

Now I added a filter function with a dropdown.

This one looks like this:

protected function _colorFilter($collection, $column) {
    if (!$value = $column->getFilter()->getValue()) {
        return $this;
    }
    $field = $column->getFilterIndex() ? $column->getFilterIndex() : $column->getIndex();
    $cond = $column->getFilter()->getCondition();
    $this->getCollection()->addFieldToFilter($field, $cond["eq"]);
    return $this;
}

This works great, except it filters just for the values which are excactly the ones selected. That means: some fields have the value 140, some 76 and some 33.

When I select the value for 76, it gives me all the products wich have the attribute-/color-value 76. But what I want, are all the products wich have the value 76, 76,140, 76,33, 76,140,33.

I cannot find any way to perform this. Is this even possible with the function addFieldToFilter() ?


texts: How to retrieve the final shipping amount of table rate in code?

texts: I want to show to the customer the final tax rate amount that he will pay based on my tablerates.csv which contains my rules. Is there any function which i can call to obtain this value before final step? Maybe a controller or model.


texts: Recurring profiles in magento - Maximum billing cycle

texts:
I am creating a subscription based product. But i am confused how to set it.

I need the subscription to be valid for 120 days (4months), so the user must be charged once every 120 days (4 months), in example, 10th January, then renew at 10th May, then at 10th September, etc. and go on until he/she cancels (it never ends until the user choose to cancel)

I think the “Maximum Billing Cicles” defines when it will stop (in example for monthly subscription, a 3 here: then it will be cancelled automatically after 3 months. I think, but not sure!). I want the subscriptions to renew infinite times, till the user cancels, so what may I write here? Nothing?

Billing Period Unit: Day? Month?

Billing Frequency: 120? 4?

Maximum Billing Cycle : (Nothing?)

Someone help me out. Thanks in advance.


texts:
I have this error when I try to click on a product in admin:

2016-08-29T10:37:38+00:00 ERR (3): Warning: include(Mage/Productslider/Model/Source/Feature.php): failed to open stream: No such file or directory  in /home/blueb/public_html/lib/Varien/Autoload.php on line 94
2016-08-29T10:37:38+00:00 ERR (3): Warning: include(): Failed opening 'Mage/Productslider/Model/Source/Feature.php' for inclusion (include_path='/home/blueb/public_html/app/code/local:/home/blueb/public_html/app/code/community:/home/blueb/public_html/app/code/core:/home/blueb/public_html/lib:.:/opt/alt/php55/usr/share/pear:/opt/alt/php55/usr/share/php')  in /home/blueb/public_html/lib/Varien/Autoload.php on line 94

I think I have made no changes. I didn't install any new extension. Yesterday I have edited products with no error and today the error is there.

Thanks for some help.


texts:
It seems that Magento 2, with the default theme, has a JS object window.checkoutConfig which has all the cart information, and is updated when you change the cart.

Is it safe to assume this will be available on all (or most) stores?

If it is not available on a specific store, is there a simple way to get this data otherwise?


texts: Change the display of attributes when the customer changes the product configuration

texts:
I will try to be as clear as possible.
On the configurables products pages, when the customer chooses his product configuration, the price display changes according to the price of the configuration.

So far, everything is normal.

However, I will use the SKU as an example.

When changing the configuration, the SKU display does not change.  It always displays the SKU of the configurable product, not the SKU of the declination or configuration.

How can Magento make this change?
Which file manages this update of data to be displayed?

Thank you in advance!

Florian

Magento Version : 2.3.1 CE

EDIT : I don't know why, but Stackexchange refuse my "Hello all," at the beginning of my post. Sorry for that.


texts: Extensions for Adding Affiliate Javascript/Image-tracking to the Order Success Page

texts:
Are there any third party (open source or commercial) extensions that enable an better UI and/or a template interface for adding affiliate tracking code to the order success page?

That is, it's relatively easy for a PHP developer to gin up some code to add a block to Magento's order success page that will query the system for order information and generate specific javascript or <img tag based affiliate tracking code.

What I'm looking for is an extension that would allow a less technical user to accomplish the same task, either via a GUI or a template language that exposes the order variables in a flat, consistant way.

(I know how to approach building something like this — I want to know if something already exists that's relatively mature and stable)


texts: Case sensitive search magento 2 Grid UI component

texts: I created Magento 2 Grid with UI component and it works with all of the things (filters, columns, sorting ) but I want to search with Case sensitive(as of now it works with searching but by default is not case sensitive. For example ABCDEF and ABCdef both are different). So is there any way to search with case sensitive in UI component?


texts: How to add attribute in magento 2 with custom design?

texts:
I want to add something like this in my product page.

for that I have created group(electrical, UL and iec) in one attribute set. but I don't know how to add like this.I have created attributes rated voltage, rated current etc.


texts: Magento Connect shutting down on Sept 15, will Magento Connect Manager work?

texts:
I've noticed that Magento Connect (https://www.magentocommerce.com/magento-connect/) is moving to Magento Marketplace (https://marketplace.magento.com/).

Are we still will be able to Update already installed extensions via Magento Connect Manager if magentoconnect.com website will be shut down after Sept 15 ?


texts: Magento 2: Filter order collection on "created_at" attribute

texts:
I want to filter order collection using 'created_at' attribute but the problem is, values stored in 'created_at' attribute is in this format 2014-03-18 06:57:11 (Combination of date and time) and I want to apply filter with only this format 2014-03-18(Date without time).

Please suggest me some solution.


texts:
I have this code to join status to the order item collection:

    $orderItems = $this->orderItemCollection->addFieldToSelect(
        array('item_id','order_id', 'created_at', 'updated_at','product_id','sku','name')
    );

    $orderItems->getSelect()->join('sales_order','order_id = entity_id','status');

    $data = $orderItems->getData();

It works fine but I want to make sure all order items are returned regardless of whether or not there is a status so I tried:

    $orderItems = $this->orderItemCollection->addFieldToSelect(
        array('item_id','order_id', 'created_at', 'updated_at','product_id','sku','name')
    );

    $orderItems->getSelect()->joinLeft('sales_order','order_id = entity_id','status');

    $data = $orderItems->getData();

This doesn't work for some reason.  In my debugger after that line is hit execution just stops and a white page is returned.

Is there a different way I should be doing left join?

edit:

The last method that is called before execution stops is \vendor\magento\framework\App\ErrorHandler.php handler() method.
Seems like something happens that stops it reporting the error


texts: Ultimo theme abandoned updating after magento 2.3.1?

texts:
In reply to another question on StackExchange I read the following comment:

"Ultimo theme and the developer has abandoned updating after Magento 2.3.1"

Does anyone know if this is true as I am currently using Ultimo and plan to use it in future Magento releases.


texts: Get product collection filter by if attribute exists?

texts:
Goal: Retrieve a collection of products that have a certain attribute

Here's what I'm trying:

public function Hydrate($attribute)
{
    $this->id = Mage::helper('myHelper')->CamelCase($attribute->getFrontendLabel());
    $this->name = $attribute->getFrontendLabel();

    $products = Mage::getModel('catalog/product')
        ->getCollection()
        ->addAttributeToSelect('*')
        ->addFieldToFilter($attribute->getAttributeCode(),array('like' => '%%'))
        ->load();

    foreach ($products as $product)
    {
        array_push($this->collection,Mage::getModel('myModels/Json_Product')->Hydrate($product));
    }

    return Mage::helper('myHelper')->ConvertToJson($this);
}

It's working.  However, I was just wondering if that addFieldToFilter() is going to have any repercussions that I can't currently see?

Magento 1.9.x


texts:
I've done some orders through Magento however I want to remove them now from Sales page to clean it up. I need to remove only test orders, there are also some real order which I don't wish to remove.

What approach shall I take?

Thanks


texts: Magento 2: How can I get de locale code?

texts:
How can i get de locale code in the current shop?

For example es-ES or en-EN.

I tried

$this->_storeManager->getStore()->getLocaleCode();


texts:
I hope you are doing good. My problem is that when I'm creating bundle product on luma theme product's first option is not select-able other than on my custom theme product's options are select-able but qty is not increasing.

any idea how can I fix it?


texts:
I need to create a rule that states:
Buy 1 product sku at full price and get 2 product skus for fixed discounted amounts.


texts: Base Price Same as Custom Option Price On Product Listing on every page

texts:
I want, the price on the product listing should be same as the default price of custom option.

In current scenario the product details price shows Price = Base Price + Custom Option Price.I don't have any base price so to show the price i keep base price as "0". Now if i keep base price "0", product listing price gives me "0" as price.

1) One approach >> custom attribute on product listing...How ?

2) Second approach >> remove addition of base price & custom price....How ?

In either of these or any other solutions, how can i deal with discounts.???

Please spare some thought on this issue. Let me know what can i do. I hope will get an answer this time.

Regards


texts: How to change the URL of a non cms page?

texts: I need to customize the URLs for my site and would like to know how to change them. With CMS pages its very straightforward but I would like to know how to do it with a non cms page. Thank you


texts: Magento 2.3 | How to switch off the new inventory system | Issue with products going out of stock

texts:
With the upgrade to Magento ver. 2.3.3, there are some major changes to the inventory system which are great, however, I use an external ERP system to manage my stock levels are they are causing issues with products becoming out of stock.

I have a big issue with the "Reservations" and "Salable Quantity" features. As I use an external system to manage my stock, they become redundant to me and I would like to disable them (unless you provide me with a more effective solution).

My issue looks as follows:

I have 2 products of SKU-A
Customer buys 1 product SKU-A
The stock for SKU-A is Stock=2 | Salable Quantity = 1 (1 reserved)
My ERP system sends a stock update (There is only 1 item of SKU-A as a customer just purchased one.)
The stock for SKU-A is now Stock=1 | Salable Quantity=0 (1 reserved)
Item is out-of-stock

Can anyone think of a good solution to the above problem?


texts: Example: FPC lifetime is 1 day but a page contains a block with a lifetime of 1 hour. How will that be handled? Will the page be served from the cache after the hour?


texts:
I am not very familiar with JQuery but am attempting to run this piece of code in html that requires JQuery.

Lorem Ipsum

    Lorem ipsum

   Lorem ipsum

   Lorem ipsum

This code requires JQuery 3.3.1 which conflicts with the built-in JQuery that Magento 2 has. If I include Jquery 3.3.1 in the head then my product page stops working. Any ideas?


texts: Code To a custom tab in my account customer section in magento 2.1

texts:
I need a code to add a custom tab in the magento 2.1 customer account .
Please provide complete code for that

thanks


texts: How can I Remove Shipping Method in Magento 2.3?

texts:
I want to remove Shipping method table, please check the screenshot below. Link to the  Website
When you are going through the checkout process, then you can see this option.


texts: Magento goes first the HTTP then redirects to HTTPS

texts:
How can I make magento store go directly to HTTPS to save me 0.3-0.5 second of initial page load time going to HTTP then going back to HTTPS?

I am completely lost here.


texts: Show Shipping cost in checkout page not in cart page

texts:
I am using Magento 1.9.3.2.

I need customization like, Shipping cost should not show in the Cart page, but shown in the Checkout page.

Is possible to make like Shipping cost should be calculated only in checkout page, not in the Cart page even user logged in.


texts: How to add tax amount in old orders in Magento-2.1?

texts: I have some orders is placed, when tax rule is not build. After some times, I will create tax rule. Now all orders is placed with tax rules. But I want to add tax rule in old orders. How can I do this in Magento-2.1 ? Please guide me.


texts: From my website some one sending an email to one email address continuously one after another

texts:
From my website some one is sending an email to one email address continuously one after another. I cant find where it is sending from , I use the SMTPPro extension to send emails.

The email contents are some advertisements i t also  will change continuously.

I have attached a screenshot of the email below.

the Reply-To address always changes but the from address is the same (the Magento general contact address)


texts: How to integrate the reward point in magento 2 environment?

texts: I have enable the reward points in stores-> Configuration-> customers-> Rewards section to enable the module. Based on the below screenshot i have implement the reward point. But I cant unable to get the reward point section in checkout page.enter image description here


texts: Add CSS class to menu if the customer is logged in magento 2

texts: I asked a question about adding different class if customer is logged in or not logged : Add CSS class to body if the customer is logged in magento 2 the problem is that i need more explanation to try the solution of pawan so can you please help me and thanks in advance


texts:
I have a top menu of subcategories of Default category. Every subcategory has its own subcategories.

For example, i have now a top menu with books, music, e-books, ... and books have its own categories romance, nonfiction, poetry,... .

I would like when i hover books to have a dropdown with romance, nonfiction and so on.

Does magento have this feature ? if not, how can i accomplish this ?

Thank you in advance.


texts: Magento2: understanding ui_component xml tags

texts:
In Magento 2 ui_component xml files are used to show grid/forms in admin. The model collection which  will be used by the grid will be configured in di.xml as mentioned here

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

Now in the ui_component xml file arguments will be mentioned as below

<argument name="data" xsi:type="array">
    <item name="js_config" xsi:type="array">
        <item name="provider" xsi:type="string">sample_demolist_listing.sample_demolist_listing_data_source</item>
        <item name="deps" xsi:type="string">sample_demolist_listing.sample_demolist_listing_data_source</item>
    </item>
 <item name="spinner" xsi:type="string">sample_demolist_columns</item>
    <item name="buttons" xsi:type="array">
        <item name="add" xsi:type="array">
            <item name="name" xsi:type="string">add</item>
            <item name="label" xsi:type="string" translate="true">Add New Item</item>
            <item name="class" xsi:type="string">primary</item>
            <item name="url" xsi:type="string">*/*/new</item>
        </item>
    </item>
</argument>

1. What does <argument name="data" xsi:type="array"> do?
2. What is the usages of tags js_config, provider, deps, spinner, class, url ?  If I can get some reference links/tutorials which explains all these tags will be much more helpful.


texts: How to copy product information to meta information in Magento 1.9.2

texts:
How it is possible to copy all the characteristics below massively?

title -> meta title
title -> meta keywords
description -> meta description


texts: Magento 2: difference between Api\SearchCriteriaBuilder and Api\Search\SearchCriteriaBuilder?

texts:
Those two classes are very similar but I don't get the differences and why should one be used instead of another ?

Magento\Framework\Api\Search\SearchCriteriaBuilder => a handful of references in the Magento native code.
Magento\Framework\Api\SearchCriteriaBuilder => 200+ references

To me, there must be a good reason why the first one has been created but I don't get why.

Anyone can enlight me ?


texts: Custom Module's template override not loading initially unless the page is refreshed

texts:
I have the below template override in a custom module, the file path is:

app/code/Vendor/Module/view/adminhtml/layout/sales_order_create_index.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="data">
            <action method="setTemplate">
                <argument name="template" xsi:type="string"> Vendor_Module::order/create/data.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

This override makes a few changes to the admin page for the creation of an order, when i go through the add order process it initially asks to select or add a customer. once this is done it loads the order page I'm overriding by AJAX, during which it loads the default one found at vendor/magento/module-sales/view/adminhtml/templates/order/create/data.phtml instead. When I refresh the page, ie with no AJAX being used to load it; it loads fine. I've tried different override methods; clearing caches and different modes (default, development, production).

I also manually installed this plugin https://mageside.com/custom-shipping-price-2.html which seems to have the same issue if that helps.

Where am I going wrong?


texts:
Source model "buyer/product_attribute_source_buyer" not found for attribute "buyer_name"

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

Buyer.php

<?php
class Limex_Buyer_Model_Product_Attribute_Source_Buyer extends Mage_Eav_Model_Entity_Attribute_Source_Abstract
{
    public function getAllOptions()
    {
        if (!$this->_options) {
            $this->_options = array(
                array(
                    'value' => '',
                    'label' => '',
                ),
                array(
                    'value' => '1',
                    'label' => 'Day',
                ),
                array(
                    'value' => '2',
                    'label' => 'Week',
                ),
                array(
                    'value' => '3',
                    'label' => 'Month',
                ),
                array(
                    'value' => '4',
                    'label' => 'Year',
                )
            );
        }
        return $this->_options;
    }
}
?>

config.xml

<?xml version="1.0"?>
<config>
<modules>
    <Limex_Buyer>
        <version>0.1.0</version>
    </Limex_Buyer>
</modules>
<global>
    <blocks>
        <buyer>
            <class>Limex_Buyer_Block</class>
        </buyer>
    </blocks>
    <helpers>
        <buyer>
            <class>Limex_Buyer_Helper</class>
        </buyer>
    </helpers>
    <models>
        <buyer>
            <class>Limex_Buyer_Model</class>
        </buyer>
    </models>
    <resources>
        <buyer_setup>
            <setup>
                <module>Limex_Buyer</module>
                <class>Mage_Eav_Model_Entity_Setup</class>
            </setup>
        </buyer_setup>
    </resources>

</global>


texts: Magento 2 : Need to set custom category collection using plugin

texts:
I want to set custom category collection using the plugin.

I created plugin about Magento\Catalog\Block\Product\ProductList\Toolbar this block and aroundSetCollection(). But, not actual output I received.

How to set custom collection using this plugin or is there any other way for that?


texts: How to remove or delete an Attribute from the Default Template (Attribute Set)

texts:
There is an attribute in the "Default" Stores > Attribute Set/Product Template that somehow got there my mistake during my learning and setup of Magento.
How can I remove or delete a certain Attribute from the Attribute Set?

See screenshot (click to enlarge)


texts: Can we create database view using schema?

texts:
Can we create a database view using schema?

if yes then, Is there any Magento 2 standard way to creating a view in the database?


texts: Custom Convert Quote to Order - "Cannot retrieve payment method instance"

texts:
I have seen on occasion the case where an order is placed, an authorization is made for payment on the customer card, the customer receives an order confirmation email - but no order exists in Magento's sales_flat_order or sales_flat_order_grid.

The weapon of choice here is to require admin to void the payment in the gateway, ask customer to re-place.

However, we have all quote, quote items, quote payment, quote address. In theory this order is valid, after all, we have authorization and the customer has an order email. The error happened sometime after the order email generation that caused a rollback (the current working theory).

I have created a test one-off script to convert this quote using a sandbox gateway . However, I'm having trouble at generating the payment. I've tried to use checkmo, free, authorizenet, all return the same exception:

PHP Fatal error:  Uncaught exception 'Mage_Core_Exception' with message 'Cannot retrieve payment method instance.' in /var/www/vhosts/magento/app/Mage.php:563
Stack trace:
#0 /var/www/vhosts/magento/app/code/core/Mage/Payment/Model/Info.php(83): Mage::throwException('Cannot retrieve...')

See my code below. Feedback welcomed.

<?php
//.... stuff

$quote = Mage::getModel('sales/quote')->load(745);

$convert = Mage::getModel('sales/convert_quote');

$order = $convert->toOrder($quote);
$order->addressToOrder($quote->getAddress(),$order);

foreach($quote->getAllItems() as $item){
    $orderItem = $convert->itemToOrderItem($item);
    if ($item->getParentItem()) {
       $orderItem->setParentItem($order->getItemByQuoteItemId($item->getParentItem()->getId()));
    }
    $order->addItem($orderItem);
}

$data = array(
        'method' => 'authorizenet',
        'cc_type' => 'VI',
        'cc_number' => '4111111111111111',
        'cc_exp_month' => '1',
        'cc_exp_year' => (date('Y') + 6),
        'cc_cid' => '444'
);

$quote->getShippingAddress()->setPaymentMethod('authorizenet');
$quote->getShippingAddress()->setCollectShippingRates(true);

$payment = $quote->getPayment();
$payment->importData($data);
$quote->save();

$payment = $convert->paymentToOrderPayment($quote->getPayment());

$order->setPayment($quote->getPayment());

$message = '[Notice] - Order converted from quote manually';
$order->addStatusToHistory($order->getStatus(), $message);
$order->place();
$order->save();

$quote->setIsActive(false)->save();


texts: Get account type ID before it is changed in admin panel

texts:
Having some trouble here. What I'm hoping to accomplish is the following:

Prior to making a change to a customer's account group through the admin panel, I'd like to get their account group ID. This value will serve as the previousAccountGroupID.

After save, I'd like to again pull the account group ID to serve as the postAccountGroupID.

I'd like to be able to compare these values to see if the account group has changed, as well as specific cases related to changing from a certain account group to another certain account group. However, we'll ignore that for now as it's irrelevant within the scope of this question.

My issue is this: I'm having trouble getting the account group ID prior to that save. I've written an observer which looks for various events, but it seems that no matter what event I try to observe, it always gives me the NEW account group ID. I can't seem to get the previous account group ID.

Here are the events I've tried observing:

adminhtml_customer_prepare_save
customer_save_after
customer_address_save_after

When observing any of these events, the customer group ID is already set (at least within the model) to what it is being updated to. Here's a code sample of one of those events (the one that seems most logical to me) as well as the output:

Excerpt from: testmodule/etc/config.xml

<adminhtml>
    <events>
        <adminhtml_customer_prepare_save>
            <observers>
                <testmodule_save_customer_attributes>
                    <type>singleton</type>
                    <class>testmodule/adminhtml_observer</class>
                    <method>saveCustomerAttributes</method>
                </testmodule_save_customer_attributes>
            </observers>
        </adminhtml_customer_prepare_save>
    </events>
</adminhtml>

Excerpt from: testmodule/Model/Adminhtml/Observer.php

public function saveCustomerAttributes($observer = null)
{

    $_customer = $observer->getCustomer();
    Mage::log('in here! ' . $_customer->getGroupId(), null, 'test.log');

}

What is written to my log is always the ID of the group which I am changing the account to. It is never what it was previously set to before the modification. My presumption is simply that this is not the correct event to observe. However, like I said I have tried a number of different events and none have given me the results I want.

Hopefully that's enough to go on. Please let me know if I can clarify anything. Until then, I'll be here scratching my head :/


texts: What is the file path for mydomain.com/shop/checkout/cart/couponPost?

texts: The application is posting a coupon from the site to this path and getting a 503. I do not know where this folder is in the application so I can troubleshoot. Can someone please advise? Thank you.


texts: Is the Magento platform HIPAA compliant? We want to use it for a healthcare eCommerce platform.


texts: Magento 2 Get order total on success page?

texts:
I'm trying to get the order total on the success page on magento 2 , I have added this code

<?php
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
$totall = $order->getGrandTotal();
?>

But I'm getting an error when I reach the success page after I place an order, I guess the code works for magento 1 but not 2.
How can I get this working also on magento 2?


texts: Magento 2 Remove sku initials from url_rewrite table

texts:
i have url_rewrite table in my magento 2.1 setup in which i have url structure like this

www.exaple.com/name-of-product.html

which is desirable , but many product have the url structure like this

www.exaple.com/name-of-product-sku-2054.html so at the end they contain product sku which is sku-2054

i need to remove all such occurrence from the database where the url is like  www.exaple.com/name-of-product-sku-2054.html and what to change them to www.exaple.com/name-of-product.html

i went through url_rewrite which i believe contains these urls and found out that there are around 68k entries that would be needed to change .

can anyone suggest how can i do that without getting into the problem with duplicate urls also  will it cause any harm if i do this by replacing the values from the column request_path from table url_rewrite . Do i need to change data from other tables also?


texts: Changing the collection in observer in Magento 1 issue

texts:
I added a new column to my sales order grid and it works perfectly. If I go the the recent orders grid from the customer view it doesn't work . I got an error message:
Column not found: 1054 Unknown column 'c.increment_id' in 'field list'.

This is how I added the new column to my sales order grid:

public function beforeBlockToHtml(Varien_Event_Observer $observer)
    {
        $grid = $observer->getBlock();
        /**
         * Mage_Adminhtml_Block_Sales_Order_Grid
         */
        if ($grid instanceof Mage_Adminhtml_Block_Sales_Order_Grid) {
            $grid->addColumnAfter(
                'customer_increment_id',
                [
                    'header' => Mage::helper('ffm_codebin')->__('Customer Inc.'),
                    'index'  => 'customer_increment_id',
                    'filter_index' => 'c.increment_id'
                ],
                'entity_id'
            );
        }
    }
public function beforeCollectionLoad(Varien_Event_Observer $observer)
    {
        $collection = $observer->getCollection();
        if(!isset($collection)){
            return;
        }
        if($collection instanceof Mage_Sales_Model_Resource_Order_Grid_Collection){

            $collection->getSelect()->join(['c' => $collection->getTable('customer/entity')]
                ,'main_table.customer_id = c.entity_id', ['customer_increment_id' => 'increment_id']
            );
        }
    }

These are the events which I used: core_block_abstract_to_html_before and core_collection_abstract_load_before. Please note that I do not want to add a new column for the recent orders grid just for the sales order grid. What should I change in my code ?

Thx


texts:
this may sound silly. But in the backend we have timezone set under configuration/general = W.Europe/Berlin. This is the same timezone as Amsterdam. Amsterdam is where our webstore is located. When I post a blog or update it is timestamped with x.y.z time @ W.Europe/Berlin ....  would like it to be W.Europe/Amsterdam.

Could I just look the string up in core config or another table and change it there? Or would I be breaking a lot of stuff? (I can image time is in the very core of a system)

Or can I add a timezone?

Many thanks


texts: How to add a custom block in Magento 2 System Configuration Group?

texts:
I am trying to add a text block in Magento 2 system configuration group.
I want to write some hints for the users in a separate group. As it can be done in Magento 1.

Here is my screenshot what I actually want.

Still, I am waiting for any response. Is there anyone who has done this before in Magento 2?
Please let me know about this.

Thanks in Advance.


texts:
So I want to have a multi store view.

UK/Europe - Inclusive of 20% vat tax
International - Exclude 20% vat tax.

I have an Amasty geoip also installed so maybe I can use that for the auto detect? but I want the option to manually override

i.e if the user is in the USA but wants to view the UK store they can. Id like to also have certain shipping rules for the selected countries and also show country icons and I can accept £,$ and EUR in terms of checkout so this must have a switcher.

How can I set up this switch? and will it save the basket?

for example, this site has it: https://goo.gl/hU79Rw


texts:
How do I add an attribute + it's sortorder (position) to the product list collection?

In the catalog category list we use 1 text attribute (brand) and 1 list attribute (size) .... for every product we have to use getAttribute() and getAttributetext() ....

BUt: how can I

add the brand attribute to the list collection?
add the size attribute + it's position (sort order) to the list collection?

Can this easily be added to the query? or how do I do this?

thanks!


texts: Elasticsearch Limit of total fields [9165] in index [product_1_v2] has been exceeded

texts:
We face the following issue on our Magento 2.4 store with Elasticsearch 7 and more than 7000 attributes:
Catalog Search indexer process unknown error:
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Limit of total fields [9165] in index [product_1_v2] has been exceeded"}],"type":"illegal_argument_exception","reason":"Limit of total fields [9165] in index [product_1_v2] has been exceeded"},"status":400}

How can we solve this or limit the total fields of index product_1_v2? Or does anyone know what create these fields in index [product_1_v2], so that we can check if we can reduce them.
I guess it is caused by a specific product or attribute. Is there a way to create some sort of logging, to log the specific product or attribute that is creating this error?
See also: https://github.com/magento/magento2/issues/28454
Is there a way to create a script or log, that shows all products that exceed these total files of 9169?
EDIT:
Seems that Magento has created a patch for the Cloud and Commerce version;
https://support.magento.com/hc/en-us/articles/360050423891-MDVA-30284-Magento-Patch-Elasticsearch-7-Limit-of-total-fields-XXXXX-in-index-has-been-exceeded
That solved the issue.


texts: How to get all simple product's quantity and SKU with SQL Query

texts:
I just don't know how to get all simple product's stock and SKU information with SQL Query. I just need to get something like this

SKU       Quantity   Stock Status
---       --------   ------------
454645       50           1
545878       15           1

Any help please.


texts:
Today, I have reviewed the the catalog-rule modules and found the a method named loadPost on controller during save. I don't know how it works but it saved  the rule data in serialized form in database. Before save, it converts the actions or conditions array data into serialized form.

Can anyone explain in brief that What is use of this method and why does magento use this method ?

Thanks in advance.


texts: How to create custom header in magento 1.9

texts:
I want to create the custom header in Magento 1.9. I attached the screenshot of the header like this

I  have tried the following code.
 I have created the static block and static block calling in the header.phtml file

     <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('custom_block_id')->toHtml() ?>

but this code is not working .please suggest me

I have added this original header not working. Menu and logo not displaying.

     <!--- custom header---->
  <reference name="header">
      <block type="page/header" name="header">
         <action method="setTemplate"><template>page/html/customheader.phtml</template></action>
     </block>
 </reference>
        <!--- original header---->
         <reference name="header">
        <!-- Search box wrapper -->
        <block type="page/html_header" name="search_wrapper" template="page/html/search_wrapper.phtml">
            <action method="insert">
                <block>top.search</block>
            </action>
        </block>


texts: Export Custom options in Magento 2.1.4 CE

texts:
I am working on my own store locally in wamp64 and windows 7 os.
Is there an extension or method available so I could place the custom options e.g. Door size, for export-import, in there own column in a spreadsheet for editing?
thanks in advance