texts: Currency conversion from 3 character code (USD) to their symbol as output ($) in magento 2?

texts:
Does magento 2 is having something inbuilt function for currency symbol getting ?
What I want is - Input will be 3 characters currency code as USD, INR, JPY, EUR etc.  corresponsing to that output should be $ , ₹ , ¥  etc...

All the solutions are appreciated even if its inbuilt in magento 2 or custom function or some API.
Edit - Code Added
At the position echo $ocd; it gives me USD after that I need to print $, it may give Euro then I need to echo € and so on..
$detail_query_1="SELECT a.quote_id,a.entity_id,a.state,a.status,a.coupon_code,a.shipping_description,a.order_currency_code,a.discount_amount,a.customer_id,a.base_discount_amount,a.base_grand_total,a.base_shipping_amount,DATE_FORMAT(a.created_at,'%d-%m-%Y') AS order_date,a.total_item_count,b.increment_id FROM rpt_sales_order AS a JOIN rpt_sales_order_grid AS b ON a.entity_id=b.entity_id WHERE 1 AND b.increment_id='$ids'";
 //echo $detail_query_1;//exit;
 $sql_detail_1=mysqli_query($con,$detail_query_1) or die(mysqli_error($con));
 if(@mysqli_num_rows($sql_detail_1))
 {
  $cnt1=@mysqli_num_rows($sql_detail_1);
  while($rt_details_1=mysqli_fetch_array($sql_detail_1,MYSQLI_ASSOC))
  {
   #print_r($rt_details);exit;
   $ordDt=$rt_details_1['order_date'];
   $shpDesc=$rt_details_1['shipping_description'];
   $ocd=  $rt_details_1['order_currency_code'];
   echo $ocd;
   $discount_amount=  $rt_details_1['discount_amount'];
  }

echo '
Shipping Method: '.$shpDesc.'
';
 }

Thanks
Vibhore


texts: How to set an anchor tag in Customer/controllers/AccountController.php in Magento 1.9?

texts:
I have set anchor tag for that, but anchor tag is not working.

How to set an anchor tag? Please suggest.

Thank you.


texts: Upgrade script - Create new select attribute with options

texts:
I would like to create a new product attribute with some predefined options using an upgrade script.

I have an upgrade script working, so the only thing i dont know how to do is to add the drop down options along with the attribute.

I am adding my attribute inside my modules upgrade script using the following:

$installer->addAttribute('catalog_product', "shirt_size", array(
    'type'       => 'int',
    'input'      => 'select',
    'label'      => 'Shirt Size',
    'sort_order' => 1000,
    'required'   => false,
    'global'     => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
));

How can I add 3 options along with it: small, medium and large?

I do not want to use a custom source model.  I want normal options


texts: Magento 2 - How to add logo and link to payment method in checkout?

texts:
I am using Amazon Pay. Currently it looks like this in the checkout:

I need to add a logo and a link pointing to the info page about amazon pay:

I solved it with a workaround by adding a javascript at the bottom of the page...
but this is not clean enough. How can I solve it the proper way? I was not able to find the template.
Thank you!


texts: Add two methods to the same event in the observer

texts:
Hi I need help with the following

I created a new method in for sales/model/observer.php as follows

class Company_Sales_Model_Observer
{

    public function addid(Varien_Event_Observer $observer)
    {
       <code to write in the log file>
    }
}

There is already another method registered in the config.xml file as follows

   <events>
        <sales_order_save_commit_after>
            <observers>
                <company_sales>
                    <type>singleton</type>
                    <class>company_sales/observer</class>
                    <method>processEbook</method>
                </company_sales>
            </observers>
        </sales_order_save_commit_after>
    </events>

I added the following code in the sales/etc/config.xml after the existing method registration as follows

    <events>
        <sales_order_save_commit_after>
            <observers>
                <company_sales>
                    <type>singleton</type>
                    <class>company_sales/observer</class>
                    <method>processEbook</method>
                </company_sales>
            </observers>
        </sales_order_save_commit_after>
        <sales_order_save_after>
            <observers>
                <company_sales>
                    <type>singleton</type>
                    <class>company_sales/observer</class>
                    <method>addid</method>
                </company_sales>
            </observers>
        </sales_order_save_after>
    </events>

But it is not calling the method. Where am I going wrong? Please help

Thanks!

Update: What if I want to create the method addid with the event sales_order_save_commit_after as the method ProcessEbook. How will I go about it. Thank you for your answer!


texts: Error 552 Disk Quota Exceeded - But it is not

texts:
I needed to add a line of code to my htaccess file so I downloaded it by FTP using Filezilla to my local machine

I now see that the size of the htaccess file on the server is now 0 while the one I downloaded to my machine is not

Seeing this issue is tried to upload the htaccess file back to the server from my local machine but it does not work and it gives the below error

Command: TYPE I
Response: 200 Type set to I
Command: PASV
Response: 227 Entering Passive Mode (87,76,19,25,195,177).
Command: MLSD Response: 150 Opening BINARY mode data connection for MLSD
Response: 226 Transfer complete
Command: TYPE A
Response: 200 Type set to A
Command: PASV
Response: 227 Entering Passive Mode (87,76,19,25,195,149).
Command: STOR .htaccess
Response: 150 Opening ASCII mode data connection for .htaccess
Response: 552 Transfer aborted. Disk quota exceeded
Error: File transfer failed .

I have tried freeing up some disk space but yet the same issue persists

I would be extremely greatful for any help on how to restore this


texts: Is it possible to "Refund Order to Customer's Payment Method" in Magento?

texts:
I am using Magento ver. 1.14.2.4.
I am not sure if its' possible to "Refund Order to Customer's Payment Method" in Magento ?
If yes, then it would be interesting to know how ?
I can see that there is a "refund" option given
in Order > Invoice Details Page > Click on Credit Memo > Refund.
It issues a refund.
I can see that their is a method editForm.submit();
But i am not find it in code.
Any thoughts ?


texts:
I would like to show a loader using the Magento's default loader widget on my ajax call. When user clicks the submit button I would like to show the loader for 1 second and then hide it.

I am using something like this :

<script>
    require([
        'jquery',
        'jquery/ui',
        'mage/loader',

    ], function ($, loader) {
        $(function () { // to ensure that code evaluates on page load

           $.ajax({
             ...
            })


texts: How can we display custom drop down in registration page?

texts:
I created Custom customer attribute:

 $customerSetup->addAttribute(Customer::ENTITY, 'customer_type', [

        'type'          => 'int',
        'label'         => 'Corporation Or Proproetorship',
        'input'         => 'select',
        'source'        => 'Magento\Eav\Model\Entity\Attribute\Source\Table',
        'required'      => false,
        'visible'       => true,
        'system'        => false,
        'position'      => 210,
        'system' => false,
        'option'         => ['values' => ['Corporation', 'Proproetorship']],
    ]);

    $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'customer_type')
    ->addData(['used_in_forms' => [
            'adminhtml_customer',
            'adminhtml_checkout',
            'customer_account_create',
            'customer_account_edit'
]]);

    $attribute->save();

Now I want to display in registration form; could you help me how can I do?


texts:
when i  echo

"Mage::app()->getFrontController()->getRequest()->getActionName();"

on

"checkout/onepage/success"

page it gives me values as "index".
As per url i suppose output should be "success".

I want to identify if current page is checkout success page, so i tried to use the above code, but it gives undesired output.


texts: Why does Magento 2.1.2 cron:run gives Undefined index: jobs?

texts:
When running:

/usr/bin/php /var/www/magento2/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/magento2/var/log/magento.cron.log

I get:

[Exception]
  Notice: Undefined index: jobs in /home/ubuntu/repo/project/vendor/magento/
               module-cron/Model/Config/Converter/Db.php on line 39


texts: what is the equivalent file of opcheckout.js(which is in magento 1) in magento 2

texts:
Magento 1

  /var/www/html/xxx/skin/frontend/base/default/js/opcheckout.js

Magento 2

What is the equivalent file for above one in Magento 2.


texts: How to fill the email field on checkout page (guest)?

texts:
I have developed a function to request the e-mail from the guest before going to checkout, which I keep inside the Quote of the current session, so far nice.

But when you go to checkout, the field e-mail is empty, I need to be able to fill in the e-mail field with this value.

I have accessible the value of the quote email, the problem is to write it in the email field of the checkout.

What should be the right way?


texts: Duplicate magento contact form with separate post URL?

texts:
I have duplicated magento contact form and implmented in My Account Section and its working fine, but when i submit the form its redirecting to contact us page.
How can i change the redirection url ?

Thanks


texts: Adding attribute options programmatically are not available for use immediatly

texts:
I'm creating Magento attribute options via a script, but I need to then be able to get the new ID and use it straight away in the same script.

At the moment it's not pulling the id through - if I kill the script and re-start it it picks up the created option and returns the ID, but not as part of the same script.

Here is the code I am using:

       $attr = Mage::getModel('catalog/product')->getResource()->getAttribute($key);
       if ($attr->usesSource()) {
               $vattr_id = $attr->getSource()->getOptionId($value);
       }else{
               echo "No Source";
               $vattr_id = false;
       }

    if($vattr_id){
            return $vattr_id;
    }else{

            $attr_model = Mage::getModel('catalog/resource_eav_attribute');
            $attr = $attr_model->loadByCode('catalog_product', $key);
            $attr_id = $attr->getAttributeId();

            $option['attribute_id'] = $attr_id;
            $option['value'][$value][0] = $value;
            $option['value'][$value][1] = $value;

            $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
            $setup->addAttributeOption($option);
            $attr = Mage::getModel('catalog/product')->getResource()->getAttribute($key);
            if ($attr->usesSource()) {
                   $vattr_id = $attr->getSource()->getOptionId($value);
                    echo "AttrID: $vattr_id";
            }

    }

Running this (with the required Mage::app() etc), creates the option, you can see it in the Magento backend, but the $vattr_id is NULL. If I reload the script, then it finds the attribute option in that first block as it should.

I guess it's something to do with how Magento is caching the models, but not sure where I need to look to clear these?

Thanks!


texts: Set default attribute value for existing addresses

texts:
Is there a way to create a new custom address attribute and set the default option to all existing addresses? Right now it only shows the default value when creating a new address and all existing addresses have this new attribute as null.
Thanks!


texts: "Bad Credentials" - Unable to sign in to Magento Marketplace via admin UI - upgrade to 2.0.3 fails

texts:
On the "Web Setup Wizard" there are two places to sign in:

1) Component Manager - via "Sign In" link.
2) System Config - via form.

Both forms ask for Public & Private Access Keys which I have generated as per the instructions here:

http://devdocs.magento.com/guides/v2.0/comp-mgr/prereq/prereq_auth-token.html

When I click "Sign In" button (on Component Manager page) or "Save Config" button (on System Config page) i get a message "Bad Credentials"

I have tried:

a) regenerating keys.

b) generating new keys.

c) generating a new magentocommerce.com account and generating new keys.

I have verified that I am copy/pasting the keys correctly, with no leading/trailing spaces, etc.

At the moment there is a critical update which I cannot update to because the System Upgrade requires a valid login for it to work.

Currently the system upgrade fails to download the file:

https://repo.magento.com/archives/magento/framework/magento-framework-100.0.5.0.zip

This upgrade failure requires a filesystem restore to fix and the installation is broken until the vendor/magento/framework directory is restored.

Suggestions on how to fix the login problem please?


texts: Can't save configuration after switch to production mode

texts:
After switch to production mode we set the DocumentRoot in our Apache to pub/ and seems to be working fine, however, I can't save any change in Store>Configuration, any time that I hit the Save button it keeps loading forever and never process.

Any guess?

Thanks!


texts:
I have store with de_DE localization.
I created new mass action for send invoice emails. It works. This is my code:

    protected function massAction(AbstractCollection $collection)
{
    $countSendInvoice = 0;

    foreach ($collection->getItems() as $order) {
        if (!$order->getEntityId()) {
            continue;
        }
        $dataOrder = $this->modelOrder->load($order->getEntityId());
        $invoiceCollection = $dataOrder->getInvoiceCollection();
        if($invoiceCollection->count()) {
            foreach ($invoiceCollection as $invoice) {
                if ($invoice->getState() == \Magento\Sales\Model\Order\Invoice::STATE_PAID) {
                    $this->notifyInvoice->send($invoice, true);
                    $countSendInvoice++;
                }
            }
        }

    }

    if ($countSendInvoice) {
        $this->messageManager->addSuccess(__('You have sended %1 invoice(s).', $countSendInvoice));
    } else {
        $this->messageManager->addError(__('No invoice(s) were sended.'));
    }

    $resultRedirect = $this->resultRedirectFactory->create();
    $resultRedirect->setPath($this->getComponentRefererUrl());
    return $resultRedirect;
}

But i received email only on en_US localization. When I send by standart methods from view invoice page it sended on de_DE.
How can I send invoice programmatically with right localization?


texts: Clear a ui-select dropdown field or provide an empty value

texts:
I wanted to add a little filter to a dropdown and did so with a ui-select component which works almost perfectly except once set I am struggling to then unet the value. Only other values are shown and there is no blank option.

I added this field to category_form.xml

    <field name="category_brands_root" component="Harrigo_CustomMenu/js/components/select-brand">
        <argument name="data" xsi:type="array">
            <item name="options" xsi:type="object">Harrigo\CustomMenu\Model\Category\Attribute\Source\Brands</item>
            <item name="config" xsi:type="array">
                <item name="sortOrder" xsi:type="number">60</item>
                <item name="filterOptions" xsi:type="boolean">true</item>
                <item name="multiple" xsi:type="boolean">false</item>
                <item name="dataType" xsi:type="string">string</item>
                <item name="formElement" xsi:type="string">select</item>
                <item name="label" xsi:type="string" translate="true">Assign Category to Brand Links</item>
                <item name="disableLabel" xsi:type="boolean">true</item>
            </item>
        </argument>
        <settings>
            <label translate="true">Assign Category to Brand Links</label>
            <elementTmpl>ui/grid/filters/elements/ui-select</elementTmpl>
            <componentType>field</componentType>
            <listens>
                <link name="${ $.namespace }.${ $.namespace }:responseData">setParsed</link>
            </listens>
        </settings>
        <formElements>
            <select>
                <settings>
                    <options class="Harrigo\CustomMenu\Model\Category\Attribute\Source\Brands"/>
                </settings>
            </select>
        </formElements>
    </field>

Where Harrigo_CustomMenu/js/components/select-brand.js looks like below:

define([
    'Magento_Ui/js/form/element/ui-select'
], function (Select) {
  'use strict';
  return Select.extend({
    /**
     * Parse data and set it to options.
     *
     * @param {Object} data - Response data object.
     * @returns {Object}
     */
    setParsed: function (data) {
        var option = this.parseData(data);
        if (data.error) {
            return this;
        }
        this.options([]);
        this.setOption(option);
        this.set('newOption', option);
    },
    /**
     * Normalize option object.
     *
     * @param {Object} data - Option object.
     * @returns {Object}
     */
    parseData: function (data) {
        return {
            value: data.category_brands_root.entity_id,
            label: data.category_brands_root.name
        };
    }
  });
});

My source pulls data from below:

public function getAllOptions()
{
    $attribute = $this->eavConfig->getAttribute('catalog_product', 'brand');
    $options = $attribute->getSource()->getAllOptions();
    return $options;
}

This works great as in shows all options has a working search at the top and saves fine however, this is an optional field and may need to be unset at some point. There is no empty value or way of clearing to its original state like when it initialises originally on an empty value showing "Select...".

I have got an empty value in my options array however they get hidden. The only thing I could think was something like below where a space or 0 is used (which will never match) however, bit of a botch seems messy and I do not like it:

    $attribute = $this->eavConfig->getAttribute('catalog_product', 'brand');
    $options = $attribute->getSource()->getAllOptions();
    $empty = ['value' => ' ',
                'label' => 'Select...'];
    array_unshift($options , $empty);

    return $options;

Any other ideas?


texts: I can not get data from AJAX (jQuery Widget)

texts:
I need to get data from AJAX, but the Post is empty.

<?php
namespace Namespace\Mymodule\Controller\Query;

use Magento\Framework\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;
class Custom extends \Magento\Framework\App\Action\Action
{
    protected $resultJsonFactory;

    public function __construct(
        Context  $context,
        ResultFactory $resultJsonFactory

    ) {
        $this->resultJsonFactory = $resultJsonFactory;
        parent::__construct($context);
    }

    public function execute()
    {
        var_dump($this->getRequest()->getPost());
        $resultJson = $this->resultJsonFactory->create(ResultFactory::TYPE_JSON);
        return $resultJson->setData(['success' => test]);
    }
}

In the code, Ajax enters, but Ajax does not send anything. Help me please .

define([
    'jquery',
    'jquery/ui'
], function($) {
    "use strict";
    $.widget('namespace.module', {
        options: {
            triggerEvent: 'change',
            controller: 'http://developer.loc/namespace_module/query/custom'
        },

        _create: function() {
            console.log('3333');
            this._bind();
        },

        _bind: function() {
            var self = this;
            self.element.on(self.options.triggerEvent, function() {
                console.log('2222');
                self._ajaxSubmit();

            });

        },
        _ajaxSubmit: function() {
            console.log($('[data-role="cart-item-qty"]').val());
            console.log('1111');
            console.log(this.options.controller);
            $.ajax({
                url: this.options.controller,
                data: $('[data-role="cart-item-qty"]').val(),
                type: 'post',
                dataType: 'json',

                success: function(res) {
                    alert('ajax send');
                    console.log('ajax success');
                    console.log(res);
                }
            });
        }
    });
    return $.namespace.module;
});

But if I write in the controller exit (); , then the trigger function success.


texts: Override category H1 with custom attribute - Magento 2

texts:
I would like to create a new field for category pages which I can use to override the default H1 on front-end.

Currently if have a category called 'Stuff', my breadcrumb is 'Stuff' and my H1 is 'Stuff'.

What I want is a category called 'Stuff', breadcrumb 'Stuff', and H1 'Magnificent Stuff at Great Prices!'.

So I believe I need a way to do the following:

Create new 'Custom H1' field on Category pages in back-end
If 'Custom H1' field not empty, replace default H1 with 'Custom H1'

I found this article, but it's for Magento 1. I need a M2 solution of this: https://www.designhaven.co.uk/2014/06/create-custom-category-attribute-to-override-category-h1-in-magento/


texts: Where 'salt' is setup in Magento 2 for passwords?

texts: Anyone know where can i get access the file, where I can change the salt for generating the password for Customers?


texts: Custom Module: Send email to "Super Admin(s)" when new Admin User Account is created

texts:
I'm working on a module with the following objective:

  Once a new Admin User Account is registered to the system an automated email
  should be sent to all Admin Users which have the Administrators role.

The purpose of this module is to automatically notify the Super Admin(s) that a new Admin User Account is added to the list of existing user accounts. I came up with this idea after reading this about signs of a compromised site. The module should flag unauthorized registration of Admin User Accounts.

I don't think there is such a feature available at the moment (correct me if I'm wrong). So I decided to try and create a module for this. I'm planning on making this module available for free in Magento Connect after it's finished. But since I'm not a hardcore backend developer I need some help to get there.

I want to hook to the admin_user_save_after event because this event will be triggered when creating a new Admin User (or would it be possible for malicious users to bypass this event?)

I have my module registered and my config.xml file in place. Now I need to work on my Observer.php file which is in the ../MyNamespace/MyModule/Model/ directory. But I'm not sure what code to put in my newAdminUserAlert method.

Whenever the admin_user_save_after event is triggered the method should:

Check all existing Admin Users (that already existed before the admin_user_save_after event)
Check the User Role of those Admin Users
Retrieve the email address(es) of all existing Admin Users who have the Administrators role assigned to them
Send an email to those "Super Admins"

At least I think, this is the way to go.

This is what I have got so far:

<?php
class MyNamespace_MyModule_Model_Observer
{
    public function newAdminUserAlert(Varien_Event_Observer $observer)
    {
        $adminUser = $observer->getEvent()->getObject();
    }

}

I do understand that it's quite much that I'm asking, but I also believe this functionality would help in making Magento safer.

Any input regarding this topic is appreciated (also if you think this is a bad idea), especially if you could help me write the Observer.php file.


texts: how or where can i remove add to wishlist from shopping cart?

texts:
Using 1.9.0.1

Here is the situation:

not logged in
adding some product to cart (no problem)
go to "view cart"
fields: image, description, edit, unit price, qty, subtotal, remove

Situation 2:

logged in now
adding some product to cart (no problem)
go to "view cart"
fields: image, description, edit, add to wishlist!!!, unit price, qty, subtotal, remove

How do i get rid of the add to wishlist from this?

I know i can set display none using like this:
.cart-table th:nth-child(3), .cart-table td:nth-child(3), .cart-table th:nth-child(4), .cart-table td:nth-child(4) {
display: none;
}

BUT...

when i do this it works great for when NOT LOGGED IN, and when LOGGED IN, it added an extra th so it is messed up...

Anyone know where i can safely delete that add to wishlist function from cart view?

Thanks


texts: How to include 3rd party library in Magento 2 (like php xlsx library)

texts:
How to include third party library like php xlsx library in Magento 2?

Since last 7 days I am browsing in google and I could not found any information.

Magento 2 give default framework module like parser, logger etc, I need to add export report in xlsx format in this case how to do it?


texts: Delete block in catalog_category_layered xml with filters

texts:
We have a shop and want to remove a item from our left site in our category page and only if someone uses an filter in the category. So not in de default category, only when someone chooses for instance a color.

this is what I tried:

<catalog_category_layered>
<reference name="left">
 <remove name="catalog.leftnav2" />
</reference>
</catalog_category_layered>

we want to remove the block catalog.leftnav2, and in the situation above it is deleted in also the default category.

Hope someone can help.


texts: What is the proper way to run an UpgradeSchema.php file in Magento 2?

texts:
In Magento 1, you updated a database schema (add a table, column, etc.) by creating an upgrade_v[Previous]_v[Current].php file, change the version number in the config.xml, and Magento would look in the php file and run the upgrade. This was triggered on a page view in all environments.

With Magento 2, it's unclear to me how this is designed to work: Are you supposed to update the etc/module.xml with the new setup_version number, and then within the the UpgradeSchema.php file, target the specific version number within the upgrade() method with the code to update the schema, and then manually run bin/magento setup:upgrade?

Currently when I change the setup_version number in a module locally, as soon as I hit the home page Magento throws an error (you must run bin/magento setup:upgrade), then once I've run the the setup:upgrade the homepage again errors out on a permissions issue. Once I've run chmod -R 777 on the root directory, I again get the setup:upgrade error, and after running it again I can finally view the homepage without error.

What is the best practice to update a database schema in a Magento 2 production environment? Do you need to (manually) run setup:upgrade with a deployment script?


texts:
My Registration form shows "Phone Number" is a required value, even after entering telephone correctly.

I have placed the following code in register form

<?=$this->setShowAddressFields(true);?>

and removed the "required entry" from class name of the textbox. Also set the is_required value to 0 in eav_attribute table. Then commented the following in abstract.php file

if (!Zend_Validate::is($this->getTelephone(), 'NotEmpty')) {
            $this->addError(Mage::helper('customer')->__('Please enter the telephone number.'));
        }

**

How can I save the customer details successfully???


texts: Magento CE 2.2.2: How to add images to my custom payment plugin module?

texts:
I am creating a custom payment plugin for Magento 2.2.2 For the plugin I need to add the payment icons and some other images.

How can I add images for my custom payment plugin?

I tried all the steps mentioned in Magento 2 : How to Add Image to Payment Method in Checkout but after following these steps I'm getting the following error

  Failed to load the "_/js/view/payment/method-renderer/" component.

Anyone has a solution for this? Any help  will be appreciated.


texts: I have upgraded magento 1.9 to latest magento 1.9.4.0 . In admin on product edit, when i click on the bundle item it loads a empty section but actually its has item. And when i click on add item,nothing happen but gives a console error "bOption is not defined". i am also attaching the image so that you can all have a clear idea


texts:
I can get customer address collection for each customer in front-end checkout process. What I need is I want to add a default address for all the customers in the collection. So in the onepage checkout process when the user sees select billing address dropdown list this default address should be loaded for all the customers. How to achieve this?

Any help will be appreciated.
Thank you.


texts: Google Analytics not tracking E-Commerce transaction

texts:
I have an issue with the Magento Google Analytics module on one site I have developed.

I have checked the code and compared to another site that I know works.

$this->getOrderIds() in getOrdersTrackingData() of ga.php appears to always be blank regardless of what I do.

I have manually added a real order id and this gets the data from the database and outputs it to the block correctly.

I have determined that the $orderIds variable has the correct data in

SetGoogleAnalyticsOnOrderSuccessPageViewObserver.php

I am at a loss as to why this would not be work anyone one got any ideas?


texts: How to add category name in the url of product only in category page

texts:
I need to change the product url as below,
https://shop.com/productname+sku.html.
And also add category name like this https://shop.com/categoryname+productname+sku.html in the category list page only.
How can i achieve this.


texts: There is a problem with reindexing process

texts:
I reindexed everything, except I can't get this last point to reindex, the
"Catalog URL Rewrites  Index product and categories URL rewrites ".

In exception.log I get this error message when I try to reindex it:

Exception message: SQLSTATE[42000]: Syntax error or access violation: 1139 Got error 'this version of PCRE is compiled without UTF support at offset 0' from regexp, query was: SELECT MAX(CAST(SUBSTRING(`request_path`, 33, LENGTH(`request_path`) - 32 - 5) AS SIGNED)) FROM `core_url_rewrite` WHERE (store_id = :store_id) AND (request_path LIKE :request_path) AND (request_path REGEXP '^french\\-cuff\\-cotton\\-twill\\-oxford\\-[0-9]*\\.html$')

What is the cause of this?

If I delete some of the (sample data) products mentioned in the error stack trace, I can reindex but I don't want to delete products from the database.


texts: Categories error in Varien Data Tree DB class

texts:
I keep running into this error in my Magento backend.

I changed some categories and soon after that I ran into this error:

  Fatal error: Call to a member function getId() on a non-object in
  /home/test1039/domains/sambalshop.portalserver.nl/public_html/lib/Varien/Data/Tree/Dbp.php
  on line 331

I only see the error on the categories page. The rest of my Magento environment works fine.


texts: Magento2: What is the difference between Magento 2.2 and 2.3?

texts:
What is the difference between Magento 2.2 and 2.3?

Are Magento 2.3 DB schema and coding structure same as compare to Magento 2.2?

Are Magento 2.2 extension supported with Magento 2.3?

Can we customize own extension in Magento 2.3?


texts: How to add an icon before the name of the payment method

texts:
I want to add an icon before the name of the payment method the same as PayPal (https://www.paypal.com/en_US/i/logo/PayPal_mark_37x23.gif), see the html below

<fieldset id="checkout-payment-method-load">

            <input id="p_method_migsvpc_server" value="migsvpc_server" type="radio" name="payment[method]" title="MigsVpc Server" onclick="payment.switchMethod('migsvpc_server')" class="radio" autocomplete="off">
            MigsVpc Server

        <fieldset class="form-list">
    asdfdasf

           adf You will be redirected to MIGS website when you place an order.

</fieldset>

            <input id="p_method_paypal_standard" value="paypal_standard" type="radio" name="payment[method]" title="PayPal Website Payments Standard" onclick="payment.switchMethod('paypal_standard')" class="radio" autocomplete="off">

Paypal

            <input id="p_method_cashondelivery" value="cashondelivery" type="radio" name="payment[method]" title="Cash On Delivery" onclick="payment.switchMethod('cashondelivery')" class="radio" autocomplete="off">
            Cash On Delivery

</fieldset>

I want to add an icon before migs, how can i do that? I had found this app\design\frontend\default\template\migsvpc\server\form.phtml, this only can append the icon after the name.


texts: Configurable product options to use in a loop

texts:
For a given configurable product is it possible to loop over the available product options outputing the option value and price?

For example:

foreach($configurableProduct->getOptions() as $option) {
    $price = $option->getPrice();
    $value = $option->getValue();
    $label = $option->getLabel();
}

This obviously doesnt work but is there anything similar in the codebase that can be used to get these values?


texts: adminhtml/session addError not showing after redirect

texts:
I am working on a custom magento admin module with grids. When you add a new entry, I perform custom validation and throw an error (when & if it occurs) using Mage::getSingleton('adminhtml/session')->addError() method.

The error message I set does not appear, when I redirect back to the edit form.

This is my save action on the grid controller:

public function saveAction()
{
    // Look For HTTP Post
    if ($data = $this->getRequest()->getPost())
    {
        // Load Data
        $manualOrderSyncModel = Mage::getModel('mycompany_mymodule/manualordersync')
            ->setData($data)
            ->setId($this->getRequest()->getParam('id'));

        // Anticipate Errors
        try
        {
            // Get If Order Number Is Valid
            $order = Mage::getModel('sales/order')->load($manualOrderSyncModel->getOrderNumber(), 'increment_id');
            if (null === $order->getId())
                throw new Exception('No such order exists in the system. Check that order number.');

            // Check If This Order Already Exists In Queue
            $existingManualOrderSyncModel = Mage::getModel('mycompany_mymodule/manualordersync')
                ->load($manualOrderSyncModel->getOrderNumber(), 'order_number');
            if (null !== $existingManualOrderSyncModel->getId())
            {
                // Update Existing Entry
                $existingManualOrderSyncModel
                    ->setCreatedAt(now())
                    ->setCreatedBy(Mage::getSingleton('admin/session')->getUser()->getUsername())
                    ->setIsSynced(Mycompany_Mymodule_Model_Yesno::NO)
                    ->save();
            }
            else
            {
                // Update Timestamps
                if ($manualOrderSyncModel->getCreatedAt() == NULL) {
                    $manualOrderSyncModel
                        ->setCreatedAt(now())
                        ->setCreatedBy(Mage::getSingleton('admin/session')->getUser()->getUsername());
                }
                $manualOrderSyncModel->save();
            }

            // Set Success
            Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Manual order sync updated.'));
            Mage::getSingleton('adminhtml/session')->setManualordersyncData(false);

            // Handle Redirect
            $this->_redirect('*/*/');
            return;
        }
        catch (Exception $e)
        {
            // Error
            Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
            Mage::getSingleton('adminhtml/session')->setManualordersyncData($data);
            $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
            return;
        }
    }

    // Error
    Mage::getSingleton('adminhtml/session')->addError($this->__('Invalid request - unable to find manual order sync to save.'));
    $this->_redirect('*/*/');
}

I have noticed, the issue only occurs when I do this:

// Error
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
Mage::getSingleton('adminhtml/session')->setManualordersyncData($data);
$this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
return;

However, If set error and redirect back to grid like this, the error message shows:

// Error
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
Mage::getSingleton('adminhtml/session')->setManualordersyncData($data);
$this->_redirect('*/*/');
return;

This is not ideal because I am no longer in the edit form and I have lost the old data from the form.


texts: Not able to override a Model in magento 2

texts:
I'm working on a module in Magento 2.1 and have to override validate function of this class Magento\Customer\Model\Address

This is what my di.xml contains:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
     <preference for="Magento\Customer\Model\Address\AbstractAddress" type="Mymodule\Module\Model\Address\AbstractAddress" />
</config>

and this is what my file contains:

<?php

namespace Mymodule\Module\Model\Address;

class AbstractAddress extends \Magento\Customer\Model\Address\AbstractAddress
{

    public function validate()
    {
        $errors = [];
        if (!\Zend_Validate::is($this->getFirstname(), 'NotEmpty')) {
            $errors[] = __('Please enter the first name and last name.');
        }
        return parent::validate();
    }
}

But I'm still not able to override the model.


texts: Magento 2 how to create a store, store view and root category programatically?

texts:
I was doing a research on how to create this 3 elements, I already have 1 website, but I will have a form that will fill the information of store and store view.
I found this question
https://community.magento.com/t5/Magento-2-x-Programming/Magento-2-How-to-create-website-Store-Store-view-Root-Category/td-p/87236 but I have no idea where to put that code.
For example this code for creating an store:
private function createOrUpdateGroup($groupId, $websiteId, $storeName, $storeCode)
    {
        $group = $this->groupFactory->create();
        if($groupId)
            $group->load($groupId);

        $group->setWebsiteId($websiteId);
        $group->setName($storeName);
        $group->setCode($storeCode);
        $group->save();

        return $group;
    }

Am I supposed to add this private method in the controller where I'm going to submit the form?
Greetings!


texts: Converting block to widget after magento update

texts:
A few days back I updated a magento shop from version 1.7 to 1.9.2 . I quickly realized that I had to convert all the old {{block }} shortcodes to widgets. This worked fine except for one case:

{{block type="catalog/product_featured" name="product_featured" as="product_featured" template="catalog/featured_pers.phtml}}

I can not figure out how to get this working in the new version.


texts:
I want to fetch all the simple product. The result should not include any configurable products.

Currently i am fetching using this http://host/rest/default/V1/products?searchCriteria


texts: Shopping Cart Price Rules - Category Discount Issue

texts:
Workout:

Output:

Condition :

Selected Category Product Discount -> 10%


texts:
Is there a general class that deals with image processing (mainly resizing) that just receives a path to an image, some parameters and processes and saves the image somewhere and returns the new path?
I need this to make it work for images related to my custom entities
Something like the image helper for products Magento\Catalog\Helper\Image but this looks very complicated to replicate as it's tightly coupled to the product entity.

If such a class exists in the core, I would appreciate and example on how to use.


texts: Magento 2 fails to deploy production mode

texts:
Theme installed on magento is Porto. I made change in development environment and now i am deploying production mode and view of my website goes weird.

I am running following command. I tried to deploy production mode with language as well but no success.

First I tried to deploy normally, which failed and give me following error.

*Command returned non-zero exit code: `/usr/local/php70/bin/php-cli -f /home/username/public_html/bin/magento setup:static-content:deploy -f en_US fr_FR it_IT en_AU ar_SA de_DE`*

Then i tried to deploy production with language and the system trow another message of a missing file.

*

Compilation from source: /home/username/public_html/lib/web/mage/gallery/gallery.less
    .media-width is undefined in /home/username/public_html/var/view_preprocessed/pub/static/frontend/Magento/blank/en_US/css/source/lib/_responsive.less

*


texts:
I am getting Issue while reindexing . I tried with ssh also but its not done. Can any one help me on this

http://screencast.com/t/nfSCJPMq


texts:
I am using default Magento2.2.4. The subscription is working correctly. But when I am entering an email again, it is not showing any error.
So if I enter test@test.com then I am getting subscribed in the list in admin. Which is correct. But if I enter the same email a second time, I am still getting success message, but ideally there should be a message that you are already subscribed.

Can someone help on how to fix this?


texts:
Currently, in Magento 2 the login form is visible only when I enter an email address, that only if there is an account on the system.

I want to show the login form even if the user doesn't enter his email address.


texts: How can i check all my categories have META Tags Values (Title, Desc, Keywords)

texts: I need to check my all categories have proper meta tags (title, description, keywords). Which table stored category meta tags (title, description, keywords) value.


texts:
While for regular product attributes like manufacturer, name, color, you can choose to include or exclude from search.

For product categories is not possible.

So if I go to the table "catalogsearch_fulltext", I see all the product attributes I decided to index for searches divided by | .
Example:

Anai-751|Anais Lingerie|Anais Lingerie|Anais Lingerie|Anais Lingerie|Anais Lingerie|anais - aura body black|anais - aura body black|anais - aura body black-NERO-S|anais - aura body black-NERO-XL|anais - aura body black-NERO-L|1

How can I add also product categories to that column ? So when magento searches using fulltext can also use product categories names as search indexes.


texts:
I'm trying to add widget to cms block or page but when i add it only display short code on page and not render, i tried different magento default widgets results is same

also tried using code on phtml template

echo $this->getLayout()->createBlock('cms/block')->setBlockId('home-top-cms')->toHtml()

But it also gives same results.

also checked by adding block type to system permission but still no luck, anyone know how fix this issue please


texts: Editing a product just shows a blank page

texts:
In my Magento 2.1.1, every time I edit a specific product it will just show a blank page. This page is shown after hitting the edit link.

  [2016-11-06 06:18:14] main.DEBUG: cache_invalidate: {"method":"GET","url":"site.site.ste/admin123/catalog/product/edit/id/825/key/…;:{"tags":["catalog_product"],"mode":"matchingAnyTag"},"is_exception":false} []


texts: How to change SEO page title in Magento 2

texts:
How do can you change the page <title> used within the <head> tag in Magento 2 with LayoutXML?

In Magento 1 you could use:

<reference name="head">
    <action method="setTitle"><title>Example Title</title></action>
</reference>

But I can't find a way to do this with M2, so far I've tried...

<head>
    <title>Example Title</title>
</head>


texts: Where is GetChildHtml('left') template file Or included template parts defined

texts: The local.xml and page.xml files in our theme do not specify any files for the sidebars' content, nor in the base theme which I assume this one inherits from. But there is content in both, not present in any CMS blocks or anything. Template hints won't work either


texts: Problem defining new .phtml in layout.xml (checkout_cart_item_default)

texts:
I try to "extend" in my module the checkout/cart/item/default.phtml template but do not manage to find the good definition in layout.xml

<layout version="0.1.0">
    ...

    <checkout_cart_item_default>
        <reference name="checkout.cart">
            <action method="setTemplate">
                <template>quotemodule/checkout/cart/item/default.phtml</template>
            </action>
        </reference>
    </checkout_cart_item_default>

</layout>

is not working.


texts: How can I get related product images as slider in modal,on product view page?

texts:
I want to get all product images in modal for slider. So that if product view modal is opened, the it should contain all images to swipe.(on product view page)

<?php $items = $this->getItems();?>
<?php $thumbnails = $this->getGalleryImages();?>

        <?php foreach ($items as $item): ?>

                            <?php if (count($thumbnails) > 0): ?>
                                <?php
                                // GravDept:
                                $photoswipeIndex = 0;
                                ?>

                                <?php foreach ($thumbnails as $thumbnail): ?>

                                        <a
                                        class="product-image thumbnail-list_link"
                                        href="<?php echo $this->helper('catalog/image')->init($item, 'image', $thumbnail->getFile()); ?>"
                                        title="<?php echo Mage::helper('core')->quoteEscape($thumbnail->getLabel()); ?>"data-photoswipe-index="<?php echo $photoswipeIndex; ?>">
                                            <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $thumbnail->getFile())->resize(60); ?>" alt="<?php echo $this->escapeHtml($thumbnail->getLabel()); ?>">

                                    <?php $photoswipeIndex++; ?>
                                <?php endforeach; ?>

                            <?php endif; ?>


texts: How can I remove 1000+ Magento products without seriously damaging my store?

texts:
I have a range of products that I feel are no longer required and are making my store's catalog feel bloated. These products don't rank particularly well on Google and have only generated a handful of sales. But my fear is that removing these will damage my overall site ranking with Google.

Does anyone have any tips for removing large amounts of products? What's the best procedure for doing this?


texts:
When I do an add to cart, nothing happens.
I have this error in the console:
TypeError: window.checkout is undefined

For: images.js & minicart.js

Thank you for your help.


texts: Add a custom filter to search in magento2

texts:
I'm new with Magento2, I have a problem trying to add a new filter to the search module.

For example:

I created an attribute that names: "flag" of type "text field", that will be invisible in storefront.

I have 3 products:

name     |   description  | flag

Product1 |  Description1  |  1

Product2 |  Description2  |  1

Product3 |  Description3  |  0

When I type in the search box "product", by default Magento2 returns all the products, because all matches with the
search, what I want is add a filter to the search, that only returns the products with flag = 1, so it will returns only the product 1 and 2.

I don't know what is the exactly block or model that I must override.


texts: Where are invoiced + shipped orders marked as complete?

texts:
In some (not all) cases, I want to set the status of an order to a new custom status after it has been shipped.
Where in the core code is an order updated to complete once it has been invoiced and shipped?


texts: My missing media files don't throw 404 error message

texts:
This is what I have got in my .htaccess file. But it doesn't throw 404 error for missing media files. It just shows blank page.

############################################
## always send 404 on missing files in these folders

    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

My sample url: /media/unknown.jpg

I have applied all patches. However, I don't know why I still have got 777 permission to my media folder. Any suggestion on this too?


texts: Install Magento 2.3 without multisource inventory

texts:
How can I install Magento 2.3 without the multisource inventory modules?
Do I have to require each core module instead of magento/product by hand?


texts: How to get item details of abandoned cart?

texts:
I need to add a new column to show item names (comma seperated) in Abandoned cart grid. Which tables to be join with the parent collection to get item names ?
Any suggestions will be appreciated.


texts:
I have inherited a couple of old Magento 1 sites and there is a difference between the WebShopApps Matrix Rate extensions.  One shows as Webshopapps_Matrixrate and the other shows as Webshopapps_Productmatrix.

Are these the same extension?
Webshopapps_Matrixrate an updated version of Webshopapps_Productmatrix

I can't find any information on this on the WebShopApps site.


texts: Magento 2 : How to Set custom Discount from controller?

texts:
I am developing module which set discount to total , Whenever customer will press Get Discount.

I can able to reduce Subtotal and GrandTotal in customer quote, Also my quote table is getting updated.

Check my controller below.

public function execute()
{
        echo "<pre>";

        $label          = 'My Custom Discount';
        $discountAmount = 10;

        $quoteSession = $this->salesQuote->getQuote()->getData();
        $quoteId = $quoteSession['entity_id'];

        $quote = $this->quoteFactory->create()->load($quoteId);
       // print_r($quote->getData()); exit;

         $quote->setSubtotal($quote->getSubtotal() - $discountAmount);
       $quote->setBaseSubtotal($quote->getBaseSubtotal() - $discountAmount);

       $quote->setSubtotalWithDiscount($quote->getSubtotalWithDiscount() - $discountAmount);
       $quote->setBaseSubtotalWithDiscount($quote->getBaseSubtotalWithDiscount() - $discountAmount);

       $quote->setGrandTotal(30);
       $quote->setBaseGrandTotal(30);

       $quote->save();

But how can i render my Updated Grand Total at Cart Page as well as other further steps like checkout, Invoice, etc etc.

I am stuck here, No ideas what is next step !!

Any help would be really great.


texts: What is difference between these models and design patterns used in Magento?

texts:
Yes, I know this question has many answers in google, but please clear my confusion.

What is the difference between Repository and Factory, and when should We use a Repository vs a Factory in Magento 2?

In Magento 2, what is the difference between plugin and observer? When should we use a plugin vs an observer in Magento 2?

What is the difference between quote/quote Items and order/order Items, and when should we use one over the other?

If possible, please explain with a short example. We would be grateful to you!


texts: Adding a JavaScript Module to the homepage

texts:
I've followed the DevDoc on How to Add a JavaScript Module (Magento 2.2) and it works fine. However, I can't get it to work on my Magento site homepage. I added

  /app/code/Learning/Js/view/frontend/layout/cms_index_index.xml

with the same code as the sample catalog_product_view.xml and I can see that the relevant code appears in my homepage source viewed from a browser. However, the JavaScript fails to run.

  catalog_product_view.xml / cms_index_index.xml

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Magento\Framework\View\Element\Template" template="Learning_Js::hello.phtml" />
        </referenceContainer>
    </body>
    </page>

You can view the test site homepage at http://magento.onlinekit.co.uk/ and the working Module at http://magento.onlinekit.co.uk/surridge-adult-century-3-4-sleeve-cricket-shirt (it displays a 'Hello World' alert).

Any help would be appreciated.


texts: Magento Testing - Check qty called to Mage::getModel('class')->doSomething

texts:
I'd like to write a test to check that ->performAction() is called once on a childModel of this class when I call doSomething in my PHPunit test.

Since it's passed in as a alias thats later passed into Mage::getModel (so that others can update the aliases via observers before doSomething is called) i'm struggling.

I can get it to work as I want if I just pass the Models in directly (rather than their aliases) and then using a Stub/Spy to store how many times it's called and checking that value, but that means the model will be loaded even if it's updated via an observer to a different one before the doSomething().

The other option I can think of is to just pass in an alias to a Stub/Spy but that would have to go in my /Model directory and I don't think I want a stub in there.

Is there a good way to do this, or a better way to write this code so that I can test it easily.

<?php
class Namespace_ModuleName_Model_SomeClassIdLikeToTest
{
    private $_childModels;

    public function __construct($childModels)
    {
        $this->_childModels = $childModels;
    }

    public function doSomething($values)
    {
        $this->_doSomethingPrivate($values);
    }

    private function _doSomethingPrivate($values)
    {
        foreach ($this->_childModels as $modelAlias) {
            $model = Mage::getModel($modelAlias);
            if (is_callable(array($model, 'performAction'))) {
                $model->performAction($values); //I want to check this is called once.
            }
        }
    }
}


texts: Free Shipping Applied for all Products, How to Restrict for selected Products in magento 1.9

texts:
I followed this tutorial for free shipping, but free shipping applies to all products. Almost tried 3 weeks, still not getting any single loop. Those who certified in Magento pls help.
How can I solve this?


texts: Magento - Storing all images on cdn not my hosting server

texts:
I am new to magento and i have just starting setting up my first sites. One of the requirements i am after is to store all images files on a seperate server from which the site is hosted on. I have briefly looked into amazon cloudfront and the following plugin:

http://www.magentocommerce.com/magento-connect/cloudfront-cdn.html

This works alongside my cloudfront distribution setup so the images are being accessed from the cdn alongside the js,css etc when i check the source. My issue is they still reside on my own server too.

Is there a way to have everything just on a cdn so that my server disk space can be kept as low as possible with only the template files on there, no images?


texts: How to add fields to new custom module page in magento 2

texts:
Here the registration fields
i need this fields to new custom module pages
how to do ??
can i inherit this all fields

need fields

1.phone no
2.company
3.street address

note:
  this all fields attributes are same


texts: Difference between php bin/magento and bin/magento

texts:
In Magento when we run any command we use 'php bin/magento' and sometimes it runs also with 'bin/magento'

So can any one explain what is the actual difference in these commands.


texts:
This is Magento 1.9.2.4 out of the box without any other custom changes. I discovered today in Magento Admin Panel -> Customers -> Customer View tab -> Personal Information section that "Last Logged In" shows a wrong year. For example:

Last Logged In: Jul 21, 9200 6:00:55 PM (Offline)

As you can see the year has a problem. Everything was working great last week I suspect this is happening from the operating system on the server not from Magento. Without no updates or changes in the code (I am the only one having access as root to this server) this is the only reason I suspect.

Did anyone have this issue before?


texts: How to filter 'reports/product_collection' by user group id or customer group id. My code is here,

texts:
$storeId = Mage::app()->getStore()->getId();
        $customerGroupId = Mage::getSingleton('customer/session')->getCustomer()->getGroupId();
        $productsIds = Mage::getModel('amgroupcat/usergroup')->getProducts($customerGroupId);
        $products = Mage::getResourceModel('reports/product_collection')
            ->addOrderedQty()
            ->addAttributeToSelect('*')
            ->addAttributeToSelect(array('name', 'price', 'small_image'))
            ->setStoreId($storeId)
            ->addStoreFilter($storeId)
            ->addFieldToFilter('entity_id', array('in' => $productsIds))
            ->setOrder('ordered_qty', 'desc'); // most best sellers on top
        Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($products);
        Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($products);

I have used this ->addAttributeToFilter('group_id', array('in' => $customerGroupId)) and ->addAttributeToFilter('customer_group_id', array('in' => $customerGroupId)) but not work and showing this error Fatal error: Call to a member function getBackend() on boolean in /data/htdocs/public_html/latitude/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 816.


texts: How can we disable past dates from date input field in admin?

texts:
I am using below code to add date field in one of the admin forms.

$fieldset->addField('newsletter_date', 'date', array(
    'label'     => Mage::helper('masters')->__('Send At'),
    'class'     => 'required-entry',
    'required'  => true,
    'name'      => 'newsletter_date',
    'format' => 'MM/dd/yyyy HH:mm',
    'image' => $this->getSkinUrl('images/grid-cal.gif'),
    'time' =>   'true'
));

How I can disable past dates from newsletter_date field?


texts: Large configurable products are causing Internal Server Error on category page

texts:
When I add product with large amount of configurations it causes category to return Internal Server Error Page:

Product 1 - 184 subproducts - works

Product 2 - 124 subproducts - works

Product 3 - 4518 subproducts - causes Internal Server Error

Any clues why this might happen? All the other subpages are working fine.


texts:
in vendor.xml file
Difference between

<catalog_category_default >
        <reference name="content">
            <block type="vendor/vendor" name="vendor" template="vendor/vendor.phtml" />
        </reference>
    </catalog_category_default>

and

<catalog_category_view>
        <reference name="content">
            <block type="vendor/vendor" name="vendor" template="vendor/vendor.phtml" />
        </reference>
    </catalog_category_view>

both are showing my vendor form on all category page but what they have diff..

I want to show a vendor block on particular category. how i show.....


texts: How to override protected _prepareLayout function in block in Magento 2?

texts:
I wanted to make changes in _prepareLayout() in block.
Code is as follow:

  Block: Magento\Catalog\Block\Category\View

protected function _prepareLayout()
{
    parent::_prepareLayout();

    $this->getLayout()->createBlock(\Magento\Catalog\Block\Breadcrumbs::class);

    $category = $this->getCurrentCategory();
    if ($category) {
        $title = $category->getMetaTitle();
        if ($title) {
            $this->pageConfig->getTitle()->set($title);
        }
        $description = $category->getMetaDescription();
        if ($description) {
            $this->pageConfig->setDescription($description);
        }
        $keywords = $category->getMetaKeywords();
        if ($keywords) {
            $this->pageConfig->setKeywords($keywords);
        }
        if ($this->_categoryHelper->canUseCanonicalTag()) {
            $this->pageConfig->addRemotePageAsset(
                $category->getUrl(),
                'canonical',
                ['attributes' => ['rel' => 'canonical']]
            );
        }

        $pageMainTitle = $this->getLayout()->getBlock('page.main.title');
        if ($pageMainTitle) {
            $pageMainTitle->setPageTitle($this->getCurrentCategory()->getName());
        }
    }

    return $this;
}

As per above code, I want to make change in below data:

if ($this->_categoryHelper->canUseCanonicalTag()) {
      $this->pageConfig->addRemotePageAsset(
          $category->getUrl(),
          'canonical',
          ['attributes' => ['rel' => 'canonical']]
      );
}

Help me to change the parameter passed to addRemotePageAsset() by overriding block.


texts: Does magento 2 have built in timing component like symfony stopwatch?

texts:
Does magento 2 have a built in timer component like Symfony Stopwatch?

https://symfony.com/doc/current/components/stopwatch.html

Would be useful for console commands / cron tasks.

I'm aware that I can load things in but wondered if something already exists and I try not to reinvent the wheel.

I've had a quick scan of the codebase and can't find anything obvious.


texts: How to perform auto-login in Magento2 admin?

texts:
For M1 i had a php file which took care of logging into admin, now i need the same for M2 but i can't get it to work.

This is my external file:

use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';

class TestApp
    extends \Magento\Framework\App\Http
    implements \Magento\Framework\AppInterface {

    public function launch()
    {
        $areaCode = 'adminhtml';
        $username = 'admin';
        $this->_state->setAreaCode($areaCode);
        $this->_objectManager->configure($this->_configLoader->load($areaCode));

        /** @var \Magento\User\Model\User $user */
        $user = $this->_objectManager->get('Magento\User\Model\User')->loadByUsername($username);

        /** @var \Magento\Backend\Model\Auth\Session $session */
        $session = $this->_objectManager->get('Magento\Backend\Model\Auth\Session');
        $session->setUser($user);
        $session->processLogin();

        if ($session->isLoggedIn()) {
            /** @var \Magento\Backend\Model\UrlInterface $backendUrl */
            $backendUrl = $this->_objectManager->get('Magento\Backend\Model\UrlInterface');
            $path = $backendUrl->getStartupPageUrl();
            $url = $backendUrl->getUrl($path);
            $url = str_replace('autologin.php', 'index.php', $url);
            echo $url;
            //header('Location:  '.$url);
        } else {
            echo "login failed";
        }
        exit;
    }
}

$bootstrap = Bootstrap::create(BP, $_SERVER);
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('TestApp');
$bootstrap->run($app);

The session returns isLoggedIn = true and i receive the URL:
http://local.domain.dev/index.php/admin/admin/dashboard/index/key/2e3a171171d22a5c2331780f874911ba95824f6a6d0e73894771bf9a40f26ce9/

If i visit that link or if i enable the header() part, i receive the login form :(

I see that i'm missing a cookie (which is set when login form is shown) and i traced it to Magento\Backend\Model\Session\AdminConfig but i'm a bit lost putting them together.


texts: Configurable Product options box not showing on the front end

texts:
The drop down selection box is not showing for configurable products, the configurable product itself is showing but not the options to choose which simple product is selected.

It is probably notable that I am using the latest version of the organic internet SCP (Simple Configurable Products) Module.

I have made sure of the following:

Both the simple and configurable products are enabled.
Both the simple and configurable products are in stock.
The Simple Products have 1 quantity in stock.
The Configurable product has associated simple products.
Configurable Attribute is set for all product types.
Configurable Attribute is in the correct Attribute Set.
Configurable Attribute has options.
Configurable product is visible in catalogue and Search.

My Problem is the same as this thread.

http://www.magentocommerce.com/boards/viewthread/38811/

Please Help me avoid further hair loss.

Thanks


texts: How Can I Apply TAX Rule Based On Individual SKU Wise - Taxable Goods

texts: I need to apply the tax rate for my all products with the unique tax rate, Tax rate different from each other, I mean all products have the own tax rate. How can I solve it?


texts: How can you add attributes to title tags?

texts:
Is there a way to have the manufacturer or color attribute when you select these attributes from our sidebar? So it would be like, you clicked "Sony" and are now on a Sony page of products. So the  tag would then be "Sony | Our Company Name" or "Black | Sony | Our Company Name" because you then clicked "black" from our sidebar?

Is this possible? Right now we have a ton of duplicate titles that I've never noticed until now.


texts: Adminhtml Grid AJAX Refresh Makes Massaction Redirect To Dash

texts:
Formerly Entitled - Adminhtml Mass Action Occasionally Fails To Reach Controller

I have an admin module that features a custom grid widget with a few custom mass actions.  If I filter the grid, change the size of the grid, or go to a different page the grid will reload via AJAX.  All seems serene.  But if I then attempt to trigger a mass action, the next thing I see is the dash.  After a visit to the dash I'll find that the action failed, the second attempt always succeeds.

To confirm that it wasn't just the action failing I added a die() at the very top of the action.

I'm at a loss.

UPDATE - 11 December

This problem is triggered by AJAX refreshes.  It is possible to repeat as soon as an admin session is begun, and the mass action, while not trivial, is not timing out.  Additionally this is being tested in a single-user development environment, and so server load is not a concern.  I believe that Marius's thought about the form key becoming invalidated is correct.  However I have not been able to locate anything to allow me to update the form keys.

I was unable to set the secret key requirement through the admin (I got what looked like a Zend_Debug::dump() die;).  After messing directly with the database, I can confirm that the admin's cryptographic nonce is not the source of this problem.


texts: Migration for static blocks to move from local to stagging

texts: I am working on Magento 1.7 and have very little experience with magento. I created few blocks and pages now I want to add them to staging site. but the staging Database is different form my local Database as there is some other peoples are also working on same project so what will the write way to migrate my local static blocks to staging site. any module or any database migration ? Any help will be appreciated.


texts: Magento 1.13.1.0 Full page cache files not generated

texts:
I am  using Magento 1.13.1.0 and enable full page cache from admin.
It seems the page speed is good but there is no files generated under /var/full_page_cache.
I check the folder permission and its set to 777 , /var folder permission is also set to 777.
If I remove this folder, Magento recreates this folder automatically,  but no files are generated under this folder. Some of the folder is showing the usergroup as root:root while some of the folder shows apache:apache. full_page_cache folder is showing apache:apache as usergroup.

Any idea what could be the problem?

Thanks


texts: Magento 2 - AddAttributeToSelect("customattr") only returns products where customattr is not null

texts:
I have added an extra sort by option to my magento 2 store which uses the price divided by a unit_of_sale attribute to sort the catalog by an each price.

The sort works in a lot of categories from what i can tell however some show no or less products when sorted by this option:

Code for the collection below:

case 'each_price':
                if ( $this->getCurrentDirection() == 'desc' ) {
                    $this->_collection
                        ->addAttributeToSelect('unit_of_sale', 'catalog_product_entity_varchar')
                        ->getSelect()
                        ->order(new \Zend_Db_Expr('price_index.min_price / IF(unit_of_sale = NULL, 1, unit_of_sale) DESC'));
                } elseif ( $this->getCurrentDirection() == 'asc' ) {
                    $this->_collection
                        ->addAttributeToSelect('unit_of_sale', 'catalog_product_entity_varchar')
                        ->getSelect()
                        ->order(new \Zend_Db_Expr('price_index.min_price / IF(unit_of_sale = NULL, 1, unit_of_sale) ASC'));
                }
                break;

UPDATE

Products that have no unit_of_sale set set are removed from the collection. How can i add the attribute so that I can run this simple calculation for sort but without removing items where unit_of_sale are null?


texts: How to update/customize/override Magento 2 css styles

texts:
So I followed the Magento 2 Docs to create my theme for the store.

Step 1: I have created directories
app/design/frontend/<Vendor>/<theme>/
├── web/
│ ├── css/
│ │ ├── source/
│ ├── fonts/
│ ├── images/
│ ├── js/

Step 2: Added registration.php and theme.xml fiels
...
├── registration.php
├── theme.xml

Registration.php
<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/<Vendor>/<theme>',
    __DIR__
);

theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
     <title>New theme</title>
     <parent>Magento/luma</parent>
 </theme>

Step 3: Applied and configured a theme in Admin, to ex.(New theme)

Now this is where I having a problem.
Lets say for example I want to override default css style for class .logo which is.logo {margin: -8px auto 25px 0;} to .logo {margin: 0;}

How would i properly do that? Do I need to create _styles.less and stick that with updated css in to the app/design/frontend/<Vendor>/<theme>/web/css/ or create app/design/frontend/<Vendor>/<theme>/web/css/source/_extend.less or there is other way?

Any help is really appreciated.


texts: Source model not found error message when exporting customer info

texts:
Hello good people of Stack Exchange.

Our small business has recently transferred our website to a new Magento hosting agency and we are experiencing an issue with the functionality for exporting customer information.

The process should be straight-forward:

http://www.magentocommerce.com/knowledge-base/entry/exporting-product-or-customer-information

However, when we select the entity type from the drop-down menu the page hangs on the 'Please wait...' message and the following error message appears:

Source model "donation/eav_attribute_source_giftaid" not found for attribute "giftaid"

We are a retail business so a giftaid message (which I assume relates to a charity setup) makes little sense to us.

We have flagged this issue with our agency but they haven't provided us with an answer and we need to get this functionality working.

If anyone with Magento experience could shed some light on the situation and offer any potential fixes it would be greatly appreciated.

Many thanks all!


texts: I want to add an example phone number as placeholder for phone number field in billing address. How can I achieve this?


texts: Learning Magento from reviewing the core files

texts:
Prior to using Magento I had only used procedural programming techniques (and the code I wrote was very rarely reusable), although I was aware of oo, I had never had the need to use it, let alone  use something on the scale of Magento. So I would say my learning curve has been steeper than most but now due to my lack experience in oop I have found that I have come to a bit of a standstill.

I have learnt where I should place code, how to call models, blocks etc and with the help of this book I have been able to get a grasp of oop and through the help of stackoverflow and magento.stackexchange I have created a couple of my own modules. Everything I have learnt has come via the aid of google searches, but I do keep seeing repeating advice, which I am trying to now implement that advice is "LOOK AT THE CODE, IT HAS YOUR ANSWERS". But my problem is :

How do I look at something as abstract as the code in Magento and work out what it is going to be outputted on the screen? (when I've made my modules I've tried to avoid hard coding anything, but what i created somehow doesn't seem as abstract as whats going on in the core).

An example of what i've tried to do and my thought process (in the hope i'm not over complicating this question).

I have chosen to focus on finding out how a catalog items are generated when a specific category has been clicked e.g. Home / Furniture / Bedroom

with template hints on I can see that part of the page is generated from default/template/category/view

default/template/category/view calls $this->getProductListHtml() in Mage_Catalog_Block_Category_View
$this->getProductListHtml() returns $this->getChildHtml('product_list') in Mage_Core_Block_Abstract
$this->getChildHtml('product_list') returns $this->_getChildHtml($name, $useCache) (I assume as 'product_list' was passed in earlier)

that is where I get lost. I've looked at _getChildHtml and am left wondering what is returned. How would I know if $this->_childrenHtmlCache[$name] is set? I assume that 'product_list' being passed in earlier would make it set. If that is the case the way I have read the code still leaves me with abstract terms that still don't mean anything or go anywhere (I expect there is more to review before I get to the end of a specific call).

I expected to start to see things link up for example $this->getProductListHtml() appears to be responsible for generating

view as
sort by
[number] items
image
heading
etc

but I have not found myself being led to even one of those things being called from the database (which was ultimately what I was expecting to find), what am I doing wrong?


texts: Show current product description in custom static block

texts:
I already have a working accordion static block on my product page i want to use to display the description.

Currently the description is being shown in tabs above the image which is soon to be disabled/hidden. I need to use a SQL/PHP call to get the product description in plain text and I will use a Div to style it.

Currently I am using this in my static block:

{{block type="core/template" name="description" template="custom/description.phtml"}}

And that loads this file - which i pulled from my app/design/frontend/default/milano/catalog/product/view/description.phtml:

<?php
$_description = $this->getProduct()->getDescription();
$_name = $this->getProduct()->getName();
?>
<?php if ($_description): ?>

        <?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), $_description, 'description') ?>

<?php endif; ?>

When I use this, it stops anything loading from that block down. I assume i'm calling too much or too little.

Any help is appreciated! CHEERS!


texts: Magento 2, adding desc and asec to sorter seletion

texts:
The requirement is displaying the asce and desc for each option in <select id="sorter" data-role="sorter" class="sorter-options"> . Like price asce, price desc . I changed the default code to below, option works but how trigger asce or desc while choosing the option?

in my custom theme templates/product/list/toolbar/sorter.phtml

<select id="sorter" data-role="sorter" class="sorter-options">
        <?php foreach ($block->getAvailableOrders() as $_key => $_order): ?>
            <option value="<?php /* @escapeNotVerified */
            echo $_key; ?>"
                <?php if ($block->isOrderCurrent($_key)): ?>
                    selected="selected"
                <?php endif; ?>
            >

                <?php echo $block->escapeHtml(__($_order)) ?> <a title="<?php /* @escapeNotVerified */
                echo __('Set Ascending Direction') ?>" href="#" class="action sorter-action sort-desc"
                                                                 data-role="direction-switcher" data-value="asc">
                    <?php /* @escapeNotVerified */
                        echo __('Set Ascending Direction') ?>

            <option value="<?php /* @escapeNotVerified */
            echo $_key; ?>"
                <?php if ($block->isOrderCurrent($_key)): ?>
                    selected="selected"
                <?php endif; ?>
            >
                <?php echo $block->escapeHtml(__($_order)) ?> <a title="<?php /* @escapeNotVerified */
                echo __('Set Descending Direction') ?>" href="#" class="action sorter-action sort-asc"
                                                                 data-role="direction-switcher" data-value="desc">
                    <?php /* @escapeNotVerified */
                        echo __('Set Descending Direction') ?>

            </option>
        <?php endforeach; ?>
    </select>


texts:
Im creating a module where in the admin i have created options to enable/disable a block in the header.

So i planned on using ifconfig to show the block or not depending on the admin value.

Ive declared the block and it shows as should but im struggling to get the ifconfig to work. I understand it can only be used on action tags.

So my question is how do i show my block depending on  the config value?

Heres my current xml:

<reference name="header">
        <block name="untitled.social.footer.links" as="social_footer" template="untitled/social/links.phtml"/>
        <action method="setChild" ifconfig="untitled_social/platforms/footer_enabled">
            <alias>social_footer</alias>
            <block>untitled_social/platforms</block>
        </action>
</reference>

This doesnt work at the moment, so where am i going wrong?

Cheers

** EDIT **

Following Johnathon's suggestions below if have amended my code which now looks like this:

Layout XML

    <layout>
    <default>
        <reference name="footer">
            <action method="setChild" ifconfig="social/platforms/footer_enabled">
                <alias>social_footer</alias>
                <block>untitled_social/platforms</block>
            </action>
        </reference>
    </default>
</layout>

Construct in my block php file

public function __construct()
{
    $this->setTemplate('untitled/social/links.phtml');
}

Unfortunately it's still not showing. How can i check the returns value of the ifconfig?

Thanks


texts: How to create coupon for the Configurable Product/Products. magento2

texts:
I'm applying coupon on the configurable product like

now when I apply this coupon on the specific product then it cannot be applied and gives me an error

  The coupon code "Code-5cd3eadf39cda" is not valid.

but if I remove the Quantity as I mention in the image then the coupon works what is the probem?
Note : This coupon code works perfectly on the simple product


texts: Magento 2 : Import category product data error

texts:
I am facing below error on some category id's
when i try to export category product data using below
code
I need some advice what this code means & ways to fix this.
{"0":"Item (Magento\Catalog\Model\Product\Interceptor) with the same ID "112445" already exists.","1":"#1 Magento\Eav\Model\Entity\Collection\AbstractCollection->addItem() called at [generated/code/Magento/Catalog/Model/ResourceModel/Product/Collection/Interceptor.php:608]\n#2 Magento\Catalog\Model\ResourceModel\Product\Collection\Interceptor->addItem() called at [vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php:1138]\n#3


texts: How to update category page with custom filters, and also layered navigation, Magento 2.1

texts:
I need to update category page collection by filtering restricted SKUs. As like

$collection->getSelect()->where("`e`.`sku` IN('24-MB04', '24-MB03', '24-MB02')");

Above query gives collection exatly what i need. But it won't update pagination block and layered navigation in category page

How to achieve this thing in Magento 2

I have tried to achieve these by Plugin, below are my code files

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\Catalog\Block\Product\ListProduct">
        <plugin name="mynamespace-myextension-block-product-list"
                type="Mynamespace\Myextension\Plugin\ProductList"
                sortOrder="10" />
    </type>
</config>

And Plugin/ProductList.php

<?php
namespace Mynamespace\Myextension\Plugin;

use Magento\Framework\App\ObjectManager;
use Magento\Framework\Search\Request\EmptyRequestDataException;

class ProductList
{

    protected $scopeConfig;

    protected $_objectManager;

    protected $_catalogLayer;

    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Framework\ObjectManagerInterface $objectManager,
        \Magento\Catalog\Model\Layer\Resolver $layerResolver
        )
    {
        $this->scopeConfig = $scopeConfig;
        $this->_objectManager = $objectManager;
        $this->_catalogLayer = $layerResolver->get();
    }

    public function beforeToHtml(
        \Magento\Catalog\Block\Product\ListProduct $subject
        )
    {
        $skus = array('24-MB04', '24-MB03', '24-MB02');

        $pcollection = $this->_catalogLayer->getProductCollection()->addAttributeToFilter('sku', array('in' => $skus));

        $pcollection->getSize();
        $subject->setCollection($pcollection);
    }
}

Please advise what I am missing


texts: Magento 2.3 : Select Random Product id from Product collection

texts:
Is there any way to select random product ID from product collection object in magento 2.3

$_productCollection = $this->getProductList($catid);
How can I select random product id from this object


texts: Use ratings and reviews with custom eav entity

texts: I'm looking for a way of being able to use Reviews and Ratings with a custom eav entity. Without creating a custom table. Any ideas to put point me in the write direction ?


texts: adding "or" between proceed to checkout and Paypal button in cart

texts: Since our last upgrade to 1.9 I seem to have lost the "or" between proceed to checkout button and checkout with paypal button in my cart page. Can someone direct me as to where and how to add the proper code for this to show the word "or between these buttons. After our upgrade the paypal was above the proceed to checkout instead of below it. I have managed to get that switched around, just looks odd without or in there. Thanks


texts:
Disable the temando module-shipping-m2 then i got error
magento 2.2.6
-bash-4.2$ /opt/plesk/php/7.1/bin/php bin/magento setup:di:compile
    Compilation was started.
    Proxies code generation... 0/7 [>-------------]  14% < 1 sec 62.0 MiBPHP Fatal error:  Declaration of Temando\Shipping\Model\ResourceModel\Packaging\Collection::fetchData() must be compatible with Temando\Shipping\Model\ResourceModel\Webservice\Collection::fetchData(Magento\Framework\Api\SearchCriteriaInterface $criteria) in /var/www/html/####/httpdocs/###/vendor/temando/module-shipping-m2/Model/ResourceModel/Packaging/Collection.php on line 21
    -bash-4.2$

in /var/www/html/####/httpdocs/###/vendor/temando/module-shipping-m2/Model/ResourceModel/Packaging/Collection.php on line 21


texts: Magento 2 issues installing sample data on installed Magento 2 website

texts:
I have installed an instance of Magento 2 and I've SSH'd into my server.

I have updated the composer file by adding this into the require part:

"magento/module-catalog-sample-data": "2.1.0",
"magento/module-configurable-sample-data": "2.1.0",
"magento/module-cms-sample-data": "2.1.0",
"magento/module-sales-sample-data": "2.1.0"

I then run this:

bin/magento sampledata:deploy

But all I've getting is:

Permission denied

What do I need to do here to get the sample data installed?


texts: AOE Scheduler - No heartbeat task found. Check if cron is configured correctly

texts:
We have Magento CE 1.9.0.1 where AOE Scheduler is configured for cron, and Magento cron is set to run on system after every 30 minutes as follows and shows no issues in /var/log/cron

  */30 * * * * /usr/bin/php /home/www/vhosts/example.com/httpdocs/cron.php

But, for some reason on back-end we always see error "No heartbeat task found. Check if cron is configured correctly." like follows and all status grayed and are always set to 'PENDING'

Following are the settings for System > Schedular > Job Configuration

And following are the settings for System > Cron Configuration

If we run the cron manually via command line or via browser than "No heartbeat task found..." issue goes for some minutes but again comes in, also if settings Magento cron to run every 5 minutes it goes away! but that overlaps other running tasks so we have to run it every 30 minutes at least.

What could be the issue here with 30 minutes interval which always shows "No heartbeat task found..." and all tasks pending to grayed with PENDING status?


texts: How do I render a cms/blocks collection into attribute list from product tab Magento 2?

texts:
I have create an attribute and I want to render an cms blocks as attribute values in Magento 2. Please do provide some go on it and I have done research about it but no clue so far.
Thanks.


texts: Anyone know of a tested script to regenerate url-keys?

texts:
I have a client with a pre-existing Magento site in production mode. When the site was created the client was not informed of the importance of the url keys attribute in that he had to make it SEO-friendly. At this point all the site urls are using a number format e.g. /107 instead of something like /toys. Categories and subcategories are ok to change manually because, the aren't that many but having 1000+ products makes it impossible or at least too time consuming.

Are there any scripts out there to change the url-keys to the product name? e.g. /108 into green-power-ranger assuming the initial product name was GREEN POWER RNAGER


texts: Show multiple currencies, but transact in base currency

texts:
I'm sure I'm missing something obvious, but for my store I need customers to be able to see products in different prices (USD, EUR etc), but all transactions need to take place in GBP.

Is there a way to configure this in Magento?

Thanks!


texts:
I have added a custom grid in my Admin custom module. Now I want to add a Dropdown on the column. So meaning per records will have a dropdown for them to select from. This dropdown will contain list of templates. So basically per record/row I will choose which template I will assign for that record. Then I will have a button where it will run the update command for those record that we selected.

So my question is how can I add a dropdown for the grid table column? It's not just one dropdown. I want to add a dropdown on EVERY ROW in the grid table.

<column name="customer_lastname">
       <argument name="data" xsi:type="array">
           <item name="config" xsi:type="array">
               <item name="filter" xsi:type="string">text</item>
               <item name="label" xsi:type="string" translate="true">Last Name</item>
               <item name="sortOrder" xsi:type="number">6</item>
           </item>
       </argument>
    </column>
    <column name="customer_middlename">
       <argument name="data" xsi:type="array">
           <item name="config" xsi:type="array">
               <item name="filter" xsi:type="string">text</item>
               <item name="label" xsi:type="string" translate="true">Middle Name</item>
               <item name="sortOrder" xsi:type="number">5</item>
           </item>
       </argument>
    </column>
    <column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date" >
       <argument name="data" xsi:type="array">
           <item name="config" xsi:type="array">
               <item name="filter" xsi:type="string">dateRange</item>
               <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
               <item name="dataType" xsi:type="string">date</item>
               <item name="label" xsi:type="string" translate="true">Order Date</item>
               <item name="sortOrder" xsi:type="number">2</item>
           </item>
       </argument>
   </column>
   <actionsColumn name="actions" class="Tcm\Reports\Ui\Component\Listing\Column\Action">
       <argument name="data" xsi:type="array">
           <item name="config" xsi:type="array">
               <item name="resizeEnabled" xsi:type="boolean">false</item>
               <item name="resizeDefaultWidth" xsi:type="string">107</item>
               <item name="indexField" xsi:type="string">id</item>
           </item>
       </argument>
  </actionsColumn>


texts: How do I edit checkout page to add note under Shipping Methods header?

texts:
How do I edit the checkout page and add a
 under the Shipping Methods title?
What templete file do I edit to get this

Something like this..

Shipping Methods

Please select preferred pre-paid and added freight cost,
               your UPS or FedEx Account or Your Special Carrier


texts: Magento 2 create new tab and add customer grid collection on product add/edit page in admin

texts:
I am using magento 2.3 and i want add custom tab in Product edit page on admin and add grid collection of customer in custom tab. So any one know How i can do that.

Thank you.


texts:
We're using a custom extension that allows users to create quotes, in the more traditional sense of a quote. They put together an order, go through checkout, and save the order to their account without paying, and allowing them to order it at a later date with a set pricing. Why? I don't know exactly, but that's what it does. Now, when a user created a quote, it would decrement the stock, on the frontend that was easily resolved by having it check the

$quote->getPayment()->getMethodInstance()->getCode()

attribute. This is throwing errors in the backend though:

Order saving error: Can not retrieve payment method instance

I cannot access the getMethodInstance attribute at all from the backend checkout, so I cannot test to see if the "payment method" is a quote. I'm not too sure what I should even be troubuleshooting on this.


texts: How configurable product price works in magento 2?

texts:
As I understand, magento2 uses configurable product price for showing on front end (ie listing or product detail page) only. It does not carry the configurable product price to cart or checkout. We can not use configurable product price to sell the product because it is using its associated product price.

I want to use configurable product price instead its simple product price as it is working on magento1 website.

Can any one explain that how configurable product price works ?


texts: Print "₹" in Magento 1.9.3 Invoice using System font

texts:
I am trying to make my invoice smaller in size. Right now, I am using DejaVu font to print my invoice since that supports printing of "₹" symbol on my invoices. However, it increases the size of invoice as it gets embedded in invoice file. (See this )

I tried using Zend_Pdf_Font::FONT_TIMES_ROMAN in place of DejaVu. It indeed make my file smaller (from 1145 KB to 14 KB), but my symbol is not printed.

How can I make my file smaller in size while printing "₹" in invoices?


texts:
On my Homepage, I have a Carousel with products and Featured Products that are displaying the slider with arrows on each side. But of course, I see all breaks in IE8. Every image of a product on the carousel is displaying on a single row like there's a "display: block;" property applied. So I found styles.css in two folders, of my Interface folder but when I modify the Carousel Styles -> nothing is happening at all. I saw there are dynamically created CSS files but I'm not really familiar with that technique. So I just want to apply a different CSS file for that item slider to clean the IE8 mess. I registered my CSS file with a condition in the local.XML file. But again -> nothing happens.

Here's the store: http://dev.elmaira.bg/


texts: Continue Button not moving to next section

texts:
I was currently working on adding a module to my site that added another step to the checkout process and after a lot of time and a lot of problems popping up, I decided to delete all the files attached to said module.  Since then I've gotten everything working properly except now at the Onepage Checkout, I've gotten stuck at the Billing section.  When I press "Continue" it does not go to the next section and the page doesn't update at all.  I believe it has something to do with the onclick='billing.save()' function attached to the "Continue" button.

<?php echo $this->__('* Required Fields') ?>

    <button type="button" title="<?php echo $this->__('Continue') ?>" class="button" onclick="billing.save()"><?php echo $this->__('Continue') ?></button>

        <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>

var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
var billingForm = new VarienForm('co-billing-form');

//billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
$('billing-address-select') && billing.newAddress(!$('billing-address-select').value);

var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');

EDIT

Here's a link to my site. http://www.avantalarm.com/

NB. I am new to StackExchange and new to Magento. Let me know if I need to explain further information.  I'm very interested in learning how to phrase my questions well so I can get the most out of Stack Exchange.


texts:
Getting 503 Fetch Failed in M2. I've redis and Varnish server running along with Nginx my varnishlog says

my default.vcl

   vcl 4.0;

import std;
# The minimal Varnish version is 4.0
# For SSL offloading, pass the following header in your proxy server or load balancer: 'X-Forwarded-Proto: https'

backend default {
    .host = "localhost";
    .port = "8080";
}

acl purge {
    "localhost";
}

sub vcl_recv {
    if (req.method == "PURGE") {
        if (client.ip !~ purge) {
            return (synth(405, "Method not allowed"));
        }
        if (!req.http.X-Magento-Tags-Pattern) {
            return (synth(400, "X-Magento-Tags-Pattern header required"));
        }
        ban("obj.http.X-Magento-Tags ~ " + req.http.X-Magento-Tags-Pattern);
        return (synth(200, "Purged"));
    }

VARNISH LOG

       *   << Request  >> 32838
-   Begin          req 32837 rxreq
-   Timestamp      Start: 1468597956.246653 0.000000 0.000000
-   Timestamp      Req: 1468597956.246653 0.000000 0.000000
-   ReqStart       192.168.1.1 19182
-   ReqMethod      GET
-   ReqURL         /robots.txt
-   ReqProtocol    HTTP/1.1
-   ReqHeader      Cache-Control: no-cache
-   ReqHeader      Connection: Keep-Alive
-   ReqHeader      Pragma: no-cache
-   ReqHeader      Accept: */*
-   ReqHeader      Accept-Encoding:
-   ReqHeader      From: bingbot(at)microsoft.com
-   ReqHeader      Host: www.salon-towels.com
-   ReqHeader      User-Agent: Mozilla/5.0 (compatible; bingbot/2.0; +http://www
-   ReqHeader      X-Forwarded-For: 192.168.1.1
-   VCL_call       RECV
-   ReqURL         /robots.txt
-   VCL_return     hash
-   ReqUnset       Accept-Encoding:
-   VCL_call       HASH
-   VCL_return     lookup
-   VCL_call       MISS
-   VCL_return     fetch
-   Link           bereq 32839 fetch
-   Timestamp      Fetch: 1468597961.245436 4.998783 4.998783
-   RespProtocol   HTTP/1.1
-   RespStatus     503
-   RespReason     Backend fetch failed
-   RespHeader     Date: Fri, 15 Jul 2016 15:52:41 GMT
-   RespHeader     Server: Varnish
-   RespHeader     Content-Type: text/html; charset=utf-8
-   RespHeader     Retry-After: 5
-   RespHeader     X-Varnish: 32838
-   RespHeader     Age: 0
-   RespHeader     Via: 1.1 varnish-v4
-   VCL_call       DELIVER
-   RespUnset      Age: 0
-   RespUnset      Server: Varnish
-   RespUnset      X-Varnish: 32838
-   RespUnset      Via: 1.1 varnish-v4
-   VCL_return     deliver
-   Timestamp      Process: 1468597961.245516 4.998863 0.000080
-   RespHeader     Content-Length: 282
-   Debug          "RES_MODE 2"
-   RespHeader     Connection: keep-alive
-   Timestamp      Resp: 1468597961.245621 4.998968 0.000105
-   ReqAcct        272 0 272 175 282 457
-   End

*   << Session  >> 32837
-   Begin          sess 0 HTTP/1
-   SessOpen       192.168.1.1 19182 :80 192.168.1.34 80 1468597956.246550 15
-   Link           req 32838 rxreq
-   SessClose      REM_CLOSE 5.082