texts: Magento 2 checkout summary shipping check subtotal

texts:
I want to change the Magento_Checkout/web/template/summary/shipping.html file and add a specific line when the subtotal is below a specific value.

How can I achieve this? I already tried this, but that does not work:


texts:
I was trying to publish one extension to magento marketplace

Things are a fork of tinypng and I can see the dependency of tinypng module is automatically pulled by composer, but where they are putting those dependency?

When you download their Magento plugin, you cant find dependency in that folder, but when you install it, you can see tinify folder under vendor folder of root directory.  Here is tinypng composer.json

I think composer is pulling this folder but how?  It is not absolute link and I cant find any way to include our dependency similar to tinypng.  Any help will be great.

tinify/tinify:

{
  "name": "tinify/magento2",
  "type": "magento2-module",
  "version": "1.1.1",
  "description": "Make your web shop faster by compressing your JPEG and PNG images. This plugin automatically optimizes your images by integrating with the popular image compression services TinyJPG and TinyPNG.",
  "keywords": [
    "tinify",
    "tinypng",
    "tinyjpg",
    "compress",
    "images",
    "api",
    "magento",
    "magento2",
    "plugin",
    "module"
  ],

  "homepage": "https://tinify.com/developers",
  "license": "MIT",

  "support": {
    "email": "support@tinify.com"
  },

  "authors": [{
    "name": "Rolf Timmermans",
    "email": "rolftimmermans@voormedia.com"
  }],

  "minimum-stability": "alpha",
  "require": {
    "php": ">=5.5.0",
    "ext-curl": "*",
    "ext-json": "*",
    "tinify/tinify": ">=1.5"
  },

  "require-dev": {
    "phpunit/phpunit": "~4.0",
    "mikey179/vfsstream": "~1",
    "squizlabs/php_codesniffer": "~2.0",
    "codeception/aspect-mock": "*"
  },

  "autoload": {
    "files": ["registration.php"],
    "psr-4": {"Tinify\\Magento\\": "src"}
  }
}


texts: How create Custom Pdf in magento 2 Like invoice , Shipment

texts:
I want to create custom pdf with custom text or media

can anyone suggestion me any best link or some help
Thanks


texts: Export CSV NOT showing ALL Prods - using Magento 1.9.2.2

texts:
I'm using Magento 1.9.2.2.

When I do a Product Export CSV, NOT all the Products are exported to CSV.

However, when use the Data Profile > Export All Products, the output CSV is correct.

I prefer doing Import/Export > Export instead using DataProfiles, bcoz the output CSV is easier to analyse.

What could be the reason for this ?

Thanks


texts: Magento 2 Parent category not assigned to subcategory when programatically creating

texts:
I tried to create categories and subcategories pro-grammatically.

This is my code

use \Magento\Framework\App\Bootstrap;
include('app/bootstrap.php');
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
enter code here
$cat_2 = "new_cat";
$name_2 = ucfirst($cat_2);
$url=strtolower($cat_2);
$cleanurl = trim(preg_replace('/ +/', '', preg_replace('/[^A-Za-z0-9 ]/', '', urldecode(html_entity_decode(strip_tags($url))))));
$categoryFactory=$objectManager->get('\Magento\Catalog\Model\CategoryFactory');
/// Add a new sub category under category id 3
$categoryTmp = $categoryFactory->create();
$categoryTmp->setName($name_2);
$categoryTmp->setIsActive(true);
$categoryTmp->setUrlKey($cleanurl);
$categoryTmp->setData('description', 'description');
//echo "In IF".$cat_vals[1];
$categoryTmp->setParentId(3);
$mediaAttribute = array ('image', 'small_image', 'thumbnail');
$categoryTmp->setImage('/m2.png', $mediaAttribute, true, false);
// Path pub/media/catalog/category/m2.png
$categoryTmp->setStoreId($storeId);
$categoryTmp->setPath($rootCat->getPath());
$categoryTmp->save();

When i run this script the category is adding but category is not created under categor id 3.

What is the issue i am facing here?


texts:
I want to add an import button to an admin module. Essentially all it needs to do is bring up a file viewer and let the user select the file to run calculations on.

Do I need to declare the button in the template file? If so how do I refernce it from the block? OR do I add the button via the block only?

I'm fairly new to Magento and just trying to get my feet wet.


texts: magento 2 How to add a div in main tag with custom phtml template in custom module

texts:
I would like to add a div inside <main id="maincontent" class="page-main"> from my custom module please look at screen shoot:

Can you see a class="MYCUSTOMBLOCKHERE" in the image I need to add this div.

Any help I Appreciate. Thanks


texts: I have magento version 1.9.1.1, i have installed all previous patches except patch 6788, is it ok to install patch 7405 before 6788 or will it cause any issue..?


texts: it is possible to custom input field on admin panel?

texts:
It is possible to  custom input field on admin panel?

How can I add and remove  input field on Items ordered - Admin panel.

Admin panel > Sale > Orders > View > Order view > Items ordered


texts:
I've added a custom field to the database and admin category page. I'm calling the following in my categories.xml (and it works but it is not displaying the custom field)
<block class="Mycompany\Mymodname\Block\getMyFieldName" name="cms.page.cat.subtext"></block>

Mycompany/Mymodname/block/CatSubtext.php
<?php
namespace Mycompany\Mymodname\Block;

class CatSubtext extends \Magento\Cms\Block\Page
{
    /**
     * Prepare HTML content
     *
     * @return string
     */

    protected function _toHtml()
    {
        $src = '
test
'.$this->_filterProvider->getPageFilter()->filter($this->getPage()->getCatsbutext());
        return $src;
    }
}


texts: How to display related products on the cart page (checkout)?

texts:
I have products added to the cart who have related products.
My question: if it's possible to call and display all related products on the end of cart page (not in the cart).
thanks


texts: Prevent redirect to home page after add to cart

texts: I have an issue with the redirect after adding an item to the cart on my website (which someone else built and I now work on for my company). I turned off the automatic redirect to the cart in my Magento admin. However, when I add an item to my cart, the site now automatically goes to the home page - the product is still successfully added to the cart, but I want to remain on the current product page. From reading through other questions, it looks like the problem is that my site is customized so that the product pages are external (aka not internal to Magento). What php file do  need to customize, and what code do I need, in order to ensure that whenever the Add to Cart button is clicked on my site, the user stays on the current page?


texts: How to apply Backend Theme in Magento 2?

texts:
I have created a new admin theme under app/design/adminhtml. I verified that the new theme gets deployed as well. I am using  bin/magento setup:static-content:deploy

Unlike in the frontend there is not option in the UI to select a backend theme.

How do I tell Magento to apply my custom backend theme?


texts:
Hi I just wondered how it was easiest to provide these basic shipping rates:

Royal Mail using 2nd class signed for:

£5 on orders below £50 (being total value in basket)
£10 on orders below £175
Free over £175
Courier option £15


texts: Update sales order grid on order saving - Magento 2

texts:
I added a new attribute on order entity :

$salesSetup->addAttribute(Order::ENTITY, "shipping_date", [
    'type'     => "date",
    'label'    => "Shipping date",
    'input'    => "text",
    'user_defined' => true,
    'required' => false,
    'visible' => true
  ]);

and display it on the sales order grid

  view/adminhtml/uicomponent/sales_order_grid.xml

:

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<columns name="sales_order_columns">
    <column name="shipping_date">
        <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">Shipping Date</item>
            </item>
        </argument>
    </column>
</columns>

And when I'm saving a new order I would like to populate the sales_order_grid so I added this code in

  etc/adminhtml/di.xml:

<virtualType name="Magento\Sales\Model\ResourceModel\Order\Grid">
    <arguments>
        <argument name="columns" xsi:type="array">
            <item name="shipping_date" xsi:type="string">sales_order.shipping_date</item>
        </argument>
    </arguments>
</virtualType>

The issue is when I'm saving the order it creates a blank line in sales_order_grid table with only the shipping date filled, all other fields are NULL, where is my mistake ?


texts: CE 1.9.1 mass product update for Special Price To date

texts:
In another question thread I was recommended to do a mass product update by selecting all products and choosing "Change attributes" in order to edit the special from/to date for many products at once.

While there is no "Change attributes" item in the top right drop down, there is an "update attributes" item there. Special to date is not one of the editable attributes though. I notice it is listed as a System attribute when looking in the 'manage attributes' screen. Can Special To Date actually be mass edited in the UI in my version?

I guess one could change its value via phpMyadmin in order to make it editable. However I'd like to avoid touching the database directly, if I can.


texts: Magento 1: Frontend product review and rating count wrong display in certain pages

texts:
I am facing an error while displaying some products review and rating count in frontend for certain pages.There are 4 pages where product review and rating count is displayed(home page product slider, search page, category page and PDP). For some products the review and rating count is displaying wrong in search and category view page, and for some products its not yet displayed.
For example:

Product P1 has total 71 approved reviews

But in search and category page it will display

review count = 6

In home page product slider and PDP page its displayed correctly
But for other products its displaying correctly. I have checked at the code level, from where it gets displayed, but didn't find any thing.
Any idea that why this mismatch is happening?
Below is the code for catalogsearch result page:

<?php if($this->getResultCount()): ?>
 <?php echo (Mage::app()->getLayout()->checkVersion(array('1.9.1.x', '1.9.2.x')) ? $this->getMessagesBlock()->toHtml() : $this->getMessagesBlock()->getGroupedHtml()); ?>
 <?php if ($messages = $this->getNoteMessages()):?>

    <?php foreach ($messages as $message):?>
        <?php echo $message?>

    <?php endforeach;?>

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

<?php echo ($this->getNoResultText()) ? $this->getNoResultText() : $this->__('Your search returns no results.') ?>
 <?php if ($messages = $this->getNoteMessages()):?>
  <?php foreach ($messages as $message):?>

<?php echo $message?>
  <?php endforeach;?>
 <?php endif; ?>


texts: Cash on delivery not showing on payment page in Magento 2.3

texts: Cash on delivery payment method not showing on the payment page. I have enabled it from backend but it's still not showing. All Other payment methods are working except COD. I have gone through this solution Cash On Delivery payment method not showing in checkout page in magento 2.1.9  also but it doesn't help.


texts: getting config value in cms pages magento2

texts:
I have added a custom field in system->configuration. The code is below.

<tab id="testtab">
            Test settings
        </tab>

            Test Configuration
            <tab>testtab</tab>
            <resource>Namespace_Modulename::system_config</resource>
            <group id="settings" type="text"  sortOrder="10" showInDefault="1">
                Credentials
                <field id="key" translate="label" type="text" sortOrder="30" showInDefault="1">
                    Key
                </field>
            </group>

Now I am trying to get the data from cms page like this

  {{config path="testsection/settings/key"}}

But I cant access the value using that. Any ideas?


texts: How much risk to hacker is there from file generated by sacommands.sh in magento

texts:
Whenever you get any error in Enterprise Magento site, Magento dev team ask you to run sh sacommands.sh from root privilege and this generates something like text.txt or sa_outputs.txt file.

Should I delete it after I submit this file to magento team?

My doubt is if someone gets this file, which is easy to download, hackers will get almost my valuable information of my magento settings.

Question

How much risk is there from easy access to the text.txt files? Should I delete it?


texts: Magento 1.9.x migration on VPS error 403

texts:
I have to migrate the site in magento 1.9.4.3, multilingual, from shared hosting to VPS. On shared hosting I use cPanel, while on VPS I will use Plesk.
After a successful transfer trial I realized an error.

I state that in the root of the site I have created folders with the name of the language code of the site where inside, except for the sitemap.xml of the site with this structure:

/en/sitemap/sitemap.xml
/it/sitemap/sitemap.xml

With cPanel I have no problems, instead on the server and plesk, if I click on the site's home or on the logo, the error 403 appears; but by renaming the folders the error disappears.

I would like to eliminate this error, and while keeping the folders "en" and "it" where I store the sitemaps to be sent to search console.

How can I solve it?

Thanks


texts: Product which allows user input which take price from this

texts:
Currently working on a website were some products require user input for example Width and Height

From this the m2 price (for example 14) is done between the width and height given by the user and then the quantity is added.

What would be the best way to do this?


texts: magento2 how to stop orders to be placed if invalid credit card details. Currently, I am using Securepay the issue is even if customer enters invalid credit card details order gets placed. How can I stop this?


texts:
I'm having several issues with my site, I checked AWStats and it is showing that robots have used 18gb bandwidth this month (usual for other months is 150mb).

I was told by my server hosts to alter the robots.txt file but it is still happening, I have tried blocking individual IP addresses but it is continuing. There have been 160,000 hits by the robot this month how can

Do I stop this?


texts: New reference in page.xml not working in custom module

texts:
I have created new reference "new reference" in page.xml using this link http://inchoo.net/ecommerce/magento/custom-reference-structural-block/. When i call that reference using

  $this->getChildHtml('newrefernce') in theme pages its working.

When i call this in my own custom module (ie)in Local folder its not rendering that page.

Page.xml

> <default translate="label" module="page">
>
>  <block type="core/text_list" name="newrefernce" as="newrefernce"
> translate="label"></block>
>
> </default>

Need Help.
Thanks


texts: Control placeholder image width/height in magento 2

texts:
I can control the product images width/height in view.xml located in app/design/<vendor>/<theme>/etc in product list page. Some of the products not having images so it tries to show placeholder image. But placeholder width/height is not able to control in view.xml

<image id="category_page_grid" type="small_image">
    <width>240</width>
    <height>240</height>
 </image>
<image id="category_page_list" type="small_image">
     <width>240</width>
     <height>240</height>
</image>
<image id="product_small_image" type="small_image">
     <width>240</width>
     <height>240</height>
</image>


texts: Magento 2: How to inject classes in custom script

texts:
I am working on some custom scripts to import some data before a new store is launched. These scripts are needed only once and will not play any role after launch. They are supposed to be executed on the command line (not via browser).

In Magento 1 it was as easy as to require app/Mage.php and then get going.

In M2 whenever I need a class to do something I am supposed to inject them into another class via constructor. So my custom script becomes a class itself which is not a bad thing (a bazillion lines of spaghetti code are proving me right).

Also using the object manager directly is highly discouraged.

So I want to do it right:

use Magento\Framework\App\Bootstrap;

require __DIR__ . '/../app/bootstrap.php';
require dirname(__FILE__) . '/Attributes.php';

$bootstrap = Bootstrap::create(BP, $_SERVER);

$app = $bootstrap->createApplication('Attributes');
$bootstrap->run($app);

class Attributes extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface
{
    protected $_db;
    protected $_eav_factory;
    protected $_attribute_factory;
    protected $_store_manager;
    protected $_csv;

    public function __construct(
        \Magento\Framework\App\ResourceConnection $db,
        \Magento\Eav\Setup\EavSetupFactory $eav_factory,
        \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute_factory,
        \Magento\Store\Model\StoreManagerInterface $store_manager,
        \Magento\Framework\File\Csv $csv
    ) {
        $this->_db = $db;
        $this->_eav_factory = $eav_factory;
        $this->_attribute_factory = $attribute_factory;
        $this->_store_manager = $store_manager;
        $this->_state = $state;
        $this->_csv = $csv;
        $this->_state->setAreaCode('frontend');
    }

    public function launch()
    {
        // let the magic happen
    }
}

Above code does not work: Uncaught TypeError: Argument 1 passed to Attributes::__construct() must be an instance of Magento\Framework\App\ResourceConnection

So my question is: when I am supposed to use classes and proper dependency injection, how can I get those classes into my custom class?


texts: How To Create One Text Box At Admin Panel?

texts:
How To Create One Text Box At Admin Panel, And
If Text Box Has Enter Some Value That Display At Front End in All Products.


texts: Magento : Disable Minicart Popup When User Click on Add to Cart

texts:
I need to hide minicart popup when user clicks on Add to Cart button but when user clicks on cart icon, minicart popup need to be displayed.

is there any way to do this in Magento 1.9.2.2???


texts: Website not showing after installed supee-6788

texts:
Lately i have tried to install supee-6788 patch for my website.

But that patch is not installing. So, i found one accepted solution from here. That shows, replace .htaccess file with fresh .htaccess file. I have done same as . Now, patch was installed successfully.

Then, suddenly homepage is not showing anything.

My website is : https://www.depoto.com/


texts:
I hope someone can help.

Running Magento 1.9.1.0, website. When a customer click  at checkout page sudden there is a strange customer information and payment information popup.But I don't find this file in cpanel file manager.
Any ideas what this might be and how I can fix it?

Thank you in advance to anyone who can help.
firs


texts:
When I click on "print" button in admin area in credit-memo, then generated PDF is not displaying customer name in shipping and billing information. It is only displaying the telephone, country, city and street.

What is the problem? How can I add it?


texts: How do I show 6 product from every main category on the front page?

texts:
I want to list 6 products from every main category on the front page of my Magento (1.9) shop.

Here's a great example of what I would like it to look like:

How could I achieve this?


texts: Adding short_description to Send Product to a Friend transaction email template

texts:
I am looking for the code to include the product short description (short_description) to my customized Send Product to a Friend transnational email template.

Here is what I have so far:

Hi, {{htmlescape var=$name}}

{{var sender_name}}  sent you this via Nativitystonescollection:

{{var product_name}}

Here is {{var sender_name}}'s message:  {{var message}}

Thanks!


texts: How to recalculate shipping costs in Magento one page checkout

texts:
I have the following requirement for a shipping module in Magento:
on the shipping method step on one page checkout in Magento, the user should be able to add additional options to a particular method (are there any fragile items, pick up from warehouse, add insurance etc.).  Based on that, I have to recalculate shipping costs.  In essence, I need to get the submitted options, make an API call, and represent the new costs to the user.  Currently I have overriden Checkout_OnepageController successfully.
How can I repeat that step?


texts: Magento 2.3.2: Sort by Bestselling Minimal results

texts:
I am using custom code to implement sort by Best selling on the category page, I have created an around plugin for

<type name="Magento\Catalog\Block\Product\ProductList\Toolbar">
    <plugin name="Vnu_Catalog::addPriceDecendingFilterInToolbar" type="Vnu\Catalog\Plugin\Product\ProductList\Toolbar"/>
</type>

  Toolbar.php

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

        if ($currentOrder) {
            switch ($currentOrder) {
                case 'best_selling':
                    $subject->getCollection()->getSelect()->joinLeft(
                        'sales_order_item',
                        'e.entity_id = sales_order_item.product_id',
                        ['qty_ordered'=>'SUM(sales_order_item.qty_ordered)'])
                        ->group('e.entity_id')
                        ->order('qty_ordered desc');
                    //echo $subject->getCollection()->getSelect();die;

                    break;
                case 'price_desc':
                    $subject->getCollection()
                        ->setOrder('price', 'desc');
                    break;
                case 'price':
                    $subject->getCollection()
                        ->setOrder('price', 'asc');
                    break;
                case 'brand_asc':
                    $subject->getCollection()
                        ->addAttributeToFilter(
                            'manufacturer_value',
                            ['neq' => 'NULL']
                        )
                        ->setOrder('manufacturer_value', 'asc');
                    break;
                case 'brand_desc':
                    $subject->getCollection()
                        ->addAttributeToFilter(
                            'manufacturer_value',
                            ['neq' => 'NULL']
                        )
                        ->setOrder('manufacturer_value', 'desc');
                    break;
                case 'on_sale';
                    $subject->getCollection()
                        ->setOrder('special_price', 'desc');
                    break;

                default:
                    $subject->getCollection()->setOrder($currentOrder, $currentDirection);
                    break;

            }
        }
        //echo $subject->getCollection()->getSelect();die;
        return $result;
    }

When I print query I am able to see the correct results, but while rendering on category page, I am seeing some irrelevant results without pagination. Can anyone help on this issue?


texts: Main website in root folder / and other websites in subfolders /de /es

texts:
We are trying for some weeks to setup Magento 2 with the following structure:

Main Shop: example.com/
USA Shop: example.com/us
UK Shop: example.com/uk

I tried to set the following configuration:

Stores -> Configuration -> Default -> Web -> Add Store Code to Urls

It has a problem for us: it add the code to the Main Shop too. For SEO purposes, we want to have the Main Shop in the root.

How we can accomplish this? Thanks.


texts: Whats referenceBlock name for payment and shipping area on admin order detail page?

texts: I am trying to override payment method area block on admin order detail page but its not working. What is the reference block name for that area?


texts: Magento 2.3 product collection->getData get correct answer but foreach or load() not

texts:
Same with here : Magento 1: $productCollection->getData() vs foreach ($productCollection as $product), want add more information.
Create new product then
$productCollection = $objectManager->get('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory')->create()->setStoreId('0')
->addAttributeToFilter('entity_id', '1638763');

Now
var_dump($productCollection->getData());  // return the item
foreach ($productCollection as $key => $item) {
    var_dump($key);
}. // nothing in here

And try
productCollection->load();

Both method return null,  Why I can't get the item after load() or using foreach function?


texts: How to Fetch/Insert in Database without Sql Query

texts:
I am trying to get customers from the database whose order was cancelled, and I am able to do this via Query. But I think the standard way should be without using Queries. So is there a way I can accomplish this? I searched on google but result is quite ambiguous and mostly for Magento 1.x where as I need for Magento 2.3.
My Query:
SELECT customer_id, count(`entity_id`) as custCount from $tableName WHERE `status` = 'cancel'

Any help here?


texts:
I need to attached pdf file inside mail, while sending order email to the customer.

Any one please tell me flow for that ?


texts:
I have a number appearing within each item listing of the Mini Cart:

Where would this be rendered?

I've looked in app\design\frontend\base\default\template\checkout\cart\sidebar\default.phtml but can't see anything obvious.

Thanks

EDIT:

Here is the code from inspecting the element:

    Naturtint Nutrideep Multiplier Protective Conditioner
    303


texts: Why when I click in a swatch color still show the old color thumbnail?

texts:
I created a configurable product with two colors (black and brow)

When I go to product details page and select the brow color still shows the black color product in the thumbnail.

I can't understand this process. I just need to show the color I clicked, so the brow color, not two colors at the same time.

Need Help! Thank's.


texts:
My main goal is to have pages listting products by each brand available.

From this answer I understood that you can make it possible by serach pages.

All products have 'manufacturer' attribute. To set up search pages you need to make sure that the attrubute is available in search. Then you should be able to access all products by the brand following example.com/?manufacturer=apple to see all apple products. Howerver, this link returns the front page.

if I use serach and enter apple it returns a page with url

http://www.example.com/catalogsearch/result/?q=apple

and use the brand filter, select apple the url becomes

http://www.example.com/catalogsearch/result/index/?manufacturer=285&q=apple

Next three links return back to home page, What am I missing here?

http://www.example.com/catalogsearch/result/index/?manufacturer=285

http://www.example.com/catalogsearch/result/?manufacturer=285

http://www.example.com/?manufacturer=285

Link below returns 404 page

http://www.example.com/catalogsearch/?manufacturer=285

Are there other other ways to genertae pages with a list of products by this brands?

Please do not offer extensions.


texts: What is meaning of Ui-Component tags in Magento 2

texts:
Please Explain me what is meaning of Below Ui-Componet tags :-
1.)
<item name="config" xsi:type="array">
    <item name="selectProvider" xsi:type="string">mag_mcf_index_grid.mag_mcf_index_grid.custom_mcf_columns.ids</item>
 </item>

2.Why use this :- )
<item name="provider" xsi:type="string">mag_mcf_index_grid.mag_mcf_index_grid_data_source</item>
<item name="deps" xsi:type="string">mag_mcf_index_grid.mag_mcf_index_grid_data_source</item>

3.)
<item name="spinner" xsi:type="string">custom_mcf_columns</item>

THANKS.


texts:
I need to add additional wrapper in my Magento2 custom theme layout, so it would be

     ... all other cotainers ....

How can I do that?


texts: Paypal IPN - Is it safe to use the default Magento url?

texts:
By default Magento have a route allowing IPN request on the url:
http://www.mystore.com/paypal/ipn

Here mainly 2 infos are processed by on the request:

Order ID: Mage_Paypal_Model_Ipn::_getOrder() this info in order to load magento order.
Email address: Mage_Paypal_Model_Ipn::_verifyOrder() just check if the email address sent  with the request match the one set in the backend for paypal ...

Looking at the code Mage_Paypal_Model_Ipn::_verifyOrder() check if the email address sent  with the request match the one set in the backend for paypal.

Note that the order id is the incremental order id ( so it is known to the customer ).
So once guessed the paypal email ID a malicious customer could  change the status of his order using a fake request pointing to the known url.

am I right ?
if so I think it would be a good practice at least to change the route to something different that the default one.


texts: Cannot redirect to a specific page using Observer events such as sales_order_place_before, and checkout_submit_before in Magento 2.3

texts:
I am currently implementing a behavior where I will check the quote items in cart, then check if it contains my custom attributes. If true, then it will redirect me to a specific page(CMS) page.
This behavior should trigger before place order is processed.

I already tried using, observer events: sales_order_place_before and checkout_submit_before. I was not successful in implementing the redirect in the observer. The place order process seems to ignore redirects from the observer.

Here is my code:

app/code/Package/ModuleName/etc/events.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="sales_order_place_before">
    <observer name="observer_name" instance="Package\ModuleName\Observer\BeforePlaceOrder"/>
</event>

app/code/Package/ModuleMame/Observer/BeforePlaceOrder.php

 public function execute(Observer $observer)
{
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    /** @var \Magento\Framework\UrlInterface $url */
    $url = $objectManager->create('\Magento\Framework\UrlInterface');

    /** @var \Magento\Framework\App\ResponseInterface $response */
    $response = $objectManager->create('\Magento\Framework\App\ResponseInterface');

    $customerBeforeAuthUrl = $url->getUrl('support-plan-option'); //you can change the routh path to your cms page
    $response->setRedirect($customerBeforeAuthUrl)->sendResponse();
}


texts: InstallData is not running while testing in server

texts:
Why does it work on local but does not work on server ?

<?php
namespace AcountS\AcountStatus\Setup;

use Magento\Customer\Model\Customer;
use Magento\Customer\Setup\CustomerSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface

{

    private $customerSetupFactory;

    public function __construct(
       CustomerSetupFactory $customerSetupFactory
) {
      $this->customerSetupFactory = $customerSetupFactory;
}

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)

    {

        $setup->startSetup();
        /** @var CustomerSetup $customerSetup */
        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

        $customerSetup->addAttribute(Customer::ENTITY, 'account_status', [
            'label' => 'Customer Account Status',
            'input' => 'select',
            'required' => false,
            'sort_order' => 100,
            'visible' => true,
            'system' => false,
            'type' => 'int',
            'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Table',
            'is_used_in_grid' => true,
            'is_visible_in_grid' => true,
            'is_filterable_in_grid' => true,
            'is_searchable_in_grid' => true,
            'option' => ['values' => ['Active', 'Suspend', 'Vacations']],
        ]);

        $setup->endSetup();
    }
}


texts: Magento wysiwyg editor not working and showing blank image popup

texts:
I have implement wysiwyg text editor in magento for my custom module. On my local machine it is working properly.

When I upload my code on live server then wysiwyg showing blank image popup.
Please find attached screenshot of the error which I am getting.

Any one can please advice.


texts: Magento : File Upload Problem in Magento Connect Manager

texts:
I have install succesfully new magento 1.9.3.1 from my control panel, When I try to upload file zip file (tgz) from Magento connect manager, after 100% upload... it say no file was uploaded.

It is really frustating after several question with my web host but non is solve.


texts: template path hints showing when turned off?

texts: I have template path hints turned off but some modules have the template path hints still around them. Weirder still if I go to another page on the site it comes up with path hints for parts that wouldn't have the hints on other pages.. anyone experienced this?


texts: Magento Mystery: Blank page without any error

texts:
I really screwed up this time! Problem is I don't know how, why and when.

When I open the edit/create attributes page (adminhtml) I get a blank page with header and a footer, but no error at all!

Obviously I checked google and have tried everything to figure out how this problem came to be, but I didn't find a solution.

What I tried (yes I cleared cache every time):

Enable logging (was enabled already), system.log and exception.log do not contain any logs that are relevant.

Enabled error printing in index.php:

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
ini_set('memory_limit', '512M');

Disabling every module I installed over the last week.

Enabled profiler To be honest I have no idea what I can learn from this

Somewhere on stackexchange I found somebody who had put this in his index.php:

ini_set('error_reporting', E_ERROR);
register_shutdown_function("fatal_handler");
function fatal_handler() {
    $error = error_get_last();
    echo("<pre>");
    print_r($error);
}

But after doing so I get the same message on every adminhtml page, and I don't think translation.php will be responsible for attributes not showing up.

Array
(
    [type] => 2
    [message] => vsprintf(): Too few arguments
    [file] => /public_html/app/code/core/Mage/Core/Model/Translate.php
    [line] => 416
)

Can anybody help me here!?


texts: Simple Product Can Configure Once but Not Twice

texts:
I have a simple product with custom options and when I go to the actual frontend product page, I can customize the product and the price adjusts correctly depending on the selections.  After adding the product to the cart, I go back to the same product page and customize the product a second time, the price does not update on the product page, only when it is added to the cart.

The Console does not show any errors or warnings.  I am using an extension (Custom Math Pricing) which manipulates the pricing slightly.  Their head of support said it sounds like a template issue or a jQuery issue.  If I clean out the browser cache and cookies, I can customize the product again but that removes the 1st item from the cart.  Does anyone know how I can debug this or solve it with minimal Magento experience?

Magento 1.9.1

Extension: Custom Math Pricing - Mico Solutions

Theme: Argento Theme - Mall

If you would like code provided, please let me know what you'd like to see and I can paste it, I don't know where to begin with this one.  Just put your request in the comments.


texts:
I'm trying to create a filter for one of my product attributes that will consist of several dropdown menus. An example of the attribute is given below:

I want to have dropdowns for year, make, and model to reduce the number of results in the multiselect list (only 3 in the example, but will be thousands in production).

I'm new to Magento so I'm not sure where the file is to add the code, I presume in the app/code/directory somewhere. If it makes a difference, I'm using the TemplateMonster Magetique theme.

I'm not too worried about figuring out the logic behind the filtering as I have built a search similar to this before.


texts:
I am trying to clone my server to my WAMP for testing purposes.

I have copied all of the server files to my www/storename folder.

I have imported the database to phpMyAdmin.

And I have followed this tutorial.

But when I go to http://localhost/storename I just see my folder structure.


texts:
I want to include custom js in my theme i put it in web/js path of theme

F:\xampp\htdocs\magento2\app\design\frontend\GWtheme\gw\web\js\jquery.flexisel.js

Then i created requirejs-config.js

var config = {
    map: {
        '*': {
            clientrotate: 'GWtheme_gw/js/jquery.flexisel'
        }
    }
};

but when i check page source i can not see this js loading any where.

Also i tried other way as per below answer but it shows 404

var config = {
    map: {
        '*': {
            clientrotate: 'GWtheme_gw/js/jquery.flexisel'
        }
    },
    deps: [
        "clientrotate"
    ]
};

"NetworkError: 404 Not Found - http://localhost:8080/magento2/pub/static/frontend/GWtheme/GW/en_US/GWtheme_gw/js/jquery.flexisel.js"

Error: Script error for: GWtheme_gw/js/jquery.flexisel
http://requirejs.org/docs/errors.html#scripterror

var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);


texts: Programmatically create an order of grouped and bundle product in Magento

texts:
I need a code to create order in Magento programmatically.

I used this script for simple product order and it works good.

require_once 'app/Mage.php';
Mage::app();
$quote = Mage::getModel('sales/quote')
        ->setStoreId(Mage::app()->getStore('default')->getId());
        $customer = Mage::getModel('customer/customer')
                ->setWebsiteId(1)
                ->loadByEmail('test@example.com');
        $quote->assignCustomer($customer);
$product = Mage::getModel('catalog/product')->load(2770);
$buyInfo = array(
        'qty' => 1,
);
$quote->addProduct($product, new Varien_Object($buyInfo));
$addressData = array(
        'firstname' => 'Test',
        'lastname' => 'Test',
        'street' => 'Sample Street 10',
        'city' => 'Somewhere',
        'postcode' => '123456',
        'telephone' => '123456',
        'country_id' => 'US',
        'region_id' => 12, // id from directory_country_region table
);
$billingAddress = $quote->getBillingAddress()->addData($addressData);
$shippingAddress = $quote->getShippingAddress()->addData($addressData);

$shippingAddress->setCollectShippingRates(true)->collectShippingRates()
                ->setShippingMethod('freeshipping_freeshipping')
                ->setPaymentMethod('checkmo');
$quote->getPayment()->importData(array('method' => 'checkmo'));
$quote->collectTotals()->save();
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
$order = $service->getOrder();
printf("Created order %s\n", $order->getIncrementId());

But i also want to create order of grouped product as well as bundle product,
I try with using grouped and bundle product id but it does not work


texts: How to put frontend of my site in maintenance mode

texts: I need to put frontend of my site to maintenance mode. so I enabled maintenance flag by creating empty folder in the name maintenance.flag in the root folder. But when I do this, my backend panel is also getting locked under maintenance mode. I want to work in my back panel So someone kindly guide me to enable maintenance mode only at frontend.


texts: magento2 call api test with postman : nonce validation error

texts:
After my integration is created and authorized, i'm trying to test the Magento REST API with Postman using the access token but an error related to nonce validation occurred.
Any help please??


texts: How to translate or change the name of the page 'Contact Us' from the tab name in browser on Magento 2?

texts:
I tried to find the page in backend from content -> Pages, but the contact us page is not there.

I also find some answers for Magento 1, that you have to edit this file and change the name from here

/app/design/frontend/tm_themes/theme_number/layout/local.xml

But on Magento 2 I can't find this file.


texts: Magento : After Change topmenu.phtml File 2columns-left.phtml Not Work

texts:
I set mega menu using topmenu.phtml file but when I go to category page then 2columns-left.phtml file not working properly. so can any one help me?

I am using magento ver:1.9


texts: Product price suddenly reduces when adding product to quote via admin backend, if Magento contains multiple currencies

texts:
Scenario: Create order via admin backend

Given there is a product with a price of 35.71
And there is no discount available
When you add this product to the quote
Then the corresponding quote item has price 35.71

This user story is not valid, if your shop has more than one currency: Then the corresponding quote item has price 28.57, although all amounts are in the same currency.

What is even more strange: The error seems not to disappear, if I disable the second currency and even delete its currency rate.

Tax seems not to interfere with this issue, because I have it for both catalog prices including tax or not.

Can anyone confirm that? I checked two different stores today, running CE 1.7.0.2 and CE 1.9.2.1. Is it a known bug or did I miss something? How could it be fixed?


texts: Magento is not generating factory classes

texts:
I am trying to create custom table in a plugin and trying to write model classes for it. Custom database tables is successfully generated. However I am struggling to let magento auto generate model factory classes.
When bin/magento setup:di:compile command is executed only Interceptor.php file is generated and not Factory class.
Model interface
<?php
namespace Company\OrderListener\Api\Data;

interface CustomOrderModelInterface {

    const ID           = 'id';
    const ORDERID      = 'orderId';
    const PROCESSED    = 'processed';

    //Getter & Setter interface definitions
}

Model class
<?php
namespace Company\OrderListener\Model;

use Company\OrderListener\Api\Data\CustomOrderModelInterface;
use \Magento\Framework\Model\AbstractModel;
use \Magento\Framework\DataObject\IdentityInterface;

/**
 * Undocumented class
 */
class CustomOrderModel extends \Magento\Framework\Model\AbstractModel implements CustomOrderModelInterface , IdentityInterface {
    const CACHE_TAG = 'orderlistener_custom_order_model';

    /**
     * Model cache tag for clear cache in after save and after delete
     *
     * @var string
     */
    protected $_cacheTag = self::CACHE_TAG;

    /**
     * Prefix of model events names
     *
     * @var string
     */
    protected $_eventPrefix = 'custom_order_model';

    /**
     * Initialize resource model
     *
     * @return void
     */
    protected function _construct()
    {
        $this->_init('Company\OrderListener\Model\ResourceModel\CustomOrderModel');
    }

    //Getters and Setters
}

Resource Model class
<?php
namespace Company\OrderListener\Model\ResourceModel;

class CustomOrderModel extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb {

    /**
     * Initialize resource model
     *
     * @return void
     */
    //custom_order is custom table and id is primary key
    protected function _construct()
    {
        $this->_init("custom_order","id");
    }

    public function __construct(\Magento\Framework\Model\ResourceModel\Db\Context $context)
    {
        parent::__construct($context);
    }
}

Collection class
<?php
namespace Company\OrderListener\Model\ResourceModel\CustomOrderModel;

class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection {

    public function __construct() {
        $this->_init('Company\OrderListener\Model\CustomOrderModel',
        'Company\OrderListener\Model\ResourceModel\CustomOrderModel');
    }
}

Most of the guides and magento documents suggest to create these files and use auto generated factory class to persist/access data to/from custom database tables in plugin. However factory class are not auto generated with both bin/magento setup:di:compile and bin/magento setup:upgrade commands.
Does some definitions needs to be done in di.xml for this to work?
EDIT:
I have added preference for interface in di.xml still no luck
<?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="Company\OrderListener\Api\Data\CustomOrderModelInterface" type="Company\OrderListener\Model\CustomOrderModel" />
</config>


texts: Magento 2 - How to insert template block into page_top

texts:
This question is specific to Magento 2.

I am attempting to inject additional stylesheets, Javascript and a template block into every page in a Magento 2 store. I have a functioning module which I have called additionalcontent. I am just unable to wrap my head around how to inject the block into the frontend.

In Magento 1 I would include additionalcontent.xml inside the theme layout with the following

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
    <reference name="head">
         <action method="addCss"><stylesheet>xzy/additionalstyles.css</stylesheet></action>
         <action method="addJs"><script>xzy/additionaljavascript.js</script></action>
    </reference>
    <reference name="after_body_start">
     <block type="core/template" before="-" as="additionaBlock" name="additionaBlock" template="xzy/additionalblock.phtml" />
    </reference>
</default>

</layout>

Note, I am only attempting to inject a template block not generate a frontend URL/route.

Does anyone have an example of how to accomplish this in Magento 2?


texts: Frontend & Backend Website not launching after performing SYSTEM BACKUP

texts:
I decided to perform a SYSTEM Backup via the admin of my website at 4:13am, even though I'm not so techy with Magento. It kept showing 'Please Wait' all the while. I went to bed, woke after 6hours and it was still the same. I left it for a long while till around 11:30pm and it was still showing 'Please Wait'. While it was performing the backup, I couldn't access both the frontend and backend of the website.

As I wasn't sure of what to do to bring the website back alive, I stopped the Backup at about 11:40pm by typing a different web address into the URL. Having done that, nothing seems to have changed and I still can't access both the backend & frontend.

Please I need some advice on what to do. Please do let me know if you require more clarification.


texts: Prevent saving the default value for category attribute

texts:
My module adds a custom dropdown attribute to categories. This attribute has many possible values, but in most cases (~90%) users will leave the default value in the attribute's field.

I want to make sure the attribute will not be saved in the database for categories in which user selected the default value. This will save some space in the database and (I hope) it will increase performance a little bit.

So I created a backend model for my attribute and in the beforeSave method I check the value of the attribute before it is finally saved in the database. If the current value is the default value, I replace it with an empty string ''. See an example:

class ProductType extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend
{
    const DEFAULT_VALUE = 'smartphones';

    public function beforeSave($object)
    {
        $attrCode = $this->getAttribute()->getAttributeCode();
        $attrValue = $object->getData($attrCode);

        // If default value, don't save that attribute
        if ($attrValue === self::DEFAULT_VALUE) {
            $object->setData($attrCode, '');
        }
    }
}

Is it the correct way to prevent saving the attribute in the database?

Or should I replace the value of the attribute with null instead of an empty string ''? Like this:

        if ($attrValue === self::DEFAULT_VALUE) {
            $object->setData($attrCode, null);
        }


texts:
I did the following:

Logged into Admin
Created a simple product
Added a product list widget to the home page
Reloaded cache

... And I cannot see my product displayed on the homepage.


texts: Admin panel grid view creation in magento with clickable row

texts: How to make clickable grid view row in magento admin panel


texts: MySQL Queries for v1.7 to v1.9 upgrade process

texts:
I'm tasked with upgrading our Magento installation from v1.7 to v1.9, using this article as a guide. The upgrade works fine, but its not very compatible with our development and deployment process.

Any updates are done in the development environment, then deployed to staging, and once they're tested and validated, it gets deployed to production. Our deployment process is pretty straight forward, its basically just a matter of checking out the Git branch with the new code. And there aren't too many database changes that get done, so if there are, then that just consists of manually running the MySQL queries either before or after the branch is checked out.

This is where the upgrade process for Magento somewhat clashes with our deployment process. Without knowing exactly what MySQL queries the upgrade/install process runs (if any), we basically have to follow the entire upgrade process, and once its done, just overwrite all the files with whats in our git repo.

It would be much easier if I could just run any queries that magento executes myself. Is there a way to find out what queries Magento would execute? If not, can someone provide the queries for the 1.7 -> 1.9 upgrade?

Thank you


texts: Magento 2 : Remove the city field in checkout billing address

texts:
How to remove the city field in checkout billing address, I tried removing it from checkout_index_index.xml but it's not working?
Magento ver. 2.3.5-p1


texts: Is it possible in Magento 1.12.0.0 Enterprise edition to hide inactive stores from the all stores view list?


texts:
I need to change the wording on my Login page but cant find it? It has its own top heading. The top choices are Account, Login and Signup. I can find the Signup page but not Account or Login. www.scimac.com
Elizabeth


texts: shipping methods on magento 2.3.2 not showing correct

texts:
Please I need help,my shipping methods showing

I need it to showing normal like


texts: Magento Products are not displaying under categories section

texts:
magento products are not displaying  under category section . but displaying in url, in home page.

please check the link " http://joinery.newtrendzonline.com/ "

We created about 500 products. before every products were displaying

If i click "categories", no products displaying.

In browser tab heading "Create new customer account displaying ".

I am struggling for this. please give me solution.

Please post the solution here. you can contact me at realworker99atgmaildotcom

Thanks in Advance......


texts:
Synopsis

First of all I wish to express how a third-party extension to list the crobjobs is not what I am looking for, I shall omit my opinion for how Magento handles cronjobs.

My problem is when I query the database SELECT * FROM cron_schedule; my modules cron is not listed there, thus I can only assume my cron configuration is wrong, but so far I've not found any resources to help.

Cron set-up

My cron has been set-up on the server to run every 5 minutes (this is where I dislike Magento abstracting cronjobs).

  crontab -e

  */5 * * * * /bin/sh /home/site/public_html/cron.sh > /dev/null &2>1

For the exercise of getting my cron to run, I am running the cron from the command line $ /bin/sh cron.sh - Inside the cron_schedule I see that executed_at is updated but not for my cronjob but an existing modules cron.

Snippet

config.xml

<config>

    ...

    <crontab>
        <jobs>
            <myvendor_mymodule>
                <schedule>
                    <cron_expr>0 0 * * *</cron_expr>
                </schedule>
                <run>
                    <model>myvendor_mymodule/cron::someMethod</model>
                </run>
            </myvendor_mymodule>
        </jobs>
    </crontab>
</config>

app/code/local/Myvendor/Mymodule/Model/Cron.php

class Myvendor_Mymodule_Model_Cron
{
    //public static function someMethod() #= no luck either
    public function someMethod()
    {
        Mage::log('test', null, 'hello.log');
    }
}


texts: Custom module created is not working in server,works good in local environment

texts: We have created a custom module inside app/code and in upgrade schema script we have increased the module.xml version to add a new column to the existing table.Will it cause any issues?I am not able to trace the cause as it is working good in local.When fetched latest code from git in another local system also it is working good.


texts:
I've some scripts in magento due to the confliction of the below, it is causing some glitch. I need to dig into the below scripts, so that I can find what is the causing the error. Where can I find the files of below code?

<?php echo $this->getCssJsHtml() ?>


texts: using same functional tests across magento websites

texts:
We have many different sites developed using magento 1.4. I need to develop functional tests like login, place an order etc, full user journeys for these. I am using test automation framework (taf also known as mtaf) to do so. Even though this is deprecated and doesn't support Magento 1.4, I understand we can build our own testcases on it and not use the pre written test cases. I plan on using selenium with it.

My question is since all magento sites use same cascading style sheets which may include same id s, classes, names etc, can I use the same set of functional tests across websites, since the css selectors used across are the same?

Or Am i totally wrong and its not the same set of selectors used across different magento websites? Is it because each website could be using a different theme and thereby resulting in different selectors?

Please share your thoughts.


texts:
I'm trying to get a configuration for my custom module

My Custom module overrides \Magento\Swatches\Block\Product\Renderer\Configurable

With the following Code:

namespace Vendor\swatchExtender\Block;

use Magento\Catalog\Block\Product\Context;
use Magento\Catalog\Helper\Product as CatalogProduct;
use Magento\Catalog\Model\Product;
use Magento\ConfigurableProduct\Helper\Data;
use Magento\ConfigurableProduct\Model\ConfigurableAttributeData;
use Magento\Customer\Helper\Session\CurrentCustomer;
use Magento\Framework\Json\EncoderInterface;
use Magento\Framework\Pricing\PriceCurrencyInterface;
use Magento\Framework\Stdlib\ArrayUtils;
use Magento\Store\Model\ScopeInterface;
use Magento\Swatches\Helper\Data as SwatchData;
use Magento\Swatches\Helper\Media;
use Magento\Swatches\Model\Swatch;
use Magento\Framework\App\ObjectManager;
use Magento\Swatches\Model\SwatchAttributesProvider;

class Configurable extends \Magento\Swatches\Block\Product\Renderer\Configurable
{
    protected function extractNecessarySwatchData(array $swatchDataArray)
    {
        $result['type'] = $swatchDataArray['type'];

        if ($result['type'] == Swatch::SWATCH_TYPE_VISUAL_IMAGE && !empty($swatchDataArray['value'])) {
            $result['value'] = $this->swatchMediaHelper->getSwatchAttributeImage(
                Swatch::SWATCH_IMAGE_NAME,
                $swatchDataArray['value']
            );
            $result['thumb'] = $this->swatchMediaHelper->getSwatchAttributeImage(
                Swatch::SWATCH_THUMBNAIL_NAME,
                $swatchDataArray['value']
            );
        } else {
            $result['value'] = $swatchDataArray['value'];
        }
        $result['custom_parameter'] = 'value';
    }

}

But now i want to read the configuation parameters from the admin-panel.

I have created a Helper data Class:

namespace Vendor\swatchExtender\Helper;

class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
    public function getConfig($config_path)
    {
        return $this->scopeConfig->getValue(
        $config_path,
        \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        );
    }
}

But i have no idea how to access the Helper/data, everything i tried will brake the Configurable class, because of the parent __Construct,

How can i Access my Helper/Data class ?


texts: Magento load jquery if before doesn't have loaded

texts: I need my module just do load jQuery if it has not loaded before, I did the javascript, but it runs very fast and even using 'setInterval' etc. .. and in some cases they still going without waiting for jquery load my question would be, how can I load jQuery to my module only if it was not loaded before?


texts: Elasticsearch 6.6 with Magento 2.3 and Nginx, need a proxy?

texts:
I am installing Elasticsearch 6.6 on my system (Ubuntu 18.04 with Nginx 1.14) and to configure Elasticsearch and Nginx, I find in the official documentation the following section:

Configure nginx and Elasticsearch

Is it necessary to set a proxy on my Nginx so that Elasticsearch works with Magento 2 correctly?

Thank you in advance


texts: Does giving someone credit in the Admin panel issue the credit through Paypal?

texts:
Magento 1.9.1
Paypal Payments Pro (Includes Express Checkout)

If I give somebody a credit on the back-end (in the Admin panel) - does that go trough on Paypal automatically?


texts:
My Magento only send mails from app\locale\en_US\template\email (confirmation mail, new account, ...)

dont send from app\locale\en_US\template\email\sales or the transactional mails.

I create new templates and applied in system > configuration > sales > sales e-mails
but dont work, nothing in magento or server log.

In configuration > system, disable email communications is NO

My host is running Linux with nginx/postfix.


texts: After importing products Successful data not display frontend due to cataloginventory_stock_status in magento2

texts:
After importing product my product doesn't display frontend.
I have debugged for it and I have found that my record not updated in cataloginventory_stock_status table.

I have reindexed after importing products.


texts:
I am using Magento 2.4, I am creating Cart Price Rule for conditional free shipping. I am not using any Tax in my website. I am just adding condition in Subtotal, If cart subtotal is greater than AED350 than Free shipping should be display auto on checkout page else not.
But after adding this condition I have amount AED200 in my cart. But That shipping method is still displaying. Please check attached file.
Thanks & Regards


texts: Magento 2.1.3 : Indexer creates an extra index on production, not on local development

texts:
I've already created an issue about this, but I've got a strange problem. Locally, when I run indexer:reindex everything works fine. However, when I run it on producten I get thrown a MYSQL error:

[Zend_Db_Statement_Exception]
    SQLSTATE[42000]: Syntax error or access violation: 1170 BLOB/TEXT column 'created_in' used in key specification without a key length, query was: CREATE T
    ABLE IF NOT EXISTS `customer_grid_flat` (
    `entity_id` int UNSIGNED NOT NULL COMMENT 'Entity ID' ,
    `name` text NULL COMMENT 'Name' ,
    `email` varchar(255) NULL COMMENT 'Email' ,
    `group_id` int NULL COMMENT 'Group_id' ,
    `created_at` timestamp NULL default NULL COMMENT 'Created_at' ,
    `website_id` int NULL COMMENT 'Website_id' ,
    `confirmation` varchar(255) NULL COMMENT 'Confirmation' ,
    `created_in` text NULL COMMENT 'Created_in' ,
    `dob` date NULL COMMENT 'Dob' ,
    `gender` int NULL COMMENT 'Gender' ,
    `taxvat` varchar(255) NULL COMMENT 'Taxvat' ,
    `lock_expires` timestamp NULL default NULL COMMENT 'Lock_expires' ,
    `shipping_full` text NULL COMMENT 'Shipping_full' ,
    `billing_full` text NULL COMMENT 'Billing_full' ,
    `billing_firstname` varchar(255) NULL COMMENT 'Billing_firstname' ,
    `billing_lastname` varchar(255) NULL COMMENT 'Billing_lastname' ,
    `billing_telephone` varchar(255) NULL COMMENT 'Billing_telephone' ,
    `billing_postcode` varchar(255) NULL COMMENT 'Billing_postcode' ,
    `billing_country_id` varchar(255) NULL COMMENT 'Billing_country_id' ,
    `billing_region` varchar(255) NULL COMMENT 'Billing_region' ,
    `billing_street` varchar(255) NULL COMMENT 'Billing_street' ,
    `billing_city` varchar(255) NULL COMMENT 'Billing_city' ,
    `billing_fax` varchar(255) NULL COMMENT 'Billing_fax' ,
    `billing_vat_id` varchar(255) NULL COMMENT 'Billing_vat_id' ,
    `billing_company` varchar(255) NULL COMMENT 'Billing_company' ,
    PRIMARY KEY (`entity_id`),
    INDEX `CUSTOMER_GRID_FLAT_GROUP_ID` (`group_id`),
    INDEX `CUSTOMER_GRID_FLAT_CREATED_AT` (`created_at`),
    INDEX `CUSTOMER_GRID_FLAT_WEBSITE_ID` (`website_id`),
    INDEX `CUSTOMER_GRID_FLAT_CONFIRMATION` (`confirmation`),
    INDEX `CUSTOMER_GRID_FLAT_CREATED_IN` (`created_in`),
    INDEX `CUSTOMER_GRID_FLAT_DOB` (`dob`),
    INDEX `CUSTOMER_GRID_FLAT_GENDER` (`gender`),
    INDEX `CUSTOMER_GRID_FLAT_LOCK_EXPIRES` (`lock_expires`),
    INDEX `CUSTOMER_GRID_FLAT_BILLING_COUNTRY_ID` (`billing_country_id`),
    FULLTEXT `FTI_AC9FBFAE9FBD3A0B02DBA986349612A6` (`name`, `email`, `taxvat`, `shipping_full`, `billing_full`, `billing_firstname`, `billing_lastname`, `
    billing_telephone`, `billing_postcode`, `billing_region`, `billing_street`, `billing_city`, `billing_fax`, `billing_vat_id`, `billing_company`)
    ) COMMENT='customer_grid_flat' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci

I've compared the query building locally with the one on production, and the only difference there is, is that on production Magentos' indexer for some reason determines that created_in should also be an index.

Why does it do that? Can anyone point me to the right direction on where to look? I've been searching for this issue for 3 days now.


texts: Import Product Data w/ CSV from command line (not dataflow)

texts:
I've updated a development version of my store to 1.9.2.4 from 1.7.0.2. I noticed that a plugin I used to handle inventory updates from the command line no longer works. I have over 15K products and the old admin importer used to stall while processing (hence the reason for using the plugin). However, the 1.9.2.4 version works great.

Is there a way to import and update products using a csv file from the command line and have it process it the same way as logging into the admin and going to "System > Import/Export > Import" by creating a script and setting up a cron job? I would use the dataflow process, but it takes several minutes to process and we are trying to keep the inventory updated every 15 minutes. The dataflow process can take longer than that depending on the amount of products that need to be updated, but the regular import only take a few seconds.


texts: How do you remove default columns in the product grid?

texts:
I would like to remove some of the default columns from the product grid in the Magento admin.  I have tapped into the core_block_abstract_prepare_layout_before event an can successfully add new columns using addColumnAfter(), but when I try a removeColumn() on a default column it doesn't seem to do anything.

Here is my observer method...

public function updateColumns($observer)
{

    $block = $observer->getBlock();
    if (!isset($block)) return $this;

    if ($block->getType() == 'adminhtml/catalog_product_grid') {

        $boolOptions = array('1' => 'Yes', '0' => 'No');

        // Add new columns
        $block->addColumnAfter('model_number', array(
            'header' => 'Model No.',
            'type' => 'text',
            'index' => 'model_number',
        ), 'sku');
        $block->addColumnAfter('discontinued', array(
            'header' => 'Disc.',
            'type' => 'options',
            'index' => 'discontinued',
            'options' => $boolOptions,
        ), 'qty');

        // Remove columns
        $block->removeColumn('status');

    }

}


texts:
Using Magento 2.1.10

The search part of Magento 2 seems quite buggy. I have a product titled "abc with xyz".

When I search "abc", the product gets displayed but its pushed in between the collection, with several items appearing before it, which does not even have "abc" in their names. I researched and adjusted the search weights and i still get the same result, no effect at all.
When I search "abc lights", the result is similar to point 1
When I search "with", I do not see the product listed. Other products which are irrelevant gets displayed

How can i search the products by NAME only. I have tried disabling the searchable for all the other Attributes. in this case when i search "with", I get no result at all.

I have already tried changing the query clause to "must" instead of "should", but it still does not work

If possible, can someone please let me know where can I find the query in the code for it.


texts: Please help me set new order status for bank transfer payment to pending

texts:
I went to Admin Panel > Sales > Payment Methods > Bank Transfer Payment > New Order Status. I updated it to "pending" however when I place a new order the status still went to "processing".

I tried this. I went to code/core/Mage/Sales/Model/Order/Payment.php:

protected function _authorize($isOnline, $amount)
{
    // update totals
    $amount = $this->_formatAmount($amount, true);
    $this->setBaseAmountAuthorized($amount);

    // do authorization
    $order  = $this->getOrder();
    $state  = Mage_Sales_Model_Order::STATE_PROCESSING;
    $status = true;

I changed the STATE_PROCESSING to STATE_NEW to set it on "pending" but when I place a new order the status still went to "processing".

My Reference

How can I change the new order status to pending for bank transfer?

My Magento version is 1.9.0.1

Here's the screenshot:


texts: SCP (Simple Configurable Products) and Product Reviews

texts:
I have a working shop system with installed SCP. Whenever I want write a new product review, I get the error message:

  Please specify the product's option(s).

As I can see, the action for the review form links to this target:

/checkout/cart/add/uenc/aHR0cDovL3MtcGFzc3QuZGUvaW5kZXgucGhwL3Jldmlldy9wcm9kdWN0L2xpc3QvaWQvMzE5Lw,,/product/319/form_key/QmbYaUx9H2Pfyhfa/

But it should link to this target:

/review/product/post/id/<product_id>/

It seems that there is missing a form element for the review.

I tried to modify the file:

  \app\design\frontend\base\default\template\review\form.phtml

But any changes in the  tag are useless and disappear...


texts: How to set Ogone Ingenico after payment back urls?

texts:
I've an existing Magento ecommerce and I've to manage some operations in the final part of the payment process, exactly in the script redirected after the payment done through the Ogone Ingenico plugin.

At the moment in the redirection settings of Ogono Ingenico I set these default links for Magento back redirections

http://[MY_ECOMMERCE_WEBSITE]/ops/api/postBack

But once the payment is done, I've been redirected to a url that looks like this ..

http://[MY_ECOMMERCE_WEBSITE]/checkout/cart/

.. and Magento actually shows a page of an empty shopping cart. I would expect instead a thank-you page in a correct scenario, or an error-payment page in an unsuccessful scenario.

Am I doing something wrong? Do you have suggestions for me to understand other configurations that I'm not aware of?

Thanks in advance.


texts: Vat Number missing in Billing Address Magento 2

texts:
I am trying to checkout as a Guest and when I proceed to the Payment Step, I have checked the data saved in the Shipping Step and I found that Vat Number is missing in the Billing Address, but in Shipping Address is filled. Does anybody know if it is a bug or a missing configuration?

Thanks.


texts:
For some odd reason <email> </email> breaks my page in system > transactional emails.

<template>
    <email>
        <notification_tpl module="Notification">
            <label>Product Notification</label>
            <file>Notification.html</file>
            <type>html</type>
        </notification_tpl>
    </email>
</template>

The only thing that loads is the template drop-down at the top and it no longer functions and the rest of the page below it is broken.

I noticed when i delete <email> </email> and leave the rest the page builds it's self proper like again.


texts: I want to migrate orders and other data into Magento. How do I access the database?

texts: I want to migrate order and customer data into Magento. How do I access the MySQL database?


texts: Magento 2.3.2 Developer mode error in setup:di:compile

texts:
I am using the Magento 2.3.2 version. When I run the "setup:di:compile" command then Can't remove directory: directory is not empty error occurred.

I have also set the permission of the generated folder but no luck.

Please tell me how to do this ?

Thanks in Advance.


texts: In Magento 2, what classes should be instantiated with a factory and what not?

texts:
Magento 2 has a big 'depend on abstractions, not concretions' philosophy. One example of this is the use of Factories. Automatically generated factories.

But I'm wondering: from a software engineering point of view: what kind of classes would require factories. In my opinion factories are only required when it comes to data models or other kind of models that may or may not require persistence of some kind. For example:

A (legacy) Model (like Magento\Customer\Model\Customer).
A data model (like Magento\Customer\Model\Data\Customer).
A model that is not stored in the database but might provide functionality elsewhere (for example Magento\Framework\Api\SortOrderFactory to add sort orders to your search criteria).

However, in some cases, when persistency or dynamically generating objects is not required it makes no sense to have a factory. For example:

Resource models (it makes no sense to create a resource model like Magento\Catalog\Model\ResourceModel\ProductFactory::create() because resource models facilitate persistency and do not contain data).
Helpers (basically global methods, don't contain data)
Repositories
Management-classes
etc.

So my question for the community is: when do you decide when you need to use a factory or not?


texts: Magento Market Place issue with Component Manager

texts:
I'm having a issue after an upgrade has been done by my isp.
Since the upgrade i couldn't access Component manager.
After looking on the net i established that i cant ping the magento marketplace through ssh. Upon further digging i established that the access keys is somehow making problems in my Marketplace system config. I recreated the keys and reset the old ones but i keep getting this error

Command "show" failed: [InvalidArgumentException] Package magento/framework not found show [--all] [-i|--installed] [-p|--platform] [-a|--available] [-s|--self] [-N|--name-only] [-P|--path] [-t|--tree] [package] [version]

Im not sure what it could be can someone maybe help me out please


texts:
I tried to override the Image helper on CMS block for uploading pdf files.
Now i added the pdf files but i need to link for pdf file instead of img tag. And also i tried to override the CMS Image insert selection. but not able to override.

In di.xml,

<preference for="Magento\Cms\Helper\Wysiwyg" type="MyCompany\Name\Helper\Wysiwyg" />

Override Image helper file

  namespace Hexamarvel\Pdfupload\Helper\Wysiwyg;
class Images extends \Magento\Cms\Helper\Wysiwyg\Images {
    public function getImageHtmlDeclaration($filename, $renderAsTag = false){
         $fileurl = $this->getCurrentUrl() . $filename;
            $mediaUrl = $this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
            $mediaPath = str_replace($mediaUrl, '', $fileurl);
            $directive = sprintf('{{media url="%s"}}', $mediaPath);
            if ($renderAsTag) {
                $html = sprintf('<img src="%s" alt="" />', $this->isUsingStaticUrlsAllowed() ? $fileurl : $directive);
            } else {
                if ($this->isUsingStaticUrlsAllowed()) {
                    $html = $fileurl; // $mediaPath;
                } else {
                    $directive = $this->urlEncoder->encode($directive);

                    $html = $this->_backendData->getUrl(
                        'cms/wysiwyg/directive',
                        [
                            '___directive' => $directive,
                            '_escape_params' => false,
                        ]
                    );
                }
            }
            return $html;
    }
}


texts:
I've added some fields in a form using an array as source:

 $addInternalInformation->addField(
        'return_type', 'select',
        array(
            'name'  => 'return_type',
            'label' => $this->__('Return type'),
            'values' => Mage::getModel('modulename/source_returntype')->toOptionArray()
        )
    );

Now I'd like to show that values in the grid instead of the index, should I use a Render Class or there is a simpler method?

Thanks


texts: How to get information for payment gateway - ID or Name in magento 2?


texts:
My organization wants to create mobile application for their website

I have checked the rest API from dev docs:
https://devdocs.magento.com/guides/v2.0/get-started/rest_front.html

Is it ok to use rest API for mobile? I mean how can I send my home page data to rest API? or how can I send any other custom page developed through API?


texts: Support for Magento Commerce 2.2.x ends on December 31, 2019. Any Idea When Support for 2.3.x Will End?

texts:
Thats is in a few days. 2.3 will go EOL quite fast I suspect.
I am considering migration of my e-commerce site to Magento2. Question: Isn't it wiser to wait a bit until a version has a LTS ? Magento2 versions seem to have short life cycles..I am wondering why.


texts: Magento 2 - Passing argument from backoffice in Category Layout Update XML field to frontend module or phtml

texts:
In Magento 1 I sometimes used this way to pass an argument to a category, directly from the back office

  Category > Custom Design tab > XML Design Update

<reference name="product_list">
    <action method="setData"><key>giftCardId</key><value>955</value></action>
</reference>

Could you tell me what will be the equivalent syntax in Magento 2, Using the same way:

  Category > Design > Layout Update XML

The main idea is to pass a value for a specific category, that could be retrieved in a custom module in frontend.

Edit: I know that I can add a custom category attribute to do that too, but the point is really, does an equivalent syntax exists.


texts:
i want to rewrite the url of product  from
www.example.com/product-name.html
To
www.example.com/SKU.html

Someone can help me ?I am beginner of magento.
Thank you.


texts: Increasing collection use efficiency (getting product quantities from a collection of skus)

texts:
I have read that one shouldn't use the load() method within a for loop as this is a performance killer, however, i'd like to know how to more efficiency retrieve this information.  Below is the current loop that intakes a collection (this collection contains the product sku and the amount of items needed in our inventory for that item to be considered 'in stock') and returns true if all subsequent products are in stock and false if one of the products is out of stock.  How could I make it faster, better?

    function inStock($skus){
        if ($skus->getSize()) {
            foreach ($skus as $sku) {
                $product = Mage::getModel('catalog/product');
                $product->load($product->getIdBySku($sku->getSku()));
                $quantity = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
                if ($quantity < $sku->getRequiredQuantity()) {
                    return false;
                }
            }
        } else {
            return false;
        }
        return true;
    }


texts: unable to set store ID in place order REST API - Magento2

texts:
There is no option to set store ID in place order API:

  rest/default/V1/carts/1/order

Payload has below data only:

{
    "paymentMethod": {
                "method": "banktransfer"
     },
    "billing_address": {
                "email": "jdoe@example.com",
            "region": "New York",
            "region_id": 43,
            "region_code": "NY",
                "country_id": "US",
                "street": ["123 Oak Ave"],
                "postcode": "10577",
                "city": "Purchase",
                "telephone": "512-555-1111",
                "firstname": "Jane",
                "lastname": "Doe"
     }
}

How to set store ID here?


texts: How to get the option of changing the currency in frontend area?

texts: I basically want a drop-down menu to appear in frontend that would allow customers to switch between different currencies that I have selected as "Allowed Currencies" in the admin area. I don't necessarily want it in the header.


texts: Headers are not coming in custom email template

texts:
I have added the logo image in
Content->Configuration->My custom theme Edit->Transactional Emails->Logo but it goes to 404.

I gave full permission too but Logo image goes to 404.So in email template image is not coming. How can I fix this?


texts:
I have upgraded my Magento from 2.2.7 to 2.3.3. After I upgrade it, I can't run command line:

php -dmemory_limit=2G bin/magento catalog:images:resize

It always shows bug: libpng warning: Interlace handling should be turned on when using png_read_image

Do you have any idea? Thank you!


texts: is the final price function is not compatible with Collection of product?

texts:
I am creating a product collection using some of the product IDs as per this code:

$data = \Magento\Framework\App\ObjectManager::getInstance()->create('Magento\Catalog\Model\ResourceModel\Product\Collection')
            ->addIdFilter($product_ids)
            ->setStore($this->_storeModelStoreManagerInterface->getStore())
            ->addStoreFilter()
            //->addFinalPrice()
            ->addAttributeToSelect($this->getUsedMagentoAttributes());

By looping the product collection I am getting the product entity by this method:

 $item = $data->getItemById($product['product_id']);

I am trying to get the final price of the product using the Magento 2 function $item->getPriceInfo()->getPrice('final_price')->getAmount()->getValue() but i am not able to get the correct final price(special/sale price).

Please note, I have commented the addFinalPrice() in the collection as this creates the issue while adding the tax amounts.
Also, I do not want to use the product object by load() method as it takes too much time to process.

Please suggest.


texts: printing an order without invoicing in magento

texts: Is there a way to print an order in Magento that has not been invoiced yet? My client needs to be able to print things as soon as they come in, without having to invoice them.


texts: Convert Order to Quote and Load to Current Cart

texts:
I can successfully convert convert an order into quote but I still couldn't load it into current cart. I tried several methods but to no avail. Here's the simplest one:

$_quote = Mage::getModel('sales/convert_order')->toQuote($order)->save();
$_quote = Mage::getModel('sales/quote')->load($_quote->getId());
$_quote->setIsActive(true)->save();

I was able to get the quote ID but the quote object doesn't load to the current cart.

I also tried

$_quote = Mage::getModel('sales/convert_order')->toQuote($order)->save();
$_quote = Mage::getModel('sales/quote')->load($_quote->getId());

if ($_checkoutQuote->getId() != $_quote->getId() && $_quote->getId()) {
    $_checkoutQuote->merge($_quote)->save();
    Mage::getModel('checkout/session')
                    ->setQuote($_checkoutQuote)
                    ->init();
    Mage::getSingleton('checkout/session')->getQuote()->setIsActive(true)->save();
}

and similar approaches but still not loading the quote.
Thank you very much!


texts: Magento2 - issue when importing bundle products

texts:
This is a Magento 2.2.2 project... last season (it was 2.1.* then) we achieved to import this catalog using native import/export module (after several hours playing with .csv files)

But this season, when trying to register new products, we've found a big issue

Import process seem to work fine, but bundle products are not saleable in frontend (products return false when checking isSaleable())

There is no stock management in this project, and we have double checked status values for this products (both in backoffice & database), so it smells like another Magento2 bug (introduced at some 2.2 version). Any ideas?


texts: how we can write wsdl.xml or wsi.xml in Magento 2.2.5?

texts:
In magento 1.9.3.9, we have added the new fields in wsdl.xml and wsi.xml. then that is looking like below

image.

How can I write the above code in magento 2.2.5?


texts: how to show persian or arabic numbers in Magento?

texts:
how to convert English numbers to persian/arabic numbers in Magento? (in all frontend)

i got this but i don't know how to use it or where to copy it.

function fanum($englishnumbers)
{
$englishnumbers = str_replace(’0′ , ‘PN’ , $englishnumbers);
$englishnumbers = str_replace(’1′ , ‘PN’ , $englishnumbers);
$englishnumbers = str_replace(’2′ , ‘PN’ , $englishnumbers);
$englishnumbers = str_replace(’3′ , ‘PN’ , $englishnumbers);
$englishnumbers = str_replace(’4′ , ‘PN’ , $englishnumbers);
$englishnumbers = str_replace(’5′ , ‘PN’ , $englishnumbers);
$englishnumbers = str_replace(’6′ , ‘PN’ , $englishnumbers);
$englishnumbers = str_replace(’7′ , ‘PN’ , $englishnumbers);
$englishnumbers = str_replace(’8′ , ‘PN’ , $englishnumbers);
$englishnumbers = str_replace(’9′ , ‘PN’ , $englishnumbers);

return $englishnumbers;
}

  "PN" will replaced by "persian or arabic numbers"


texts: Magento 2 backend form date time form field

texts:
How can I get datetime as form field.I have used below code able to select date but there is no time. How can I get time also as input field.

$fieldset->addField(
            'time',
            'date',
            [
                'name' => 'time',
                'label' => __('Time'),
                'title' => __('Time'),
                'disabled' => $isElementDisabled,
                'singleClick'=> true,
                'date_format' => 'yyyy-MM-dd hh:mm:ss',
                'time'=>true
            ]
        );


texts: Magento 2 : Show Out of Stock Swatch Options On Configurable Product Page

texts:
I want to show outofstock swatch options on the configurable product even if the options is outofstock and the main configurable product is also out of stock.

I want to show that swatch options with disable functionality.


texts: As i am working on my system it gets Hang and when I restart my system it shows error on booting  ERROR=>"Read Error" as I googled it and I found that this comes because OS is corrupted. Can anyone help me out from this.I have no back of data inside the hard disk.can anyone tell me how to get backup.


texts: my custom backend and model not saving int column

texts:
here is the code in my controller of my custom backend, the save action

public function saveAction ()
{

    $id = $this->getRequest()->getPost('id');

    if ($id) {

        $action = $this->getRequest()->getPost('action');
        $details = $this->getRequest()->getPost('details');

        $model = Mage::getModel('modulename/modulename');
        $model->setData('action', $action);
        $model->setData('customer_id', $id);
        $model->setData('details', $details);

        $model->save();

    } else {
        Mage::getSingleton('core/session')->addError('No id');
    }

}

when i click the button to save the form data, the customer_id won't save to db (0 in db, other column is ok), anyone know what is the problem?


texts: Magento2 character content other than whitespace is not allowed because the content type is 'element-only'

texts:
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'handle': Character content other than whitespace is not allowed because the content type is 'element-only'.
Line: 1

I get this error when I go to the producturl.
http://muy.test:8065/en_de/test-product.html


texts: Magento 1.7 Directory Separator returning wrong seperator

texts:
I'm trying to get a function working to re size any image using a custom module and helper class. For the record I'm running this on a local XAMPP server.

If I pass a image url and a destination url using '/' all works fine. However I need to implement this with DS for future proofing. The following is an example line of code I'm using. with the DS instead of '/'

$newPath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . "resized" . DS . $fileName;

This returns (without the http or localhost at the start because stackoverflow doesn't allow that even in code) "/test/media/resized\catalog\category\testcat.jpg"

How do I make it so that DS correctly returns forward slashes?


texts:
I want to know how to display two blocks in one line to make a bar ?

When I make two widgets, they are displayed separately or one of them in a second line. How to fix it ?


texts:
I have imported ~17k products, and when reindexing the catalogsearch_fulltext index does not complete. I have tried resetting and reindexing with

php bin/magento indexer:reset catalogsearch_fulltext
php -d memnory_limit=-1 bin/magento indexer:reindex

The process starts, but appears to fail without any warning/error. If I run reindex again, it returns

Catalog Search index is locked by another reindex process. Skipping.

I cannot see any locks in the database.

Is there another way to force this to reindex?


texts: Unable to find Multi Store Links in magento 2.3

texts:
I am new to Magento. I have installed FreeGo theme in my Magento 2.3.x and I've created Multi Stores in Admin Panel but how can I view them? I am unable to find links to view them. Not in the footer, not in the admin panel. Can you please tell me how can I view those stores I have created? Where are the links...
Here is the screenshot:

Please help me

UPDATE:


texts: "Cannot initialize the indexer process." error while Reindexing Product Flat Data Index

texts: While reindexing "Product Flat Data", I am getting the following error message, "Cannot initialize the indexer process". Please suggest how to fix this and allow reindexing.


texts: How to resolve Invalid Form Key. Please refresh the page.?

texts:
I am facing this issue Invalid Form Key. Please refresh the page.

some times and sometimes not.
1. When I add Product to cart.
2. When I want to delete a product from a cart.
3. When I want to Update a cart.
4. When I want to Register.
5. When I load ajax Filter with own a javascript code.

So many times its comes localhost as well as on staging server.

So Please let me know how to resolve this issue permanently.

Staging Url is ==>https://magento-331546-1017597.cloudwaysapps.com


texts: Magento 2 Advanced Reporting User Role permissions

texts:
I have enabled Advanced Reporting (Magento 2's free one) in the back end, and from my main admin back end account, it is working fine, the subscription is set up and figures are updated daily.
I have set up a new user account on the back end for office managers who don't need all the confifguration settings, and created a new user role group for them and set up permissions including advanced reporting as per screen shot:

While logged into the new manager account set to this new role, I cannot access the advanced reporting. I need them to have permission to access it. When logged in and clicking on advanced reporting, I get the error message: "Sorry, you need permissions to view this content."
Are there hidden or special permissions for the advanced reporting feature, or will it simply not work without the backend user having full access rights to everything?


texts: How to add breadcrumbs on custom phtml page?

texts:
How to display breadcrumbs on custom phtml page in magento 1?

How to define breadcrumbs in layout xml or config file of custom module?

Please give me suggestion.

Thanks


texts: Magento 2 : Flush Magento Cache Results in Site Speed Up

texts:
I've been noticing that flushing Magento cache (by clicking on the "Flush Magento Cache" button) speeds up both Magento frontend and Admin panel.

Page load speed eventually returns to a slower state, and pressing that button restores the speed.

Anyone has any clue on why this happens?


texts: Magento 2: How to translate calendar Widget

texts:
I want to display a date of a birth calendar(create account page) as per store local.
Any help appreciate


texts: addAttributeToFilter for Multislect Attribute Update Query Magento 2

texts:
I have Multiselect product attribute and i want to filter product by that attribute.
Currently i am using below code,
$productCollection = $this->getLayer()->getProductCollection();
$productCollection->addAttributeToFilter(
                    array(
                        array('attribute'=> 'fabriccolor','finset' => 16),
                        array('attribute'=> 'fabriccolor','finset' => 17),
                    )
                );
echo $productCollection->getSelect();

The query i get like

SELECT e.*, cat_index.position AS cat_index_position,
price_index.price, price_index.tax_class_id,
price_index.final_price, IF(price_index.tier_price IS NOT NULL,
LEAST(price_index.min_price, price_index.tier_price),
price_index.min_price) AS minimal_price, price_index.min_price,
price_index.max_price, price_index.tier_price,
at_fabriccolor.value AS fabriccolor FROM
catalog_product_entity AS e INNER JOIN
catalog_category_product_index_store1 AS cat_index ON
cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND
cat_index.visibility IN(2, 4) AND cat_index.category_id=3 INNER JOIN
catalog_product_index_price AS price_index ON
price_index.entity_id = e.entity_id AND price_index.customer_group_id
= 0 AND price_index.website_id = '1' INNER JOIN catalog_product_entity_varchar AS at_fabriccolor ON
(at_fabriccolor.entity_id = e.entity_id) AND
(at_fabriccolor.attribute_id = '155') AND
(at_fabriccolor.store_id = 0) WHERE ((FIND_IN_SET(16,
at_fabriccolor.value)) OR (FIND_IN_SET(17, at_fabriccolor.value)))

The products i get which has fabriccolor value 16 or 17. Please check this screenshot,

But i want to filter the product which have both fabriccolor value 16 and 17 by code.
I want to update the query from
WHERE ((FIND_IN_SET(16,> at_fabriccolor.value)) OR (FIND_IN_SET(17, at_fabriccolor.value))) to WHERE ((FIND_IN_SET(16,> at_fabriccolor.value)) AND (FIND_IN_SET(17, at_fabriccolor.value))).
If i put the AND in the query then it gives me correct products which i want. Please check below screenshot,

So, how can i filter products by AND insted of OR.
Please help me if you have any solution.
Thanks in Advance!!!


texts: get count magento collection per day and weekly

texts:
I have table in magento database

 CREATE TABLE `topup` (
  `topup_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `customer_id` int(11) NOT NULL,
  `msisdn` varchar(20) NOT NULL,
  `amount` int(11) NOT NULL,
  `status` varchar(256) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `ipn_response` text NOT NULL,
  PRIMARY KEY (`topup_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

I want magento collection SELECT count(*) FROM topup AS main_table

I want total count base on created_at in 1 day

and

total count in week

week start from Monday.


texts:
I'm trying to remove the cms content from the homepage, whilst keeping all the meta stuff from the CMS panel.

So initially i was using:

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

which removes the cms content but it also removes all the meta stuff as well. I can remove the Page header ok with:

<referenceBlock name="page.main.title" remove="true" />

but this still keeps the cms content.

In a nut shell i have several .phtml blocks on this page which i'm including in cms_index_index.xml like so:

<referenceContainer name="content">
    <block class="Magento\Framework\View\Element\Template" name="block1" template="Magento_Cms::home/block1.phtml" />
    <block class="Magento\Framework\View\Element\Template" name="block2" template="Magento_Cms::home/block2.phtml" />
    <block class="Magento\Framework\View\Element\Template" name="block3" template="Magento_Cms::home/block3.phtml" />
    <block class="Magento\Framework\View\Element\Template" name="block4" template="Magento_Cms::home/block4.phtml" />
</referenceContainer>

i know i could add this as the 'cms content' but this isn't really an option as the people who would be updating the meta shouldnt be able to edit the cms content.

basically i just want a thing similar to this:

or the ability to remove 'cms_page' and then re-add the meta options after.


texts: Upgrade script not working in magento custom module with product relationship

texts:
I have created one install script install-1.0.0.0.1.php that is as below

$installer = $this;

$table = $installer->getConnection()
->newTable($installer->getTable('magentostudy_news/news'))

->addColumn('news_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'unsigned' => true,
    'identity' => true,
    'nullable' => false,
    'primary'  => true,
), 'Entity id')

->addColumn('title', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(
    'nullable' => true,
), 'Title')

->addColumn('author', Varien_Db_Ddl_Table::TYPE_TEXT, 63, array(
    'nullable' => true,
    'default'  => null,
), 'Author')
->addColumn('content', Varien_Db_Ddl_Table::TYPE_TEXT, '2M', array(
    'nullable' => true,
    'default'  => null,
), 'Content')
->addColumn('image', Varien_Db_Ddl_Table::TYPE_TEXT, null, array(
    'nullable' => true,
    'default'  => null,
), 'News image media path')
->addColumn('published_at', Varien_Db_Ddl_Table::TYPE_DATE, null, array(
    'nullable' => true,
    'default'  => null,
), 'World publish date')
->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array(
    'nullable' => true,
    'default'  => null,
), 'Creation Time')
->addIndex($installer->getIdxName(
        $installer->getTable('magentostudy_news/news'),
        array('published_at'),
        Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX
    ),
    array('published_at'),
    array('type' => Varien_Db_Adapter_Interface::INDEX_TYPE_INDEX)
)
->setComment('News item');

$installer->getConnection()->createTable($table);

and here is my upgrade script mysql4-upgrade-1.0.0.0.1-1.0.0.0.2.php for    alter existing table to linking product with my table

  $installer = $this;

  $table = $installer->getConnection()

->addColumn($installer->getTable('magentostudy_news/news'),'product_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'unsigned'  => true,
    'nullable'  => false,
    'default'   => '0',
), 'Product ID')

->addColumn($installer->getTable('magentostudy_news/news'),'position', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
    'nullable'  => false,
    'default'   => '0',
), 'Position')

->addIndex($this->getIdxName('magentostudy_news/news', array('product_id')), array('product_id'))

->addForeignKey($this->getFkName('magentostudy_news/news', 'news_id', 'magentostudy_news/news', 'entity_id'), 'news_id', $this->getTable('magentostudy_news/news'), 'entity_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)

->addForeignKey($this->getFkName('magentostudy_news/news', 'product_id', 'catalog/product', 'entity_id'),    'product_id', $this->getTable('catalog/product'), 'entity_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)
->setComment('News to Product Linkage Table');

When i run my URL its simply displaying blank page with no error messages There is some problem with upgrade script syntax only as install script working fine and when i remove upgrade script whole site working fine...plz help


texts: Merged JS and CSS do not work when Production mode

texts:
I was in developer mode, everything was great, when I changed to Production mode, the Merged options of CSS and JS seem to be ignored, it was back listing all css and js.

Also the product page only shows the pictures of the product in developer mode, after changing to production mode they disappear.

Any thought to help me?

The point is, I'm doing it.

Here is what I did in sequence:

bin/magento setup:upgrade

bin/magento indexer:reindex

bin/magento setup:static-content:deploy

bin/magento setup:di:compile

bin/magento deploy:mode:set production

bin/magento setup:static-content:deploy

And before even starting, the Merge options are YES and I was in developer mode.


texts: create a button that downloads a pdf created on the fly

texts:
How can I create a button that downloads a pdf file. Problem is that the pdf will get created on the fly (invoice pdf).

Currently I have a admin panel controller and within it there is a printAction

public function printAction() {

  $params = $this->getRequest()->getParams();
  $order = Mage::getModel("sales/order")->load($order_id);

  try {
    if(!$order->canInvoice())
    {
      Mage::throwException(Mage::helper('core')->__('Cannot create an invoice.'));
    }

    $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();

    $pdf = Mage::getModel('sales/order_pdf_invoice')->getPdf(array($invoice));

    echo $pdf->render();
  } catch(Exception $e) {
    Mage::log($e);
  }
}

Currently I have a button like:

<a href="<?php echo Mage::helper('adminhtml')->getUrl('aaa_kitchenboard/index/print'); ?>?orderid=<?php echo $order->getId();?>">Print