texts: Problems flushing Magento Redis Cache on an installation with a separate backend server

texts:
My problem is that I do not think I am able to refresh the magento redis cache from the admin page. I realize that the problem could come from many sources, but my gut tells me it has something to do with the backend being on a separate server. My magento installation is as follows:

Backend server and NFS(media) on an Amazon AWS EC2 at http://admin.example.com
Database on AWS RDS MySQL 2 app servers (scalable to more) on AWS Elastic Beanstalk at http://www.example.com (route53)
regular backend cache(database 0), Lesti-FPC(database 0), and redis_session (database 1) on AWS elasticache redis

I originally had my Lesti-FPC configured to use database 2 on the redis cache. I thought it worked pretty well as far as I could tell, until I realized that I couldn't flush the cache at all from the admin System>Cache Management page. "Flush Magento Cache," "Flush Cache Storage," "disable", and "refresh" did nothing. I could only flush it by rebooting the redis node or going in with redis-cli and using redis commands.

I then tried configuring Lesti-FPC to use database 0 as described above. It worked better. Now, I could flush the FPC with "Flush Cache Storage," although the other options still didn't work. At the time, I assumed it was an issue specifically with Lesti-FPC. But anyway, using "Flush Cache Storage" was good enough for me at the time, especially once I discovered that I could flush the cache through code using

Mage::app()->getCacheInstance()->flush();

I just recently found out that the problem may not be specific to Lesti-FPC. While trying to fix the Lesti issue, I tried monitoring redis. I know nothing about redis or caching, but when I would try to refresh the FPC, I would see commands like:

“del” “zc:ti:403_FPC”
“srem” “zc:tags” “403_FPC”

But those tags never existed. Doing:

keys *FPC*

in redis would give me

“zc:ti:109_FPC”

but nothing with 403. SO this means that my fpc caches do not get invalidated like they're supposed to after product/category changes and reindexing. I got around this by manually flushing the cache after changes and running cron jobs to flush and prime the fpc every few hours.

But it made me suspicious. I tried refreshing the other caches from the admin, and I found that magento would always try to delete and read the 403 keys(some of which existed and some of which did not) but never any 109 keys (of which there are many).

My guess is that the 403 keys are specific to the admin server, and the 109 keys are specific to the app servers. The admin server, maybe because it is on a different subdomain, is not touching the app servers' cached stuff. But the app servers are able to find its own keys fine, as demonstrated by the fact that the FPC is working very well.

Does this make sense? Is there something I could do to fix this? Did I configure something incorrectly or is this a magento bug?


texts: Use attribute name in layered navigation css class

texts:
In my layered navigation I want to be able to theme the content for each attribute differently. I have done this by creating my own version of app\design\frontend\base\default\template\catalog\layer\view.phtml and adding a class with the attribute name (which I can then target with css) by modifying this line from

<?php echo $_filter->getHtml() ?>

to

<dd class="<?php echo $this->__($_filter->attribute_model->attribute_code) ?>"><?php echo $_filter->getHtml() ?>

This works fine but I noticed I was getting the following error in my log at this line:

ERR (3): Notice: Trying to get property of non-object  in app/design/frontend/mytheme/default/template/catalog/layer/view.phtml on line 53

Fortunately, it's invisible on the front end and I'd like to eliminate it.

It dawned on me that this happens when the layered navigation is in a category tree and so there are no active attributes. I have tried to test if an attribute exists using the likes of is_object but nothing's worked and it's exhausted my admittedly limited PHP skills.

Can anyone suggest a way that works?


texts: Not able to set status Enabled for duplicated products in magento 2

texts:
I created a new simple product in newly installed Magento 2.0.7. The product is being shown in frontend.

When I tried to duplicate product, it was disabled by default (default behaviour of duplicate products in magento).

I tried to enable it from:

- Editing product individually. (There is an option in edit product section, which toggles Product offline/online)

- From mass action (Change Status option)

In both cases, magento is showing product as disabled.

Note: When I am creating new product, I am able to enable it.

Note: I have also checked for the same in Magento 2.0.8 also. Issue is same in this version also.

Please help me to solve this issue.


texts: how to find sample data customer username password - magento 1.9.2.4

texts:
I completed migration from Magento 1.9.2.4 to Magento 2.1.6. I'm just migrating the sample data of magento 1.9.2.4 (I don't create any customer by myself). I'm testing their functionality.

We have seen customer data in Magento 1.9.2.4

Admin->Customer->Manage Customer

I need to know the one customer username and password to login in magento 2.1.6 for checking customer data correctly migrated.

After migration I found in customer_entity table

email : jack@example.com
password_hash : 4fe96cf8b888c1f20e1726450896940a2cea453128c51fa07539536a4205e12b:t6:1

how to decrypt password_hash


texts: best api approach for magento interaction in android native app

texts:
I am working on android app which is linked with magento website.I tried to to use soap api for fetching data into android app but this api is too much slow as expecting.
So, How to interact with magento website for fetching data in android app any best approach.
Can I use the various magento model functions and fetch data from it.
Please let me know asap.


texts:
I have had an affiliate extension that allows my store to accept affiliate feeds.

I wish to change the Add to Bag text on the category page to open a window that then redirects to the products on the partnered site.

The code for the category page is: -

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

                            <a title="<?php echo $this->__('Add to Bag') ?>" href="<?php echo $this->getAddToCartUrl($_product) ?>"><?php echo $this->__('ADD TO BAG') ?>

                            <a title="<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('MORE INFO') ?>

                    <?php else: ?>

<?php echo $this->__('OUT OF STOCK') ?>

                    <?php endif; ?>

The code for addtocart (which is what I want for the category page) is: -

<?php $flag = $_product->getIsAffiliateProduct() ; ?>
<?php if ($flag ): ?>

<?php $advertiserBuyURL = $_product->getAdvertiserBuyLink(); ?>
    <?php $buttonTitle = $this->__('Buy on Store'); ?>
    <button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="redirectTo('<?php echo Mage::getBaseUrl().'/redirectTo.php?goto='.urlencode($advertiserBuyURL); ?>','<?php print $_product->getAdvertiserID(); ?>')" >
        <?php echo $buttonTitle ?>
    </button>
    <?php echo $this->getChildHtml('', true, true) ?>
    <?php if($_product->getImpressionUrl() != "" ) : ?>
    <img src="<?php echo$_product->getImpressionUrl(); ?>" width="1" height="1" border="0"/>

How should I go about this?


texts:
I try to classify the items by type in checkout order summary.

I added the classifyItems function in cart-items.js

    classifyItems: function()  {
        var ItemsTab=[];
        var Items = this.getItems();
        for(var key in Items) {
            var itemType=Items[key].product_type;
            if (typeof ItemsTab[itemType] === 'undefined') {ItemsTab[itemType]=[];}
            ItemsTab[itemType][key]=Items[key];
        }
        console.log('classified items');
        console.log(ItemsTab);
        return ItemsTab;
    }

when I do in cart-items.html

the different product types are displayed, but when I want to go further :

I have got an error : classifyItems is not defined

Thank you for your help,


texts: Multiple Store - Add to cart - Much slower on secondary stores than primary

texts:
We have a Magento site running 1.9.0 that we run a handful of stores out of.  Today we ran into huge performance issues, primarily dealing with Add to Cart (and all other pages involving cart operations).

Add to Cart is taking 10-15 seconds on all of our secondary stores, but if I go to the primary store (the one whose domain magento is installed behind), Add to Cart takes less than 3 seconds.   We don't really know how long it was taking to add to cart before, but we hadn't had any complaints in the past and we've had several today, so we suspect this is a new issue.

I've gone through everything I can figure out and read about.  The performance of the site in general has clearly improved from these things (browser caching, deflate compression, single file js and css, etc), but I've seen no improvement at all on the slow cart operations.

I've tried disabling modules (rss, log, paypaluk, and a few others), but that hasn't shown any noticeable improvement.

I've cleared my logs from the database and made sure cron is running successfully.

Hard drive space on the machine is fine (it uses SSD, by the way).
I've got the cache using tmpfs.
System has 500+ MB of free RAM.

These delays are flat out killing us.  Any guidance would be very appreciated!

Edit:  I've got the Aoe_Profiler running.  I've turned on profiling for all pages so I can see times for Add to Cart.  The puzzling thing is this difference depending on which store it is.

Times for loading the checkout cart page (same items in each cart):

Store 1 - 1.253 seconds
store 2 - 5.933 seconds
Store 3 - 7.475 seconds

Store 1 has magento physically installed in its directory.
Store 2 is a redirect via .html meta.
Store 3 is a redirect using apache settings (DocumentRoot).

I don't think the difference between Store 2 and Store 3 is significant.  That is, if I run it a few times they have a similar average load time, while Store 1 is always much lower.

Store selection ($mageRunCode) set in index.php.

Now I'm trying to find where in the code correlates to mage::dispatch::controller::action::checkout_cart_index.  So far I see that it's defined in /Controller/Varien/Action.php up to the ::action part, but it's not clear to me what code is being called for the checkout_cart_index.

(if you can't tell, I've never looked at magento code before :-)


texts: After installing, my magento2 is extremely slow though I did not install sample data?

texts:
After installing, my magento2 is extremely slow thought I did not install sample data?

I am working on magento community 2.0.1

I created virtual box with 2GB Ram & 2Gb Swap.

I just want to note: All cache are enabled by default after setting up magento.


texts: How Shopping Cart, Order Summary get quantity value?

texts:
I found this page

vendor/magento/module-checkout/view/frontend/web/ template/summary/item/details.html

How do I find where this "text: $parent.qty" getting value from?


texts:
We are currently building a Magento 2.1 shop for B2B

I want to require the vat for the checkout.
I have this already fixed for the shipping fields, but not for the billing fields. This is necessary because One Page sometimes only showed the 'update payment information' and not the shipping fields. On that moment it's possible to place an order without a valid VAT.

I tried to set the vat_id to required in the database, but this has some nasty results with account registration and changing.
In the backend, is vat set on required.

My checkout_index_index.xml is as follow:

<referenceBlock name="checkout.root">
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="checkout" xsi:type="array">
                        <item name="children" xsi:type="array">
                            <item name="steps" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="shipping-step" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="shippingAddress" xsi:type="array">
                                                <item name="children" xsi:type="array">
                                                    <!-- The name of the form the field belongs to -->
                                                    <item name="shipping-address-fieldset" xsi:type="array">
                                                        <item name="children" xsi:type="array">
                                                            <item name="vat_id" xsi:type="array">
                                                                <item name="validation" xsi:type="array">
                                                                    <item name="required-entry" xsi:type="boolean">true</item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>

Another problem, that i have with the vat, is after checkout. When i place successfully an order (with valid VAT), i cannot create an account with the message VAT ID is not valid. This is a minor problem, but it would be better when i can fixed this to.


texts:
Is there any idea behind the naming of the patches? If yes, what is it? For those who never saw them (shame on you), some examples below.

Patch-7405
Patch-8788
Patch-1533

Full list in second tab "Release archive" here: https://www.magentocommerce.com/download

EDIT: this question explains the "SUPEE" part as commented below: What is the idea behind the patch naming for Magento?
I am wondering if the numbers have any meaning and what they stand for.


texts: Magento rewrite issue with multi-language store setup and storecodes

texts:
currently I use a multi-language store setup with Magento 1.7 on a single domain. The URLs looks like this:

www.example.com/category/product.html
www.example.com/kategorie/produkt.html

For SEO reasons I want to use storecodes:

www.example.com/en/category/product.html
www.example.com/de/kategorie/produkt.html

Problem: The old structure is fully indexed by google. I don't know how to rewrite those URLs correctly to the right storecode. Any ideas?

Thanks in advance


texts: Magento 2 checkout extra fee is adding twice to base_grand_total

texts:
magento 2 checkout  extra fee adding twice to grand total
collect function calling 4 to 5 times

parent::collect($quote, $shippingAssignment, $total);
    if (!count($shippingAssignment->getItems())) {
        return $this;
    }

+

$address = $shippingAssignment->getShipping()->getAddress();
    if($address->getAddressType() != 'billing'){
        return $this;
    }
    // My code
    return $this;

(or)

$address = $shippingAssignment->getShipping()->getAddress();
    if($address->getAddressType() == 'billing'){

        // My code
        return $this;
    }

Reference: https://stackoverflow.com/a/42141291/8237294


texts: How to put a PHP function in a Button "on click" attribute?

texts:
Hi i'm new at magento2 and i want to put a PHP function in an "on click" attribute of a button on ui component form.
Specifically on this "Save Header" button.

So, actually i want to use this "Save Header" button to just save two fields of the form, the fields (Nome Header, Valor Header).

The "on click" attribute. In this "on click" i want to call a php function...

routes.xml:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/App/etc/routes.xsd">
<router id="admin">
    <route id="api" frontName="api">
        <module name="Hub_Api" />
    </route>
</router>

------------------------------EDIT---------------------------------
So now my "SaveHeader" button is like that, but still don't working, maybe the url is passed wrong:

SaveHeader.php (Controller):
namespace Hub\Api\Controller\Adminhtml\Data;

class SaveHeader extends \Magento\Framework\App\Action\Action
{
protected $logger;
public function __construct(
    \Psr\Log\LoggerInterface $logger
) {
    $this->logger = $logger;
    parent::__construct();
}

/**
 * View  page action
 *
 * @return void
 */
public function execute()
{
    $txt = 'HUDSON SAVEHEADER : ';
    $this->logger->log('DEBUG', $txt);

}

}


texts: Magento2: Minicart issue on Custom layout

texts:
I am using a custom layout for the category page.

Here is my code:

  app/code/Custom/Module/view/frontend/page_layout/equipment.xml

    <?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="equipmentbase"/>
    <referenceContainer name="page.wrapper">
        <container name="header.container" as="header_container" label="Page Header Container"  htmlTag="header" htmlClass="page-header" before="main.content"/>
        <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>
        <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer"/>
    </referenceContainer>
</layout>

  app/code/Custom/Module/view/frontend/page_layout/equipmentbase.xml

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <container name="root">
        <container name="after.body.start" as="after.body.start" before="-" label="Page Top"/>
        <container name="page.wrapper" as="page_wrapper" htmlTag="div" htmlClass="page-wrapper">
            <container name="global.notices" as="global_notices" before="-"/>
            <container name="main.content" htmlTag="main" htmlId="maincontent" htmlClass="page-main">
                <container name="columns.top" label="Before Main Columns"/>
                <container name="columns" htmlTag="div" htmlClass="columns">
                    <container name="equipment.main" label="Main Content Container" htmlTag="div" htmlClass="equipment check main"/>
                </container>
            </container>
            <container name="page.bottom.container" as="page_bottom_container" label="Before Page Footer Container" after="main.content" htmlTag="div" htmlClass="page-bottom"/>
            <container name="before.body.end" as="before_body_end" after="-" label="Page Bottom"/>
        </container>
    </container>
</layout>

I have created a custom layout using the above code. But in this layout minicart is not rendering.
If I use 1column then it is working fine.

Please tell me what I missing here. Or Correction.


texts: Magento override Adminhtml Customer Controller

texts:
I have been trying to override magento(1.9) admin's customer controller with my controller. But even though I have followed the steps correctly, I couldn't override the customer controller. Following are my codes

config.xml

<?xml version="1.0" ?>
<config>
<modules>
    <Aemulare_Customer>
        <version>1.0</version>
    </Aemulare_Customer>
</modules>

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Aemulare_Customer before="Mage_Adminhtml">
                        Aemulare_Customer_Adminhtml
                    </Aemulare_Customer>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>
</config>

My Controller(app/code/local/Aemulare/Customer/controllers/Adminhtml/CustomerController.php)

    <?php

     require_once "Mage/Adminhtml/controllers/CustomerController.php";

     class Aemulare_Customer_Adminhtml_CustomerController extends Mage_Adminhtml_CustomerController {

      public function indexAction() {
         die("H");
      }
}

What might be the issue? Please help.


texts: Magento2 Display extra product image in product page

texts:
I would like to display more related products of a product in my Magento 2 product page. with the following code, I can successfully get part of the path of a product image.

$related_products = $objectManager->get('Magento\Catalog\Model\ResourceModel\Product\Collection')
                   ->addAttributeToFilter('sku', array('like' => substr($_product->getSku(),0,8) .'%'))
                   ->addFieldToFilter('type_id','configurable');

foreach($replated_products as $relatedproduct){
   echo $relatedproduct->getImage();
}

this code will output something like /2/0/2050-101-9884.jpg, But how can I display it as a image? I haven't been able to find out how to get the full image path.


texts: Run .sql external file when installing extension in Magento 2

texts:
I have an .sql file which contain a lot of insert data, and i want import this .sql file to current magento 2 database file, everytime my custom extension finish installing and creating all custom table needed , here's the .sql file example:

INSERT INTO custom_table1 (name,status) VALUES ('test','active');
##....46000 rows more like this


texts: Remove footer's blocks in cms page using layout update

texts:
I created a cms page, but I don't want footer to display on this page, I added below line at layout update,

<reference name="footer">
    <remove name="footer_links" />
</reference>

I am using magento 1.9 rwd theme to test.

But the footer still exists, I remember I had done similar thing in the past, but I forgot how to do it twice again


texts: Magento 2 set default weight on admin panel create new product form

texts:
I am trying to setup default value to weight field to 1 not mater.  it just to prevent virtual product creation.

You can see image below:


texts:
I have add one block in product detail page. I am trying to position the block before footer but its not work.

<container name="chennai.review" htmlTag="div" htmlClass="review" before="footer-container">
<block class="Gworks\About\Block\Review" name="chennai.review.info" template="Gworks_About::review.phtml"/>
</container>

expected result

why my code is not working,How to achieve?


texts:
I need to know how to implements the WhatsHelp widget in Magento 1
This is the code:

<!-- WhatsHelp.io widget -->
<script type="text/javascript">
    (function () {
        var options = {
            facebook: "#", // Facebook page ID
            whatsapp: "#", // WhatsApp number
            call_to_action: "Contact us", // Call to action
            button_color: "#E74339", // Color of button
            position: "right", // Position may be 'right' or 'left'
            order: "facebook,whatsapp", // Order of buttons
        };
        var proto = document.location.protocol, host = "whatshelp.io", url = proto + "//static." + host;
        var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = url + '/widget-send-button/js/init.js';
        s.onload = function () { WhWidgetSendButton.init(host, proto, options); };
        var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
    })();
</script>
<!-- /WhatsHelp.io widget -->

The widget must appear on every page


texts: How can I add custom option to order on  Event

texts:
When someone placed an order, I need to add a custom option with ordered item. The custom option already created for the product.

\Diamonds\etc\config.xml

<checkout_onepage_controller_success_action>
            <observers>
                <ikantam_diamonds_observer>
                    <type>singleton</type>
                    <class>Ikantam_Diamonds_Model_Observer</class>
                    <method>updateRingSize</method>
                </ikantam_diamonds_observer>
            </observers>
        </checkout_onepage_controller_success_action>

\Diamonds\Model\Observer.php

public function updateRingSize($observer) {
    $orderIds = $observer->getEvent()->getOrderIds();
    foreach ($orderIds as $orderId) {
        $order = Mage::getModel('sales/order')->load($orderId);

        foreach ($order->getAllItems() as $item) {
            $qiId = $item->getQuoteItemId();

            $quoteItem = Mage::getModel('sales/quote_item')->load($qiId);

            /* **This is ideal code. you can replace this code**
            $optionCollection = Mage::getModel('sales/quote_item_option')
                    ->getCollection()
                    ->addItemFilter($quoteItem)
                    ->addFilter('code', 'ring_size');
            foreach ($optionCollection as $oo) {
                $productOptions = $item->getProductOptions();
                $productOptions['additional_options'] = $oo->getValue();
                echo '<pre>';print_r($productOptions);exit;
                $item->setProductOptions($productOptions);
                $item->save();*/
            }
        }
    }
}

(If you suggest some code with add custom option after order success then it will great)


texts: Wrong tax calculation when paying with PayPal after 1.8 update

texts:
I originally posted this question on the Magento forums, but didn't get an answer there for three days.

Since updating to 1.8 CE, some orders get marked as “Suspected Fraud” because Magento's and PayPal's grand totals don’t match.

Here’s an example:
The customer ordered one item the costs 10 euros, including 20% tax. The shipping fee is 5.50 euros, including 20% tax. Everything’s fine on the Magento side: it displays:

Subtotal € 10
Shipping & Handling € 5.50
Grad total excl. tax € 12.92
Total tax € 2.58
Grand total incl. tax € 15.50

But PayPal receives this a little differently:

Just one item, even though “Admin > System > Configuration > Sales > Payment Methods > PayPal Payment solutions > Website Payments Standard > Advanced Settings > Transfer Cart Line Items” is set to “Yes”
The one item shows a price of € 12.92, which is fine - it’t the item’s price plush shipping without the tax.
It then adds the shipping a second time, in a separate “Shipping” line, with a price of € 4.58
The Grand total is € 20,08

Magento’s and PayPal’s grand totals don’t match up and so I get the “Suspected Fraud” order status.

What I’ve observed so far:

It only happens if the customer is paying via PayPal
It only happens if the customer is from Austria (the shop is Austrian too)
I’ve selected “Transfer Cart Line Items”, but they aren’t transferred
I’m 99% sure this didn’t happen before the 1.8 update

These are my tax settings:

Calculation Settings

Tax Calculation Method Based On Total
Tax Calculation Based On Shipping Address
Catalog Prices Including Tax
Shipping Prices Excluding Tax
Apply Customer Tax After Discount
Apply Discount On Prices Excluding Tax
Apply Tax On Custom price if available

Default Tax Destination Calculation

Default Country Austria
Default Post Code *

Price Display Settings

Display Product Prices In Catalog Including Tax
Display Shipping Prices Including Tax

Shopping Cart Display Settings / Orders, Invoices, Credit Memos Display Settings

Display Prices Including Tax
Display Subtotal Including Tax
Display Shipping Amount Including Tax
Include Tax In Grand Total Yes
Display Full Tax Summary Yes
Display Zero Tax Subtotal No

Fixed Product Taxes

Enable FPT No

Please let me know if you need any additional details.

Thanks!


texts: 404 When Configurable Product set to 'Not Visible Individually'

texts:
I've got a bit of a problem.  I have some products which are bound together using a configurable product but I don't want the actual configurable product to be shown.

For example, a rose comes in red and yellow colours.  Both of these are part of the Single Rose configurable product.

I want the visibility of both simple products to remain, however the configurable itself I wish would not show in the catalog or search results.

This does work fine however when I set the configurable to 'Not Visible Individually', the simple products then throw a 404 error even though they still appear in the catalog and the click is made organically.  If I set the configurable to Visible then all the simple ones work too.

While the configurable product is set to Not Visible, the configurable product will still work fine which is odd.  Of course it does mean you have to access it through direct link.  But the simples wont work with click or direct link (simples are always 'Visible').

Is this normal behaviour for Magento 2?  I have a Magento 1 site too and the above is no issue there.

If its normal behaviour, is there any way get around it and hid certain configurables from being shown?


texts: Does anyone know why the order id that appears in the url does not match the one that appears in the product?


texts: Magento 2 checkout new field is excluded from post data

texts:
I have this module for add newsletter subscription to checkout page in a Magento 2 project. I have added a checkbox field by following code:

app/code/MyNamespace/MyModule/Plugin/Checkout/Model/Checkout/LayoutProcessor.php

namespace Muaw\Subscription\Plugin\Checkout\Model\Checkout;

class LayoutProcessor
{
    /**
     * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
     * @param array $jsLayout
     * @return array
     */
    public function afterProcess(
        \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
        array  $jsLayout
    ) {
        $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
        ['shippingAddress']['children']['shipping-address-fieldset']['children']['subscribe'] = [
            'component' => 'Magento_Ui/js/form/element/abstract',
            'config' => [
                'customScope' => 'shippingAddress',
                'template' => 'ui/form/field',
                'elementTmpl' => 'ui/form/element/checkbox',
                'options' => [],
                'id' => 'subscribe'
            ],
            'dataScope' => 'shippingAddress.subscribe',
            'label' => 'Opt-In to our news letter',
            'provider' => 'checkoutProvider',
            'visible' => true,
            'validation' => [],
            'sortOrder' => 250,
            'id' => 'subscribe',
            'value'=>'subscription'
        ];

        return $jsLayout;
    }
}

app/code/MyNamespace/MyModule/etc/frontend/di.xml

<?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
        <type name="Magento\Checkout\Block\Checkout\LayoutProcessor">
            <plugin name="subscription" type="Muaw\Subscription\Plugin\Checkout\Model\Checkout\LayoutProcessor" sortOrder="100"/>
        </type>
    </config>

Rendered output:

My problem is when I try to get the order data it does not added into post data

Post data:

Did I do anything wrong? Is there any other way to register this field and get post data? Help is appreciated.


texts: Prototype.js Upload and Browse not working v1.9.2.1

texts:
The buttons are there, but as with 8788v2 patch they are showing on the left hand side, not the right, they are also not working. Checking in the console:

prototype.js:828 Uncaught ReferenceError: Uploader is not defined
    at eval (eval at <anonymous> (http://defibshop.yoma-cloud.co.uk/js/prototype/prototype.js:612:64), <anonymous>:3:24)
    at eval (eval at <anonymous> (http://defibshop.yoma-cloud.co.uk/js/prototype/prototype.js:612:64), <anonymous>:8:7)
    at http://defibshop.yoma-cloud.co.uk/js/prototype/prototype.js:612:64
    at http://defibshop.yoma-cloud.co.uk/js/prototype/prototype.js:865:29
    at http://defibshop.yoma-cloud.co.uk/js/prototype/prototype.js:825:18
    at Array.forEach (native)
    at Array.each (http://defibshop.yoma-cloud.co.uk/js/prototype/prototype.js:824:12)
    at Array.collect (http://defibshop.yoma-cloud.co.uk/js/prototype/prototype.js:864:10)
    at String.evalScripts (http://defibshop.yoma-cloud.co.uk/js/prototype/prototype.js:612:34)
    at Function.<anonymous> (http://defibshop.yoma-cloud.co.uk/js/prototype/prototype.js:391:23)

However I have copied the original file from the Magento version and replaced it, still not working. I have cleared the cache, reindexed and also tried a number of different browsers.

Any ideas what it could be?

8788 patch has been applied. In the console:

When loading the page, checking the console:

(index):1829 Uncaught ReferenceError: Uploader is not defined(anonymous function) @ (index):1829(anonymous function) @ (index):1834
(index):1846 Uncaught SyntaxError: Unexpected token ,


texts: Magento 2 product import won't import images

texts:
I am importing products using the built-in CSV import (System - import - products)
All my data is imported fine, but I get an error
"Imported resource (image) could not be downloaded from an external resource due to timeout or access permissions in rows: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10"
in my case, I have written the base_image path as
http://mywebsite.ca/pub/media/import/img/hose/jpg/Ach7938.jpg
as a test, I removed my folder structure, edited the CSV and tried this and got the same problem, same error
http://mywebsite.ca/pub/media/import/Ach7938.jpg
I tried writing file path as so
/pub/media/import/img/hose/jpg/Ach7938.jpg
but it won't let me past the "check data" validator.
I confirmed the permissions on the folders and files is 775
I am using PHP 5.6, I tried 7 but it broke the whole site in many different ways, so that isn't an option
As a side note, if I run this 20 times in a row, the entire site hangs and import won't work again until I do a full system restore (what's up with that?)
Can I put the images on a different server and link to them that way?


texts: Magento 2 > Partial search on model name

texts:
How can I have the default catalog search mechanism search on part of an attribute (in my case - the model attribute)? As it seems out of the box - the search works only on full word, or the beginning of the word - but, if the user enters a middle part of the word - it doesn't find the product

e.g. I have a product named "Samsung Galaxy S7" and the model attribute is "SM-G930F" - I want the search query "G930" to find the product

The weird thing is that in the admin control panel search - it does find it

I understand that the solution has something to do with search_request.xml but I can't find information about this specific case

Any help would be much appreciated!
Thanks


texts: Sql error thats been asked about before - Syntax error or access violation: 1118 Row size too large

texts:
Magento 2

When attempting to reindex - the usual error. The limitation is 65535.
By others calculations it is number of varchar attributes * 255.

However, in my case, the sql create statement for the flat table has only 198 attributes, and many of them are integers, yet we receive this error.

I do not understand, as if the calculation is 255 * number of varchar attributes, we would not be at this limit.

Could an sql engineer or someone who understands fully this issue comment on why we could see this error with our number of attributes.


texts: How can i add an information message to the checkout

texts:
I have a demo site using the default luma theme and I want to add a simple information message to the checkout above the delivery options.

Where about in the template can I edit this, I'm not bothered about best practise I just want to hack it in.


texts: How to change the url for SEO purposes of a custom module?

texts:
I have the following url for a specific entity

brands/index/view/id/1/

I would like to rewrite this url to:

brands/{{ brand_title }}

How is it possible?


texts: Notice: Undefined index: status in /var/www/share/default/htdocs/dev/mage2/vendor/magento/framework/View/Element/UiComponentFactory.php on line 408

texts:
protected function mergeMetadataItem(array $bundleComponents, array $metadata, $reverseMerge = false)
        {
            foreach ($metadata as $name => $data) {
                $selfData = $data;
                if (isset($selfData['children'])) {
                    unset($selfData['children']);
                }

                list($bundleComponents, $isMerged) = $this->mergeMetadataElement(
                    $bundleComponents,
                    $name,
                    $selfData,
                    $reverseMerge
                );

                if (!$isMerged) {
                    if (!isset($data['arguments']['data']['config']['componentType'])) {
                        throw new LocalizedException(new Phrase(
                            'The "componentType" configuration parameter is required for the "%1" component.',
                            [$name]
                        ));
                    }
                    $rawComponentData = $this->definitionData->get(
                        $data['arguments']['data']['config']['componentType']
                    );
                    list(, $componentArguments) = $this->argumentsResolver($name, $rawComponentData);
                    $arguments = array_replace_recursive($componentArguments, $data['arguments']);
                    $rawComponentData[ManagerInterface::COMPONENT_ARGUMENTS_KEY] = $arguments;

                    $bundleComponents[$name] = $rawComponentData;
                    $bundleComponents[$name]['children'] = [];
                }

                if (isset($data['children']) && is_array($data['children'])) {
                    $bundleComponents[$name]['children'] = $this->mergeMetadataItem(
                        $bundleComponents[$name]['children'],
                        $data['children'],
                        $reverseMerge
                    );
                }
            }

            return $bundleComponents;
        }


texts: "General system exception happened" Error when doing the import process

texts:
I have had problems when importing, I get that error, I attach the file I used at the time of import
Does anyone know how to solve the problem?
My version of magento is 2.1.6

https://drive.google.com/file/d/1fe9nv4EvZ2sgYYCMYWA5QtcwRfFiX61t/view?usp=sharing
This is the link where the file is


texts: Use Array of Custom Product Attributes to Create Unordered List

texts:
My current scenario:

I am given a spreadsheet similar to what we used to import products to Amazon. In this spreadsheet are multiple columns for Amazon's "bullet points" area. These are then combined into one cell on my Magmi import spreadsheet, separated by line breaks to form our short description area.

What I'd like to accomplish:

Instead of combining these columns manually, I plan to setup new custom text/text-area attributes named bullet_1, bullet_2, etc.. and import each column's information into each attribute individually. I will not add calls to these attributes into the view.phtml for product pages - but instead want to reference them in a .phtml file between line-items in an unordered list.

The new bullet attributes will always have content starting from the lowest number to the highest, so there would be no gaps until there is no more bullet point information to add. Adding to the custom array can stop when an empty bullet attribute is found.

bullet attributes will always be text strings. There will be no code imported into these attribute text fields.

In the short description area on the product import spreadsheet, I'll have the call to this (hopefully) universal .phtml file.

The .phtml file would work something like this:

<?php

$bullet1 = $product->getData('bullet_a');
$bullet2 = $product->getData('bullet_b');
$bullet3 = $product->getData('bullet_c');
$bullet4 = $product->getData('bullet_d');
$bullet5 = $product->getData('bullet_e');
$bullet6 = $product->getData('bullet_f');
$bullet7 = $product->getData('bullet_g');
$bullet8 = $product->getData('bullet_h');
$bullet9 = $product->getData('bullet_i');
$bullet10 = $product->getData('bullet_j');

$bullets = array("$bullet1","$bullet2","$bullet3","$bullet4","$bullet5","$bullet6","$bullet7","$bullet8","$bullet9","$bullet10");

echo "<ul>\n";
foreach($bullets as $bullet){

 if (!empty($bullet)){
 echo "<li>". $bullet . "</li>\n";
}
}
echo "<ul>\n";

?>

I'll end up minifying this .phtml file as our current theme/template/coding is auto adding line breaks when a new line is used in the short description area. This does not happen in our description area.

Please feel free to ask questions if I didn't explain this well enough. I'm also open to other methods of making this happen - and can even pay if this needs to be super custom coded.

Thank you!

UPDATE: later that same day

I've had some help with writing the phtml file but am getting errors when trying to call the attribute and use it as a variable. What do I have wrong?


texts: Magento 2 How can refresh minicart cache.After clear cart session and place order programmitically

texts:
How can resolve that issue .I remove all session

$this->_checkoutSession->clearQuote()->clearStorage();
    $this->_checkoutSession->clearQuote();
    $this->_checkoutSession->clearStorage();
    $this->_checkoutSession->clearHelperData();
    $this->_checkoutSession->resetCheckout();
    $this->_checkoutSession->restoreQuote();


texts: Magento 1.9 - Layered Navigation Links Ending with ?cat= or ?brand=

texts:
I am working on URL issues for a customer of mine and they have subcategory links ending in ?cat= and ?brand=. If I'm not mistaken, this is bad for SEO and not ideal for customer user experience.

I looked up the issue and found that it has to do with is_anchor set to 1/yes. I set all of the categories not to be anchors but this changed the way the left sidebar functioned, which is not what I was hoping for.

I have reindexed and cleared both caches but still have not had any success removing ?cat and ?brand from links.

I have web server rewrites enabled, there is no suffix for category and product pages and I have reindexed/flushed the cache multiple times.

The specific version of Magento is 1.9.2.4 running on PHP 5.6.38 and MySQL 5.5.

What else should I check?

[EDIT] Using the function here: https://www.blueclaw.co.uk/2013/08/12/fix-category-url-filter-in-magento-layered-navigation/, I was able to fix it for ?cat= but when I did it for ?brand, the links didn't quite look right. Presumably because they're brands, rather than categories. Is there a way to fix it for attributes or will I need an extension?


texts: Magento 1.9.3.1 no navigation bar in admin

texts:
My adminhtml/backend nav menu gone missing suddenly.

In page source there is no nav-bar at all.


texts: How to change deafult behaviour cleander date using custom js in magento 2 Product edit page at backend

texts: I have created custom attribute for Product as date and time and want to disable past dates?


texts: Magento MagMI Value Replacer for image header issues

texts:
I am trying to make a CSV template for mass import and would like it to be as clean as possible. I'm using Magento 1.9 with the Value Replacer v0.0.8a plugin in MagMI I hoped to use the same value across 3 headers without having to copy it in the CSV.

Specifically the "image" header cloned to "small_image" and "thumbnail".

I've tried:

Replaced attributes: small_image,thumbnail

small_image: {{ '{item.small_image}' == '' ? '{item.image}' : '{item.small_image}'}}
thumbnail: {{ '{item.thumbnail}' == '' ? '{item.image}' : '{item.thumbnail}'}}

Using this method seems to work but Image attributes processor (1.0.31) cant find the images for the 2 new columns. If I disable Value Replacer I can enter the columns manually and confirm it works for all 3 pictures.

Here is the sample CSV:

"sku","store","attribute_set","type","name","price","qty","is_in_stock","visibility","image","weight","categories","tax_class_id","supplier","manufacturer","kit_type","special_order","battery_capacity","battery_voltage","battery_type","featured"
"12333444","admin","Default","simple","t-shirt","2.95","1","1","4","/test.jpg","0.01","shirts","2","Great Planes","Traxxas","RTR","0","3200","11.1V","",""
"2222","admin","Batteries","simple","11.1v 2600MaH","29.95","1","1","4","11_1v_2600mah.jpg","1","Batteries/3s","2","Great Planes","Tenergy","","","2600","11.1v","lipo",""

Any help is appreciated.


texts: Magento2: how to override Component.extend property?

texts:
We noticed that on luma template, validation of email has delayed of 2 seconds. We want to override it so it doesn't have any delay upon email field changed. Is this possible to override?

return Component.extend({
    defaults: {
        template: 'Magento_Checkout/form/element/email',
        email: checkoutData.getInputFieldEmailValue(),
        emailFocused: false,
        isLoading: false,
        isPasswordVisible: false,
        listens: {
            email: 'emailHasChanged',
            emailFocused: 'validateEmail'
        }
    },
    checkDelay: 2000,
    ...


texts: What is an advantage of using DDL objects as opposed to using SQL queries to create a new table?

texts:
Can anyone tell me the correct answer from these 4 options

  a. They allow setup scripts to be cross-database compatible with any underlying RDBMS.
  b. They do not require developers to have a knowledge of the underlying RDBMS.
  c. They are easier to use than SQL queries.
  d. They prevent module conflicts.

Please help me to solve this


texts: Magento 2 + Reason behind deprecation of payment method class

texts:
In payment methods

  \Magento\Payment\Model\Method\AbstractMethod

  \Magento\Payment\Model\Method\Cc

both are deprecated.

In stead to extends both method now as per this link , we should implements

  \Magento\Payment\Model\MethodInterface

Is there any specific reason for deprecated both class ? because if we implements interface we have to defined all methods in our base class, and its lots of other work added for payment gateway developers.

I am looking for brief explanations with reasons if any have idea about that.


texts:
I have magneto on AWS , and I crease Image from Production Environment in order to Create Test & Dev but I noticed thats whenever I try to hit Clone/Test IP its Re-Direct to URL Production ; so seems production is performed the same, so I went to Apache folder and I checked 000-default.conf
I noticed there is no any Re-Direction and Document Root is pointing to right Magento Folder,
so How We can Stop Magento from Redirection URL through command Prompt specially?  I am not able to access URL of Clone due to Re-Direction to Production


texts: http is not working but https does in magento with https enabled

texts:
I am trying to open website on http:// and getting

No data received

ERR_EMPTY_RESPONSE

but  with https:// it works. please help me.


texts: Localhost frontpage - index.php showing "This webpage is not available" - Admin works

texts:
Im trying to setup my LIVE Magento repo on localhost (WAMP) and simply can't get the website itself to work. Admin works. Currently I can conclude the following:

Requesting: http://127.0.0.1/mywebsitealias/index.php - the frontpage - does not work, shows "This webpage is not available"
Requesting: http://127.0.0.1/mywebsitealias/test.html - works
Requesting: http://127.0.0.1/mywebsitealias/index.php/admin/ - works, I can login and see all of my database imported data. Products, users, sales - everything is there.

Symptons noted when I request the frontpage:

Loading spinner "thinks" a lot - the frontpage doesn't give an
instant response (so seems it's actually "connecting" to something)
Nothing appears in the console.log
Nothing / no errors appear in var/log or var/report

Any suggestions on what could be causing this?

What I tried - so far:

Ran search and replace DB path values from LIVE site to locahost path via:
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Read several places using 127.0.0.1/ rather than localhost was
recommend, so ended up using that
Tried adding set_time_limit(1800); in the start of index.php
In php.ini: set - max_execution_time = 1800
In php.ini: set - max_input_vars = 1800
In php.ini: set - memory_limit = 512M
In php.ini: set - mysql.connect_timeout = -1
Double checkhed In DB Table: core_config_data > web/unsecure/base_url +
web/secure/base_url checked that path is set to:
    http://127.0.0.1/mywebsitealias/
Deleted possible cache + sessions files in-between all
In Backend > Index Management > Tried to re-index all
In WAMP > Apache modules > Enabled filter_module,
 header_module, rewrite_module

I have a lot Wordpress / custom projects running on localhost with alias, so WAMP itself would be fully functional and working.


texts: Magento 2 How to resolve error: Unable to find a physical ancestor for a theme?

texts:
When trying to install 'TemplateMonster Theme'I get the error on the frontend:

"Unable to find a physical ancestor for a theme 'TemplateMonster Theme'.","1":"#0 \/lib\/internal\/Magento\/Framework\/View\/Model\/Layout\/Merge.php(713):"

In the same moment backend of the site working.

I do all steps required in the install guide but that's guide not helped me.

So I think maybe I missed something and tryed to use theme dump which I find in the 'TemplateMonster Theme' folder.
And unsuccessfull...

The only way to displayed my magento2 site it's switch back to the default theme.

Little notice - my current magento site version is 2.2.5, theme demo site works perfect on the version 2.0.2.

P.S. I'm allready read same post and that's not helped me:

For any tips I will be very grateful!!!


texts:
While creating an invoice from Magento backend I got the error message -

Cannot save Shipment

And in the exception I got this this--

PDOException: There is no active transaction in `/home/mag/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:316`
    Stack trace:
    `0` `/home/mag/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(316): PDO->commit()`
`1``/home/mag/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(510): Zend_Db_Adapter_Pdo_Abstract->_commit()
2 /home/mag/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(253): Zend_Db_Adapter_Abstract->commit()
3 /home/mag/public_html/vendor/magento/framework/Model/ResourceModel/AbstractResource.php(74): Magento\Framework\DB\Adapter\Pdo\Mysql->commit()`

4 /home/mag/public_html/var/generation/Magento/Sales/Model/ResourceModel/Order/Interceptor.php(323): Magento\Framework\Model\ResourceModel\AbstractResource->commit()

5 /home/mag/public_html/vendor/magento/framework/DB/Transaction.php(57): Magento\Sales\Model\ResourceModel\Order\Interceptor->commit()

6 /home/mag/public_html/vendor/magento/framework/DB/Transaction.php(147): Magento\Framework\DB\Transaction->_commitTransaction()

7 /home/mag/public_html/vendor/magento/module-shipping/Controller/Adminhtml/Order/Shipment/Save.php(79): Magento\Framework\DB\Transaction->save()


texts:
I've tried a few things listed here on the stack but I can't get it to where I want.

I can't even get it to appear in the 'main content' area.

I basically want it from postion 1 to 2 in the picture.


texts: Magento2.2 change admin user roles cant login

texts:
I have problem when change roles, all account of that roles can't access admin.

Step 1. User 1 will login as "CM" roles
Step 2. User 2 will update the resources available to role "CM"
Step 3. User 1 refresh page / login again.
Step 4. User 1 is unable to log in due to reset of role.

anyone meet that problem?


texts: How prevent header being injected with malicious redirects [1.9.3.3]?

texts:
My Magento 1.9.3.3 installation had malicious redirects injected into the header. I could easily erase the redirects from System/Configuration/Design/HTML Header/Other Header Content field.

However I would like to know how to prevent it from happening again.

I am not well-versed when it comes to locking down Magento, but I took the following steps:

Via SSH I ran

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod 550 mage to make sure permissions were set correctly.

I changed the admin password.

I did find that the admins user group had 20+ accounts I had never created. I erased those.

Are there additional steps I should/could take at this point?


texts: Overwrite community model method issue in Magento 1

texts:
This is my config xml from my custom module:

<models>
    <emailtester>
         <rewrite>
             <variable>Mynamespace_Mymodule_Model_Mailer_Variable</variable>
         </rewrite>
    </emailTester>
</models>

This is my model:

class Mynamespace_MyModule_Model_Mailer_Variable extends Yireo_EmailTester_Model_Mailer_Variable
{
    public function getVariables()
    {
         echo 1; exit();
    }

}

I would like to overwrite the method: Yireo_EmailTester_Model_Mailer_Variable::getVariables

This is the Yireo_EmailTester class:

class Yireo_EmailTester_Model_Mailer_Variable extends Varien_Object
{
    .....
    public function getVariables()
    {
    ....
    }
}

I am not sure what I am doing wrong here.  I followed this Overwrite community Model file? , but still I cannot get the echo 1; exit(); Any idea why ?

Thank you!


texts: SQL code to get the Product details with category tree heirarchy

texts:
I'm using Magento 1.9, We have a requirement to show the product details with category tree heirarchy. Have searched this in google and haven't find any answers.

I have to create a report(using a BI tool) ,So i need to find a way to do this in pure SQL.

Does anyone have any suggestions on how to achieve this?

Below is the expected sample of expected output.There are 3 levels of categories and main category.
So i want the Products which is the lowest level to be under the corresponding categories in a tree structure.


texts: get customer who have not placed order from last 3 months but in optimized way

texts:
I need to optimized my answer.

$start=2019-05-18 00:00:01;
$end=2019-05-18 23:59:59;

$customerArr=array();
$customers = Mage::getModel('customer/customer')->getCollection()
    ->addFieldToFilter('created_at', array("gteq" => $greaterOrEqualDate))
    ->addAttributeToSelect('is_xyz_email_sent')
    ->addAttributeToFilter('is_xyz_email_sent', array('neq' => 1));;

foreach ($customers as $customer){
    $lastOrder = Mage::getModel('sales/order')->getCollection()
        ->addFieldToFilter('customer_email',array("eq"=>$customer->getEmail()))
        ->addFieldToFilter('customer_email',array("nlike"=>'%example.com'))

        ->setOrder('entity_id','DESC')
        ->setPageSize(1)
        ->getFirstItem();

    if($lastOrder->getCustomerEmail() && $lastOrder->getCreatedAt() >= $start && $lastOrder->getCreatedAt() <= $end) {

        $unsubModule=Mage::getModel('unsubscribe/unsubscribe')->getCollection()
            ->addFieldToFilter('_id',$campaign_id)
            ->addFieldToFilter('_email',$customer->getEmail());

        if($unsubModule->getSize()==0) {
            array_push($customerArr, $lastOrder->getCustomerEmail());
        }

    }
}

This gives me right output but I need it optimized way because I m working with large database


texts: Magento : Get Configurable Product Price From Simple Products

texts:
Is it possible to get simple product price without manually updating associated fixed price or percentage?

We have more than 3000 configurable products, so it's not possible to do it manually.

Can we do this by add/edit scripts anywhere? if yes what will be the script?


texts: Issue when clean static files in Magento 2

texts:
In my Magento 2 site every time I try to clear the static file cache and try to reload the page in the frontend, several errors come out in the JS console, as if there were continuous conflicts between the various js files.
But when I try to clean up the Magento cache and reload the page in the frontend, the console problems disappear.
Has this happened to anyone?
It is as if Magento does not regenerate the js files in the pub / static folder ...
What could I do?


texts: Magento 2 : Get product price as per order currency

texts:
I have placed order in euro
& tried to get product price in phtml file of an email template
using below code
/** @var $_item \Magento\Sales\Model\Order\Item */
$_item         = $block->getItem();
$_order        = $_item->getOrder();
$helper        = $this->helper('Vendor\Sales\Helper\Data');
$productObj    = $helper->getProductBySku($_item->getSku());

echo $_order->formatPrice($productObj->getPrice()); // This changes only currency symbol not price exg. ( product price in dollar $11 ) it converts into €11 not €8.
Any thoughts how it can be converted ?


texts: Disallow payment methods for specific SKUs

texts: When user add those SKUs [items] to cart then I want to allow only some particular payment methods.


texts:
I am a newbie to Magento and I am trying to create a child theme with the parent as blank.

Now my task is to override the full layout and map bootstrap CSS so I don't want to read the CSS structure of Magento as will I could create responsive layouts easily. In simple words, I can have better control over the template.

I was able to override default.xml file in my theme. Now if I map the .phtml file from the templates folder, I am getting the error as

  1 exception(s):
      Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'Magento_Theme::html/navbar.phtml' in module: '' block's name: 'header.container_schedule_block0'

default.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
     <referenceContainer name="header.container">
           <block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html/navbar.phtml"></block>
        </referenceContainer>
    </body>
</page>

navbar.phtml

<?php

echo "Hello world" ?>

My folder structure is as attached.

I am sure, I didn't understand the documentation properly. So please do not refer the documentation link. Please point the mistake and how to clear the error.

Magento Version 2.2.4

Thanks.


texts: How to go to checkout review section and throw an error in Magento 2?

texts:
In my checkout_type_onepage_save_order observer, i have a code to do some validation and it will make the customer go to the checkout review and throw some error, in Magento 1.9 i can do it like this:

Mage::getSingleton('checkout/type_onepage')->getCheckout()->setGotoSection('review');
throw new Mage_Core_Exception($helper->__('There was an error processing your order. Please read error message or contact us ajk.com'));

How can i do something similar like this in Magento 2.3.4?


texts: I want to display brand's logo instead of name in Shop by Brands Section. I am using Infortis theme. Where should I Modify?


texts: Magento 2 How to use UI component grid in frontend and using export option

texts: I have created grid on frontend custom my account section using UI component grid. Also I'm trying to implement export option on UI component grid. How can i use this controller in front end - mui/export/gridToXml


texts:
In magento2 , how to show dynamically added customer attributes in customer grid?
I have used this extension

dynamic added customer attributes in backend

Customer_gitd


texts: How can we restrict by calling unnecessary third-party API invoking in collectRates() method Magento 2

texts:
We are using a third-party extension to get the rates for customers with discounted rates based on customer preferences, Items and etc. And it's working well.
Here I have couple of questions.

When the product is added to the cart the collectRates() method is called. I think this is unnecessary until the customer on the shopping cart or the Checkout page. Can we restrict? If we restrict is there any issues that may arise?

After adding the products to the cart, when the customer comes to the Checkout page, the collectRates() method is called 3 times. Is this necessary in Magento 2? If Yes why? If Not then how can we restrict?

After selecting the shipping method when we click on the Next for payment method again the collectRates() method is called after selected the shipping method also. Is this necessary to in Magento 2? If Yes why? If Not then how can we restrict?

Can you please help on this?


texts:
I want add bonus to my customer, in the internet i read that i need use custom attribute.

etc/Module.xml

<module name="Kt_Addbonus" setup_version="1.2.2">
    <sequence>
        <module name="Customer"/>
    </sequence>
</module>

Setup/InstallData.php

<?php

use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Customer\Model\Customer;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;

class InstallData implements InstallDataInterface
{

 /**
 * @var CustomerSetupFactory
 */
private $customerSetupFactory;
/**
 * @var AttributeSetFactory
 */
private $attributeSetFactory;

public function __construct(  CustomerSetupFactory $customerSetupFactory,
                              AttributeSetFactory $attributeSetFactory)
{

    $this->customerSetupFactory = $customerSetupFactory;
    $this->attributeSetFactory = $attributeSetFactory;
}

/**
 * Installs data for a module
 *
 * @param ModuleDataSetupInterface $setup
 * @param ModuleContextInterface $context
 * @return void
 */
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

    $setup->startSetup();

    $attributesInfo = [
        'customer_bonus' => [
            'label' => 'Customer Bonus',
            'type' => 'int',
            'input' => 'text',
            'position' => 1000,
            'visible' => true,
            'required' => false,
            'system' => 0,
            'user_defined' => true,

        ]
    ];

   $customerEntity =$customerSetup->getEavConfig()->getEntityType('customer');
   $attributeSetId = $customerEntity->getDefaultGroupId();

    $attributeSet = $this->attributeSetFactory->create();
    $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

    foreach ($attributesInfo as $attributeCode => $attributeParams) {
        $customerSetup->addAttribute(Customer::ENTITY, $attributeCode, $attributeParams);
    }

    $customerBonusAttribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'customer_bonus');
    $customerBonusAttribute->addData([
        'attribute_set_id' => $attributeSetId,
        'attribute_group_id' => $attributeGroupId,
        'used_in_forms'=>['adminhtml_customer']
    ]);

    $customerBonusAttribute->save();
    $setup->endSetup();

}
}

Custom attribute dont add to db or admin`s create customer page.
And PhpStorm says me that CustomerSetupFactory undefind, i already tried

setup:di:compile
setup:upgrade and cache:flush

did too.

Update 1

CustomerSetupFactory was generated. But custom attribute still not added.


texts:
I have been profiling some pages and after clearing cache there is a really slow response from: Locale/Currency

I am not too sure why it is taking so long.
Here is the profiler entry:

Here is the time it takes:


texts: Magento 1.9 getting a blank page when creating a new product or edit old product

texts:
Magento 1.9 getting a blank page when creating a new product or edit a old product.

Here is the screenshot:
https://www.awesomescreenshot.com/image/3223861/004f51987079007debc43adfe3537395

Can anyone help me to solve this issue. I have tried a lot of things like:

disable compiler.
flush cache.
disable all extenstions.


texts:
I got this annoying issue:

that's unwanted spaces thats caused by unknown HTML:

My question is how to remove that unwanted annoying html (UL/LI) from home page?

Thanks


texts: Assist with MySQL Debug of duplicated results in Magento Database

texts:
Hopefully, someone can highlight the errors of my ways with this problem that I have created for myself. Your help is appreciated.

Brief

Gather all orders made within a specific period and list all product SKUs in the order as a concatenated row.

Problem

The results in the SKU field are being duplicated

Query

SELECT
    increment_id AS 'Order Number',
    orders.created_at AS 'Ordered On',
    customer_email AS 'Email',
    address.firstname AS 'First Name',
    address.lastname AS 'Surname',
    GROUP_CONCAT(items.sku SEPARATOR ', ') AS 'SKUs'
FROM
    sales_flat_order AS orders
    JOIN sales_flat_order_item AS items ON items.order_id = orders.entity_id
    LEFT JOIN sales_flat_order_address AS address ON orders.entity_id = address.parent_id
WHERE
    orders.created_at BETWEEN  '2016-01-1 00:00:00' AND '2016-12-31 00:00:00'
GROUP BY
    increment_id

Output Example

Order Number    First Name  Surname Email       SKUs
0000001         John        Doe     d1@ex.com   123456, 123456
0000002         Jane        Doe     d2@ex.com   789456, 789456
0000003         Bob         Smith   s3@ex.com   456123, 123456, 456123, 123456

Thank you in advance.


texts:
I am using Firegento PDF extension on a Magento CE 1.9.3.0 Store. By law (Germany) we need to have specific notes on the pdf invoices regarding tax.

For every invoice within the EU there should be a note saying

Dies ist eine steuerfreie innergemeinschaftliche Lieferung

For every invoice outside the EU there should be a note saying "Dies ist eine steuerfreie Ausfuhrlieferung".

How can I set it up? I cant set notes for specific countries.

I couldn't get this to work: Add note on invoices for specific countries


texts: How to Change Header Logo Image URL Magento 2.1. So I click the header logo to go to another website.


texts: Changing theme results in error - Magento 2

texts:
To find the solution of this question :(add to cart not working)
Add to cart not working for configurable products on product listing page. Magento - 2
I switched the theme from my custom one to Magento luma to check whether it was a theme problem or not.
After switching back again to my custom theme some js and CSS files could not be loaded

Here is the screenshot of console:

I had used static content deploy, upgrade, flush cache etc commands after changing the theme.

sudo php bin/magento setup:upgrade; sudo php bin/magento cache:flush; sudo chmod -R a+wX pub; sudo chmod -R a+wX var; sudo chmod -R a+wX app; sudo chmod -R a+wX app/etc; sudo chmod -R a+wX generated; sudo php bin/magento setup:di:compile; sudo php bin/magento setup:static-content:deploy; sudo php bin/magento indexer:reindex; sudo php bin/magento cache:flush; sudo chmod -R a+wX pub; sudo chmod -R a+wX var; sudo chmod -R a+wX app; sudo chmod -R a+wX app/etc; sudo chmod -R a+wX generated;

Also please tell me the proper way of switching between themes in Magento.


texts: How to get from where the user is coming on the landing page?

texts:
When a user comes to my website I want to figure out from where he/she came?

For example:

 1. Google or other search engines

 2. Direct type

 3. in  email promotions

Any suggestions will be appreciated.


texts: Magento 2 Extension Vendor name start with digit Not working

texts:
Try to create Magento 2 Module, Vendor name start with digit

Like : app/code/3dvendor/3dmodule  (3dvendor_3dmodule)

when run "php bin/magento setup:di:compile"  command we get error

Is it valid vendor and module name?
can give me any suggestion.

we get name space error while run compile command


texts:
Recently I was thinking about going headless in order to improve performance of a magento store and also at least in theory faster front-end development and faster deployment.
But going headless by using a JS framework ruins SEO of the store which is major issue. So what about using magento's REST API with another php application using laravel for example or symfony or whatever as the frontend?
Would it considered overkill? Or slow in that matter?  Any opinions??
Thank you!


texts: Magento Minicart not clear after delete all product programatically

texts:
I have customized mini-cart. and place one new button Clear shopping cart. it's work fine. all item are deleted successfully. but mini cart total not updated in Magento 2. total updated only by one item.

check snap.


texts: magento product flat tables row size too large

texts:
When I re-index data in magento 1.x with large attribute set about 200 attributes. The got me followin MySQL error.

  Product Flat Data index process unknown error:
  exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB may he                                                                     lp. In current row format, BLOB prefix of 0 bytes is stored inline.' in /var/www/html/uat/lib/Zend/Db/Statement/Pdo.php:228


texts: How to display two grouped products in one product page in Magento

texts: I have to create a grouped product page in magento in which a grouped product has engine and body parts which both are grouped products with a lot of associated products. A user should be able to click on corresponding tab which should load engine product pictures and body product pictures depending on which tab he has clicked. How can I add those 2 products in the backend, with a meaningful relation between those two products that can be used to identify the product in frontend?


texts: AUTHORIZE.NET There was an error processing your order. Please contact us or try again later

texts:
I have two payment options set up in Magento 1.9.0.1.

PayPal, and Authorize.net. PayPal works fine. Authorize.net is throwing an error and I can't for the life of my figure it out. I been searching for DAYS.

Problem:

After selecting Authorize.net and putting in the required information, I'm redirected to the next step of the OnePage checkout process ("ORDER REVIEW").

Upon clicking "Place Order" I get the following error message in a dialog box at the top of my browser:

  "There was an error processing your order. Please contact us or try again."

What I do know:

Authorize.net is configured properly in the backend. API and Transaction Keys are all 100% correct. I've checked this 100 times over.
This problem is not being caused by something on Authorize.net's end. This is a Magento issue.
As far as I've tested, I've never been able to get passed this error. Having a registered account, checking out as a guest, etc. seems to have no affect.

Debugging:

I completely cleared the exception.log for a fresh file, and went through my checkout process again in an effort to debug the problem.

Here is the exception.log file (Pastebin): http://pastebin.com/uhW8Vrgy

This is the first time I've ever tried debugging an issue through log files, so help here would be appreciated.

Conclusion:

If anybody can provide any help with this, I would GREATLY appreciate it. You'll save me from gauging my eyes out too. I've been searching around for days on how to fix this problem and can't find anything that works. It's really important that I have this up and functional within the next day or so.


texts: Magento 2.2 x or 2.3 - to bundle or not to bundle

texts:
I've read so many conflicting write up's and blogs about whether to "Enable Javascript Bundling" or not. Some say it's slow and some say it's faster when enabled.

From what I understand it takes all scripts of a module and merges them into a single script. If you enable this feature, a page will load the whole javascript content regardless of whether it is used on the page or not. As a result, page size increases - bad news for store performance.

Why would you want load a bunch of scripts you are not using? I'm not sure if there is an official thread about bundling and the pros and cons but perhaps we can make this the official thread.

I've noticed on my 2.3 store it's faster when JavaScript bundling is not enabled.

https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/js-bundling.html

https://inchoo.net/magento-2/javascript-bundling-magento-2/


texts: Magento1.9 CSV generate but not download on save action

texts:
Here is my controller code ::

public function saveAction()
        {
            $post_data=$this->getRequest()->getPost();
            if ($post_data) {

                try {
                    $orderId = 1;
                    $order = Mage::getModel("sales/order")->load($orderId);
                    $header = array('Order Id','Product Name','Sku','Price');
                    $io = new Varien_Io_File();
                    $path = Mage::getBaseDir('var') . DS . 'export' . DS;
                    $name = 'file-'.$orderId.'.csv';
                    $file = $path . DS . $name;
                    $io->setAllowCreateFolders(true);
                    $io->open(array('path' => $path));
                    $io->streamOpen($file, 'w+');
                    $io->streamLock(true);
                    $io->streamWriteCsv($header);

                    $items = $order->getAllItems();
                    foreach ($items as $item) {
                        $data = array($order->getIncrementId(), $item->getName(), $item->getSku(), $item->getPrice());
                        $io->streamWriteCsv($data);
                    }
                    $io->streamUnlock();
                    $io->streamClose();
                    // Download
                    $this->_prepareDownloadResponse($name, file_get_contents($file));
                    $this->_getSession()->addSuccess($this->__('File downloaded.'));
                }
                catch (Exception $e) {
                    Mage::getSingleton("adminhtml/session")->addError($e->getMessage());
                    Mage::getSingleton("adminhtml/session")->setExampleData($this->getRequest()->getPost());
                    $this->_redirect("*/*/edit", array("id" => $this->getRequest()->getParam("id")));
                    return;
                }

            }
            $this->_redirect("*/*/");
        }

$this->_prepareDownloadResponse - Download function but not working direct redirect with success message but file not download.


texts: How to get custom customer attribute value in sales order grid?

texts:
I have made customer attribute 'sales_executive' which shows proper value in customer grid.
Now i want to show the same value in sales order grid by adding column. How to add this column and get value in it?


texts:
I want to add a static block to the header and footer to add custom CSS ( head area ) and JS to footer area.

I'm doing this so if i want to add custom CSS I don't have to edit files and upload them via FTP. I can just edit the static block and it's there instantly

My CSS static block is called inline-css  and JS one is inline-js

Any help would be great.
Thanks.


texts: Overriding local controller with own new local controller

texts:
I've added some functionality to the Amasty_Xcoupon module, but after upgrading from v1.0.6 to 1.1.6, the codepool of the module changed from community to local. This somehow results in my controller not working anymore (404 page).

Note: I've updated the classnames and everything else works great. Also, I know there have been similar questions posted here, but the solutions mentioned there didn't work for me (or I messed up a bit more).

Here is the original rewritten controller (which worked when the module was in community codepool):

// src/app/code/local/My/Extension/controllers/Adminhtml/ReportController.php
class My_Extension_Adminhtml_ReportController extends Amasty_Xcoupon_Adminhtml_ReportController
{
    // code here
}

The older file was located in src/app/code/community/Amasty/Xcoupon/controllers/Adminhtml/ReportController.php, the newer is located in src/app/code/local/Amasty/Xcoupon/controllers/Adminhtml/Amxcoupon/ReportController.php.

This is the updated controller:

class My_Extension_Adminhtml_ReportController extends Amasty_Xcoupon_Adminhtml_Amxcoupon_ReportController
{
    // code here
}

The config.xml looks like this:

<config>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <My_Extension before="Mage_Adminhtml">My_Extension_Adminhtml</My_Extension>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

This worked with the previous version, but now in the new version when execute the function I go to a nice looking 404 page, so my controller is no longer found.

I've tried using require_once to get the original controller, but no success. Also tried to change the config to this:

<config>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <My_Extension before="Amasty_Xcoupon">My_Extension_Adminhtml</My_Extension>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

As well as adding the previously non-existing Amxcoupon directory in the controllers/Adminhtml directory and adding that to the config, but nothing works.

Does anyone know what I'm doing wrong here? Many thanks to whoever finds the error(s) of my ways.


texts:
I managed to create multiple store by using the subdirectory + symlinking method. Everything works fine except that images are not found! I made sure that I created a symlink for the media folder, and tried to manually browse to file specified as not found. The files are there, its just that my website doesn't see/find them.
I am quite sure that this has something to do with the symlinking as css, js and other folders are served correctly.

UPDATE

In my system.log file it gives me this error for every image that is being loaded:

2015-07-21T08:04:18+00:00 ERR (3): Warning: imagejpeg(): Unable to open '/www/reservo/media/catalog/product/cache/7/small_image/350x350/9df78eab33525d08d6e5fb8d27136e95/J/O/JOK90X9016_2.jpg' for writing: No such file or directory  in /www/reservo/lib/Varien/Image/Adapter/Gd2.php on line 166


texts: How insert static block all CMS page sidebar left sidebar Magento 2.x?

texts:
I want insert static  block  all cmd page  sidebar left sidebar  magento 2.x

Step1:
I create a static block that i want to add to a specific CMS page which   name static-block-1 .

ex.

Static Block 1

This is display on left sidebar on cms page

Setp2:

How Can I display on CMS Page Left Sidebar??


texts: Magento 2 - How does the remove wishlist button work?

texts:
I am wondering how does the remove wishlist button work?

i have checked the code, and there is no form tag around it.

  How can it post to the remove item controller in
  vendor/magento/module-wishlist/Controller/Index/Remove.php

        Remove This Item


texts: How to generate random password for customer in Magento2?

texts:
We had a method to generate the random passwords for the customers in Magento1 in following class.

app\code\core\Mage\Customer\Model\Customer.php

method >>

 /**
     * Retrieve random password
     *
     * @param   int $length
     * @return  string
     */
    public function generatePassword($length = 8)
    {
        $chars = Mage_Core_Helper_Data::CHARS_PASSWORD_LOWERS
            . Mage_Core_Helper_Data::CHARS_PASSWORD_UPPERS
            . Mage_Core_Helper_Data::CHARS_PASSWORD_DIGITS
            . Mage_Core_Helper_Data::CHARS_PASSWORD_SPECIALS;
        return Mage::helper('core')->getRandomString($length, $chars);
    }

What is the similar method in Magento2?


texts:
I am writing a before plugin for below public method.

public function setup($user,$pass,$url = null){
 $this->username = $user;
        $this->password = $pass;
        if ($url) {
            $this->uri = $url;
        }
        return true;
}

I write like below

public function beforeSetup($subject, $user, $pass,$url = null){
     $user = "test";
     $pass = "hello";
     return array($user,$pass,$url);

    }

As per dev docs If there is more than one argument, the method should return an array of those arguments.
But am getting : Warning: array_merge(): Argument #2 is not an array

How we handle more than one argument in plugins??


texts: Magento1 SQL select all Attribute Option values like in Admin Backend

texts:
I want to get all values of all M1 Attribute Option values like in Magento backend. I have this code

SELECT
eav_attribute_option_value.option_id,
eav_attribute_option_value.`value`,
eav_attribute_option.attribute_id
            FROM
                    eav_attribute_option_value
            INNER JOIN eav_attribute_option ON eav_attribute_option_value.option_id = eav_attribute_option.option_id
            GROUP BY
                    eav_attribute_option_value.option_id
            ORDER BY
            eav_attribute_option_value.`value` ASC

But I am missing the values like "Store Label", "Sort Order" and "is Default", "Store ID".


texts: How to change the attributes in "Quick simple product creation"?

texts:
I need to change the dimensions and size of the product in compound products using Quick simple product creation in an associate product.

So how can I add more attributes there and along with that how to quick edit these attributes later from the list show at bottom

Thanks.!


texts: Show out of stock product for configurable product Magento 2.1.13

texts:
I want to show all sizes of configurable products.
Like i have three size S, M, L and L is in Out of stock than it should be visible swatches with cross.

In configuration product i am enable show out of stock product visible.

But still out of stock swatches is not showing


texts: How to do a solr search programmatically?

texts:
Following problem:
I use magento enterprise edition with solr search. That works great!
Now I'd like to do a search with my own query string programmatically.
How can I achieve that?

To be a bit more specific: How can I use my own query string and get the collection out of the solr search within my block?

Thanks for any help and/or suggestions!


texts: Fatal error: Call to a member function setTemplate() on a non-object in

texts:
path: app\code\local\Bhtech\Designer
inside this folder all other folder Block, Controller

config.xml

<?xml version="1.0"?>
  <config>
     <modules>
        <Bhtech_Designer>
          <version>0.1.0</version>
        </Bhtech_Designer>
     </modules>
     <frontend>
       <routers>
          <routeurfrontend>
              <use>standard</use>
              <args>
                 <module>Bhtech_Designer</module>
                 <frontName>designer</frontName>
              </args>
           </routeurfrontend>
       </routers>
       <layout>
            <updates>
                <bhtech_designer>
                    <file>bhtech_designer.xml</file>
                </bhtech_designer>
            </updates>
        </layout>
    </frontend>
    <global>
        <blocks>
            <bhtech_designer>
                <class>Bhtech_Designer_Block</class>
            </bhtech_designer>
        </blocks>
    </global>
</config>

indexController.php

<?php
class Bhtech_Designer_IndexController extends Mage_Core_Controller_Front_Action
{
    protected function _initAction()
    {
        $this->loadLayout();
        $this->renderLayout();
        return $this;
    }
    public function indexAction()
    {
         $block = $this->getLayout()->createBlock('bhtech/designer');
         $block->setTemplate('designer/designer.phtml');
         echo $block->toHtml();
        //Zend_Debug::dump($this->getLayout()->getUpdate()->getHandles());

    }
}

Block
designer.php

<?php
class Bhtech_Designer_Block_Designer extends Mage_Core_Block_Template
{
    // Methods (optional)
}
?>

designer.xml

<?xml version="1.0" ?>
<!-- Root node for Magento layout configuration -->
<layout version="0.1.0">
    <!--Page handle -->
    <designer_index_view>
        <!-- reference tag specifies the block where we a going to add child block -->
        <reference name="content">
            <!-- Our page content block -->
            <block type="bhtech/designer" name="designer" template="design.phtml"></block>
        </reference>
    </designer_index_view>
</layout>

path: app\design\frontend\bhtech\designer
inside this folder layout and template folders are placed

layout.xml

<block type="bhtech/designer" template="bhtech/designer.phtml">
    <action method="setData">
        <key>area</key>
        <value>frontend</value>
    </action>
</block>

but I still getting error my magento version 1.9
please help me out if there any details document or example of this please give me that. I'm just trying to load a complete new template for a page.


texts: fetch customer's custom attribute value on edit account page magento2

texts:
I have created some customer's custom attribute that I am using in registration process. And they are saving values properly.

Now I want show values of those custom attributes on 'customer/account/edit/' page on frontend in user's account. I am using

  $block->getCustomer()->getMyCustomAttributeCode();

but showing nothing even showing 500 error in console.

Is Magento2 following different way to fetch custom attribute value. Please help me in this.


texts: How to send email on order status change

texts:
I've created a function for mass order status change.

Here is my code:

public function NewMass1Action()
{
    $orderIds = $this->getRequest()->getPost('order_ids', array());
    $countHoldOrder = 0;

    foreach ($orderIds as $orderId) {
        $order = Mage::getModel('sales/order')->load($orderId);
        if ($order->canHold()) {
            $order->masscustom1()
                ->save();
            $countHoldOrder++;
        }
    }

    if ($countHoldOrder) {
        $this->_getSession()->addSuccess($this->__('%s order(s) have changed status.', $countHoldOrder));
    }

    $this->_redirectUrl(Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/index'));
}

The problem is that this function is not sending an email to the customer when his order status is changed.

How can i make this function send an email for the status change?


texts: How to set and query custom user attributes in Magento?

texts:
I have to generate a report that contains a custom attribute set on the user session.

Here is how the attribute is being set:

$customer = Mage::getSingleton('customer/session')->getCustomer();
$customer->setData('mynewattribute', $value )->save();

From what I've read, it appears that this value can only be accessed for logged in users. Is that true? Is there no way for me to generate an admin report containing mynewattribute for logged out users? If not, how can I change this code to store the mynewattribute attribute permanently in the database in a way that can be queried, instead of to the session?


texts: Where does magento subtract from stock when purchase is made?

texts:
Where does magento actually subtract from product stock when purchase is made? (v. 1.9)

After many unreliable attempts to come up with a solution, I think the best option (reluctantly) will be to modify the code where Magento updates the stock qty when a purchase is made.


texts: After installing EE 1.13 I get a 404 error when trying to manage RMA


texts: How to hide credit card details on invoice PDF?

texts:
I don't want to display the credit card details on invoice PDF.

How can I achieve this programmatically? In which file should I do the modification?

Please check the attached image


texts: Customer Collection Object Not Instantiated

texts:
This might be a stupid question :)
Mage_Customer_Model_Convert_Parser_Customer has the following method:

protected $_collections;

public function getCollection($storeId)
{
    if (!isset($this->_collections[$storeId])) {
        $this->_collections[$storeId] = Mage::getResourceModel('customer/customer_collection');
        $this->_collections[$storeId]->getEntity()->setStore($storeId);
    }
    return $this->_collections[$storeId];
}

I am writing a custom Observer. I emulate the code above as follows:

class Jongosi_Module_Model_Observer
{
    protected $_collections;
    public function getCustomerCollection($storeId = 1)
    {
        if (!isset($this->_collections[$storeId])) {
            $this->_collections[$storeId] = Mage::getResourceModel('customer/customer_collection');
            $this->_collections[$storeId]->getEntity()->setStore($storeId);
        }
        return $this->_collections[$storeId];
    }
}

Obviously, my class doesn't extend anything. I get the following instantiation error:

Call to a member function getEntity() on a non-object in ... on line 8

But the object is instantiated on line 7, yes?

What am I not doing? Thanks.

~ edit ~

The following does work though, unsurprisingly:

class Jongosi_Module_Model_Observer
{
    protected $_collections;
    public function getCustomerCollection($storeId = 1)
    {
        if (!isset($this->_collections[$storeId])) {
            $test = Mage::getResourceModel('customer/customer_collection');
            foreach ($test as $t) {
                var_dump($t->getData());
            }
        }
        return $this->_collections[$storeId];
    }
}

The observer is called by the controller_action_predispatch event in my config.xml file as follows:

...
<frontend>
    <events>
        <controller_action_predispatch>
            <observers>
                <jongosi_module>
                    <class>jongosi_module/observer</class>
                    <method>getCustomerCollection</method>
                </jongosi_module>
            </observers>
        </controller_action_predispatch>
    </events>
</frontend>
...

I am obviously going to change the method that is called, but I was starting with baby steps :) This code is all part of a custom module.


texts:
I have two magento accounts and i am fetching order with below route :

  ("/rest/V1/customers/search?searchCriteria[page_size]=20000&searchCriteria[current_page]=1&searchCriteria[filter_groups][0][filters][0][field]=created_at&searchCriteria[filter_groups][0][filters][0][value]=#{start_time}&searchCriteria[filter_groups][0][filters][0][condition_type]=from&searchCriteria[filter_groups][1][filters][1][field]=created_at&searchCriteria[filter_groups][1][filters][1][value]=#{end_time}&searchCriteria[filter_groups][1][filters][1][condition_type]=to")

my issue is i am not getting six months old order data in one of my account whereas with same search criteria i am getting orders .

Thanks!


texts: Observer not called on promo code apply button

texts: I want to add a product to cart when a coupon is applied. I have created an observer and inside the execute method written code to fetch promo code.  Also I have declared this event -controller_action_predispatch_checkout_cart_couponPost in events.xml but on click of apply button, observer is not triggering.


texts: Modifying a select to associate simple product sales to the configurable

texts:
This question stems from my other recent question on here where I was trying to create a best sellers block on the Magento homepage.

I'm not sure if there is a best way of handling this.

I have the following function to get a list of the best sellers:-

public function getBestsellerProducts()
{
    $storeId = (int) Mage::app()->getStore()->getId();

    // Date
    $date = new Zend_Date();
    $toDate = $date->setDay(1)->getDate()->get('Y-MM-dd');
    $fromDate = $date->subMonth(1)->getDate()->get('Y-MM-dd');

    $collection = Mage::getResourceModel('catalog/product_collection')
        ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
        ->addStoreFilter()
        ->addPriceData()
        ->addTaxPercents()
        ->addUrlRewrite()
        ->setPageSize(3);

    $collection->getSelect()
        ->joinLeft(
            array('aggregation' => $collection->getResource()->getTable('sales/bestsellers_aggregated_monthly')),
            "e.entity_id = aggregation.product_id AND aggregation.store_id={$storeId} AND aggregation.period BETWEEN '{$fromDate}' AND '{$toDate}'",
            array('SUM(aggregation.qty_ordered) AS sold_quantity')
        )
        ->group('e.entity_id')
        ->order(array('sold_quantity DESC', 'e.created_at'));

    Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
    //Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($collection);

    return $collection;
}

You will notice that the filter for visible products only is commented out. Many websites show configurable products in the frontend that have many associated products set to not visible individually. All the sales reported on the configurable products report NULL because the sales are actually associated to the simple products and these simple products can only be shown with that line above commented out. And if this line is commented out, then the best sellers block will show simple products that aren't meant to be visible in the frontend.

Is there a way of associating the sales from a parent products simple products to the configurable by modifying the above select in the function?


texts: Magento 2 gradually slows down throughout the day

texts: I am using Magento 2.3.1 and gradually throughout a day our website will slow way down on a specific browser. If we switch browsers or computers it will be working fine again, but after some time it will gradually begin to slow down again. This is the case for Chrome, Edge and Firefox. If we clear our browser cache and Magento 2 cache, it does not fix the issue. The next day it starts all over again. It affects both the frontend and the backend. I've checked our server resources and they are not bogged down. All other websites load quickly, but ours will not. Any ideas what might be causing this?


texts: "Persistent Shopping Cart" setting not available

texts:
In Magento CE 1.5.1, the "Persistent Shopping Cart" item menu (under customers) isn't there. I have another install of Magento CE 1.5.1 on the same server that displays it normally. I've tried it under all different scopes, but it just doesn't show up.

What should I try next?


texts:
I find the update workflow always very difficult in Magento. Most likely I'm not doing it correctly ;)
I go to the Magento connect manager. I hit the 'Check for updates' button.
After a while I see new versions of the packages are available.
I'm especially interested in the Magento Core updates so I select 'Mage_All_Latest' which is now at '1.9.2.2 (stable)' and select '1.9.2.3' in the select box.
Now I click the 'Submit changes' button and I wait.
The progress box is filled with messages about lib_* packages and other core packages not compatible with '1.9.2.3'

Isn't this the appropriate work flow? If not what is the use of the Connect Manager? I remember having the same issue when upgrading from 1.9.1 to 1.9.2.2 but evantually got it working. I don't remember how it did that, though ;)


texts: 1500 different catalogs in Magento. How to achieve this?

texts:
I'm architecting a solution to a customer that have the following requisites:

It will sell a catalog of products for 3 different public.
Each public will see different prices for the same products (it could be added more than once, if needed)
The customer groups would be identified after login or some kind of validation
One of this public (or group) could have up to 1500 different prices. The system will determine which catalog the user will see.

Given that, I thought about some possible solutions, but I guess there are limitations (mainly by performance).

Use customer groups and price group per product

Cons: load 1500 customer groups at the dropdown could be a problem / slow to process that

Use customer groups and catalog price rule

Cons: As far as I know, catalog rules with large catalog can shut down a store with performance issues.

Use Magento Enterprise Customer Segment and segment by customer attribute (customer group, or other customer attribute)

Cons: Performance could be a problem.

Use multi website approach and create different URL's

Cons: not sure how magento would handle 1500 websites with different catalogs / I can't imagine 1500 flat catalog tables / I can't imagine 1500 website options in configuration scope dropdown ( +1500 views scope option)

The questions are:

Does anyone has faced with this kind of challenge?
Did you succeed on doing that with Magento?
Can anyone share other approaches or interpretations about it?