texts:
Module creates custom page on admin panel, page loads as an empty page.
By debugging I've seen that corresponding action is loaded, but for some reason it doesn't load template file, also as I could see JS and CSS links are correctly added to header.
here part from layout:

<modulname_adminhtml_controllername_actionname>
    <reference name="head">
        <action method="addJs"><file>customjs/jquery-1.7.2.min.js</file></action>
        <action method="addCss"><file>../../../../js/customjs/css/ui-lightness/jquery-ui-1.10.4.custom.css</file></action>
    </reference>
    <reference name="content">
        <block type="namespacename_modulename/adminhtml_actionname" name="modulename" />
    </reference>
</modulname_adminhtml_controllername_actionname>

Magento Version 1.8.1.0

Action:

public function actionnameAction() {
    $this->loadLayout()->_setActiveMenu('namespacename_modulename/cotrollername');
    $this->renderLayout();
}

Is there something which need to be fixed?


texts: Best practice for attribute sets when importing products

texts:
I am setting a a magento site with multiple stores for a client. The client has hundred of products and I am using Magmi to import them. Many of these products are Configurable and so I was wondering if it is best practice to create a separate attribute set for each product?
As I understand it, this should give me lots of flexibility later on for adding attributes if required. However a draw back of this is a lot of manual work to go through, analyse the products and add their attribute sets in before importing them with Magmi... If anyone can give me some info as to what they do in these situations it would be much appreciated.

Cheers!


texts: Different price on product page and cart page

texts:
For some reason I'm getting a different price prior to adding a product to the cart.
For example at product and category page the prics is $44.97 however at cart page it's beeing displayed as 45.00 (note two decimals here as well)

I want the price at cart to be $44.97 and not $45.00.


texts: Contact form not submitting. Just refreshing. No errors...nothing

texts:
Sorry if this a repeated topic, but everything I can find is out of date and not for my version.

New issue in the very long line of issues...using Magento 2.3.2. CE

The contact form is not working on our website. It is displaying fine, and all config settings are enabled and I know the email addresses are functioning because account setup, etc works.

When you enter all the details, and click 'Submit' the 'contact-us' page just refreshes with no messages or errors at all, and no mail is sent.

I am using Xstore theme, but the nuts and bolts are the same as the Magento default form. I've even replaced the Xstore 'form.phtml' with the default one and still the same result.

I have a 'contact-us' CMS page and I am using the code:

{{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}}

as per Magento documentation.

Any ideas as to why this is happening would be gratefully received.

Thank you.


texts: Add js with RequireJS on product listings page only - without adding or changing phtml

texts:
I'd like to add a some JavaScript only to the product listings page, is this possible with RequireJS and without touching a phtml file?  How?

I looked through the documentation and they suggest only three available methods:

Declarative notation using the data-mage-init.
Declarative notation with the <script type="text/x-magento-init" /> tag.
Imperative notation with the <script> tag.

Each of these methods all require adding/editing a phtml file.

Also, the documentation seems to contradict itself.

  We strongly recommend that you use the described approaches and do not add inline JavaScript.

This does not makes sense as the 3rd method they suggest is inline JavaScript!?

These methods all seem a little convoluted and over engineered, I starting to think I should only add one JS file with RequireJS for my entire theme, and have it load on every page, even if it's only being used on a few.  Is this good practice?  I just want to add some jQuery to a few pages.


texts: On what basis we need to pass the plugin parameters?how we know what should be pass?what's logic behind it?

texts:
My requirement is here:-

I have a Game booking requirement in Magento 2, just like online movie booking(e.g- booking movie from Bookmyshow, Paytm etc). there is fix number of tickets in each slot per day.user can buy the ticket for the same day or for the future.

To achieve the same I've created a configurable product and assign associated products as slots.

for same venue and slot, ticket can be book from paytm as well as bookmyshow and many more...and ticket price may vary depending on the platform(bookmyshow,paytm etc).

so to synchronize the inventory I've chosen the configurable product concept and will assign the same associated product to each configurable product.

You can visit here for more clarification:-

https://nimb.ws/ZHiauz

My problem is that I've to manage the inventory date and slot wise.suppose for a date "dd-mm-yy" and slot 10AM-11AM(it may be same or future date,slots) someone has book 2 tickets out of 50 so now 48 tickets are left for same date and slot.

I've 3 option to achieve the same:-

1-Plugin.

2-Event.

3-Overriding.

But according to the Magento 2, a plugin is the best way to customize the things and I'm using as below:-

di.xml:-

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\CatalogInventory\Model\StockStateProvider">
        <plugin name="Wakar_Wakar_Plugin_StockStateProvider" sortOrder="1" type="Wakar\Stockcheck\Plugin\StockStateProvider"/>
    </type>
</config>

MethodName:-

public function checkQuoteItemQty(StockItemInterface $stockItem, $qty, $summaryQty, $origQty = 0)

Before Plugin:-

<?php

namespace Wakar\Stockcheck\Plugin;
class StockStateProvider
{
    public function beforeCheckQuoteItemQty(){
        echo "hey " ; exit;
    }
}

It's working fine.

But my question is that how can I use the parameter in the method beforeCheckQuoteItemQty() so that I can get the data of the original method **CheckQuoteItemQty() ??

I've also R&D for the plugin concept but still not clear on what basis/reference they are passing the parameters in the plugin methods? what're the criteria?how can we know that for beforeCheckQuoteItemQty() what parameter I need to take to hold the data here?

e.g-

I've gone through Webkul Plugin tutorial:-

https://webkul.com/blog/magento2-use-plugins/

And for the "beforeAddProduct()",they are using just like :-

public function beforeAddProduct(\Magento\Checkout\Model\Cart $subject,$productInfo,$requestInfo = null) {
            $requestInfo['qty'] = 10; // increasing quantity to 10
            return array($productInfo, $requestInfo);
        }

On what basis they are passing parameters "(\Magento\Checkout\Model\Cart $subject,$productInfo,$requestInfo = null)" how can we know what parameter we need to pass, what is the logic behind it??

After getting the data beforeCheckQuoteItemQty(), I can check the previous orders based on date and time slots and can control the quantity.

You can also suggest any alternate best solution for the same scenerio,waiting for your update.

Please help me to clear the plugin concept!!!

=================Modification==========================

How can I use before plugin for the class
"Magento\CatalogInventory\Model\StockStateProvider.php" having the method "public function checkQuoteItemQty(StockItemInterface $stockItem, $qty, $summaryQty, $origQty = 0)" ??

Thanks!!!


texts: Magento 2 Import: "Check Data" and "Import" Button. What php method is called?

texts:
I have two similar questions regarding the import in Magento 2:

what class method is called when the Check Data button is clicked?

The button has this attribute onclick="varienImport.postToFrame();", but I am not able to figrure out what php file is called ultimatley.

What class method is called when the subsequent Import button is clicked?


texts:
We're new to Magento and have made a little module (Module_Catalog) that extends from the Mage_Catalog and we have some custom functionality in Mage_Catalog_Block_Navigation to create a custom menu, which all works fine.

We currently have an issue with translation files; we created custom translation files called "Module_Catalog.csv" in /app/locale/[de_DE|en_US]/ which are referenced from the config.xml.

Currently the translation files are working on our Windows dev environments, but not on the Linux staging server. Initially I though that it was an issue with the translation files, however running this test: Mage::getConfig()->getModuleConfig('Module_Catalog')->is('active', 'true'); returns false. I've also been logging Mage::log("loadModuleTranslation: " . $moduleName, null, "Module.log"); in Translate.php in the foreach that loads the transations and our module is not showing up there.

When I test Mage::getConfig()->getModuleConfig('TM_EasyTabs')->is('active', 'true'); (another module that is installed) and that returns true. I've tested this in several locations.

In local.xml we load our model like this:

<config>
    <global>
        <blocks>
            <catalog>
                <rewrite>
                    <navigation>Module_Catalog_Block_Navigation</navigation>
                </rewrite>
            </catalog>
        </blocks>

And the config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Module_Catalog>
            <version>0.1.0</version>
        </Module_Catalog>
    </modules>
    <global>
        <blocks>
            <catalog>
                <rewrite>
                    <class>Module_Catalog_Block</class>
                </rewrite>
            </catalog>
        </blocks>
        <helpers>
            <catalog>
                <rewrite>
                    <class>Module_Catalog_Helper</class>
                </rewrite>
            </catalog>
        </helpers>
    </global>
    <frontend>
        <translate>
            <modules>
                <Mage_Catalog>
                    <files>
                        <default>Module_Catalog.csv</default>
                    </files>
                </Mage_Catalog>
            </modules>
        </translate>
    </frontend>
    <adminhtml>
        <translate>
            <modules>
                <Mage_Catalog>
                    <files>
                        <default>Module_Catalog.csv</default>
                    </files>
                </Mage_Catalog>
            </modules>
        </translate>
    </adminhtml>
</config>

I'm pretty sure that the language files are working properly (because they're fine locally) but on the staging environment they won't load.

What are we forgetting / doing wrong?


texts: Magento 2 - Price filters and catalog price rules

texts: How to make Magento 2 price filter to take into account prices with applied catalog price rules? Right now price filter ignores catalog price rules and work on prices without catalog price rules applied misleading the customer. Therefore catalog price rules feature is useless.


texts: How is Amazon.in/com or Flipkart.com superfast?

texts:
I have an eCommerce site and I am comparing the performance with the top players in the market.

I want to know what they do differently so I can do the same or set up an action plan to achieve that.

Amazon.com:

Amazon website page weight is - 7.5mb
Requests to server - 329
Load time is - 3.11s
Pingdom test result http://tools.pingdom.com/fpt/#!/dv5aUz/amazon.com

Flipkart.com

Page weight is 1.7mb
Requests to server - 168
Load time is - 1.93s
Pingdom test result http://tools.pingdom.com/fpt/#!/etA4uQ/flipkart.com

My website

Page weight is 1.8mb
Requests to server 80
Load time is 6.45s
Average wait time is 74.23%

This is what I use

I use Magento 1.8.1
I use EC2 m3.medium also tried c3.xLarge
I use Cloudfront CDN
I do not use compiler
I do not use Varnish or any other full page caching modules

I tried to use compiler earlier and it did not give me any notable performace boost. So, I disabled it because, there were some regular issues when I try something new on site.
I am not using any full page cache yet. But will use one shortly.

I use cloudfront - But the funny part is, when I request a single object directly from cloudfront, the wait time is still higher. I have read some posts on AWS forum that cloudfront getting slower and wait time is higher for some other people too.

What could be the issue here?

Is this is the best performance I can get from using Magento
Is this is the best I can get from AWS
If I can achieve what amazon does, will it cost me a fortune every month?
Right now, I spend about $150 for AWS hosting expense (Max)
Or is there anything else that I can do to get my site load in 3-4 secs

Your advice will be very very helpful.


texts: Adding url parameters to UI component mass action

texts:
I have a ui component with a listing of products in magento 2.2, with a mass action function implemented.  however when it submits, i need it to also pass over a parameters from the query string.

example listing url: https://mymagentostore.com/admin/wishlist/projects/additem/wishlist_id/1234/

here is my mass action:

<massaction name="listing_massaction" >
        <action name="additem">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">additem</item>
                    <item name="label" xsi:type="string" translate="true">Add Selected Items to Project</item>
                    <item name="url" xsi:type="url" path="wishlist/project/saveitems"/>
                    <item name="confirm" xsi:type="array">
                        <item name="title" xsi:type="string" translate="true">Add Item</item>
                        <item name="message" xsi:type="string" translate="true">Are you sure you want to add selected item(s) to this projects?</item>
                    </item>
                </item>
            </argument>
        </action>
    </massaction>

I need to find a way to pass wishlist_id=1234 also when the mass action is submitted.


texts: Is there a way to delay the Javascript that gets compiled by require-config.js from being loaded in the browser?

texts:
For example in requirejs-config.js I have this
var config = {
    map: {
        "*": {
            msapp : "Magento_Theme/js/msapp"
        }
    }
};

Then I notice that it compiles into msapp.min.js in the pub/static folder. And then when I visit the site and examine the network tab, it loads right away. Is there a way to delay loading that javascript file until for example 5 seconds has passed or the user has scrolled?


texts: Coupon Code for First Time user in magento 2.1

texts:
I have override the file - Magento-Checkout- Controller-Cart-CouponPost ,
 Using orderCount of the particular customer to check whether its new user or old , but no clue whereto put the condition.


texts: how to change magento order status programatically?

texts:
I'm using magento 1.9 and I have to change the order status from shipped to delivered, both status having the same state "complete"

How can I able to change this?

I have tried following code

$order = Mage::getModel("sales/order")->loadByIncrementId(100000123);

$order->setData("state", "complete");
$order->setStatus("delivered");
$history = $order->addStatusHistoryComment('A ser executada a rotina de recarga.', false);
$history->setIsCustomerNotified(false);
$order->save();

But it gives

  PHP Fatal error:  Call to a member function getMethodInstance() on boolean in /app/code/core/Mage/Payment/Model/Observer.php on line 46


texts: M2.1.9 : How to override the magento default .phtml file under vendor\magento\module-sales\view\frontent\templates\email\items.phtml

texts:
There.
After success migration work, i need to handle devlopment work,ugh. I'm a mad newbie about Magento2 so could you let me know how to overwrite the default phtml file under vendor/magento .. folder.

FYI,

Currently, our website has no theme (it means default Luma theme, right?)
And i was trying to overwrite some phtml files using order confirmation email. (it seems that it is not much related with which theme i'm using tho).

Copied templates need to make override in:

/public_html/vendor/magento/module-sales/view/frontend/templates/email/items.phtml

Location contain templates using to override:

/public_html/app/design/frontend/Magento/default/Magento_Sales/templates/email/items.phtml

Run commands after modification

php bin/magento setup:static-content:deploy
find pub/ -type f ! -perm 0644 -exec chmod 0644 {} \;
find pub/ -type d ! -perm 0755 -exec chmod 0755 {} \;

What should i do? Thank you


texts: magento2 - how to create Scheduled Changes (Magento_CatalogStaging module) of product programmatically?

texts:
I want to set "Special Price" for product from date to date programmatically by code but don't know how, i use Magento 2 EE. I can set in admin use

then

but I want use code to set programmatically. If anyone know, please advice.


texts:
Here's the deal,

I lost some products from my site, they were erased by mistake somehow.

I have a backup of a site (just content files) from before moving to a new server and losing the products
I have a backup of a database of the above site after it had been moved to another server, but before having lost the products

I figured if I can host the site that I have backed up in localhost (on my wamp server) then at least I can look at the site before things were lost. - I would use the backup files and the backup database.

First question: is it possible to do this? i.e. to host a site from backups of files and databases that were generated at different times. - If so, how?
Here is what I've tried so far:

create alias directory pointing backup files.
import database to mysql (I had to do this via command line because it was too big)
        I was not able to associate the imported files with the the alias directory.

So then I tried:

new alias directory with a fresh magento installation
replace new installation directory files with backup files
merge new installation database with backup database
I don't think I was successful in this - the backup database being so big I had to use command prompt...

Needless to say that didn't work.

So, I went back to my first theory: trying to extract just the lost items from the database i.e. find them by sku number and extract them from all their corresponding tables.

Question #2: Is there a way to do this?

BTW this is my very first foray into database management, wamp, or any of this stuff. (my degree was in philosophy, and not the modern "existential download your memories to a computer" type, but the ancient type like "the world is made out of earth, air, fire, water, love, and captain planet" type) and to me "coding" means html, css, and copy pasting php scripts so please be nice.

If I can't do either of the things I tried above, I'll resign myself to inputing the each products back in the store manually via the magento dashboard interface.

Any suggestions would be greatly appreciated.
Thanks!


texts: Magento2 - Compare products shows lots of attributes with “N/A”

texts:
When I compare products on my store, there are a lot of I filled attributes and despite there being no value for each product I’m comparing, it still shows the attribute and a line of “N/A” values.

How can I fix this?

It also did show unused values with “N/A” on the product page but I edited the

attributes.phtml

file to fix this. I’m unsure on how I could edit the compare file to solve this though.


texts: How to resize product images without magento resize commands

texts:
We have magento setup with magento version 2.3.5-p2. Currently it is showing product broken product images. After running resize command bin/magento catalog:images:resize, product images are working fine.
Is there anyway to resize images automatically without running command manually?


texts: Magento 2 | removed bootstrap.css and it still loads it

texts:
I am not sure what has happened here...

That's the layout of my site now:

Looks like everything moved to the left hand side... Anyone came across the same issue?

I had a cached version of the site and only realised that now, not sure how long it was like this for.

UPDATE

I have found what the issue is but can't figure out how to delete it.

I installed a module yesterday and now I have a CSS conflict.

We have installed the extension, deleted static files, flush all the cache but it still loads the file from this location even tho the file no longer exist in that path!


texts: How to delete ''Procred to Checkout'' Pop Up

texts: when I add a product to my cart it displays this pop up which you do not display in the right place (depending on the screen) and on mobiles at all. How can I turn off the pop up and remove it completely? I am using Magento ver. 1.9.4.3 .


texts: Can i remove default js/calendarview/calendarview.js?

texts:
Can i remove the following inlined js and js/calendarview/calendarview.js from magento store?

<script type="text/javascript">
//<![CDATA[
enUS = {"m":{"wide":["January","February","March","April","May","June","July","August","September","October","November","December"],"abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}}; // en_US locale reference
Calendar._DN = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; // full day names
Calendar._SDN = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]; // short day names
Calendar._FD = 0; // First day of the week. "0" means display Sunday first, "1" means display Monday first, etc.
Calendar._MN = ["January","February","March","April","May","June","July","August","September","October","November","December"]; // full month names
Calendar._SMN = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]; // short month names
Calendar._am = "AM"; // am/pm
Calendar._pm = "PM";

// tooltips
Calendar._TT = {};
Calendar._TT["INFO"] = 'About the calendar';

Calendar._TT["ABOUT"] =
'DHTML Date/Time Selector\n' +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
'For latest version visit: http://www.dynarch.com/projects/calendar/\n' +
'Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details.' +
'\n\n' +
'Date selection:\n' +
'- Use the \xab, \xbb buttons to select year\n' +
'- Use the \u2039 buttons to select month\n' +
'- Hold mouse button on any of the above buttons for faster selection.';
Calendar._TT["ABOUT_TIME"] = '\n\n' +
'Time selection:\n' +
'- Click on any of the time parts to increase it\n' +
'- or Shift-click to decrease it\n' +
'- or click and drag for faster selection.';

Calendar._TT["PREV_YEAR"] = 'Prev. year (hold for menu)';
Calendar._TT["PREV_MONTH"] = 'Prev. month (hold for menu)';
Calendar._TT["GO_TODAY"] = 'Go Today';
Calendar._TT["NEXT_MONTH"] = 'Next month (hold for menu)';
Calendar._TT["NEXT_YEAR"] = 'Next year (hold for menu)';
Calendar._TT["SEL_DATE"] = 'Select date';
Calendar._TT["DRAG_TO_MOVE"] = 'Drag to move';
Calendar._TT["PART_TODAY"] = ' (' + "today" + ')';

// the following is to inform that "%s" is to be the first day of week
Calendar._TT["DAY_FIRST"] = 'Display %s first';

// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";

Calendar._TT["CLOSE"] = 'Close';
Calendar._TT["TODAY"] = "today";
Calendar._TT["TIME_PART"] = '(Shift-)Click or drag to change value';

// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%b %e, %Y";
Calendar._TT["TT_DATE_FORMAT"] = "%B %e, %Y";

Calendar._TT["WK"] = "Week";
Calendar._TT["TIME"] = 'Time:';
//]]>
</script>

I am using gmetais/unuedjs tool to find unused default js.
It's showing that js/calendarview/calendarview.js is not used, but the above inlined js uses its function (so i will need to remove both of them).

I am wondering where and when exactly this date settings/scripts are used by magento, and if they can be removed?


texts: Block "catalog/product_list_random" shows no products in CMS

texts:
I'm using Magento 2.0.2.

I want to display a random collection of products from the catalog on my home page.  In the CMS for my home page, i use the following code:

{{block type="catalog/product_list_random" template="catalog/product/list.phtml" num_products="12"}}

{{widget type="Magento\CatalogWidget\Block\Product\ProductsList" products_count="4" template="product/widget/content/grid.phtml" conditions_encoded="a:1:[i:1;a:4:[s:4:`type`;s:50:`Magento|CatalogWidget|Model|Rule|Condition|Combine`;s:10:`aggregator`;s:3:`all`;s:5:`value`;s:1:`1`;s:9:`new_child`;s:0:``;]]"}}

The product_list_random block displays nothing, but the widget displays products just as I would expect.

Why does the block render nothing at all?  How can I display a collection of random products on the home page?


texts: Magento 2 Not able to override \Magento\Directory\Block\Data Class

texts:
I am trying to override Block \Magento\Directory\Block\Data with following method getCountryHtmlSelect() with following script, but it's not executing.

  di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Directory\Block\Data" type="Magenticians\Modulecontact\Block\Data" />
</config>

<?php

namespace Magenticians\Modulecontact\Block;

use Magento\Framework\View\Element\Template;

class Data extends \Magento\Directory\Block\Data
{

    public function getCountryHtmlSelect($defValue = null, $name = 'country_id', $id = 'country', $title = 'Country')
    {
        exit;
    }

    public function test()
    {
        exit;
    }
?>


texts: Magento v2.1 recently bought popup window

texts:
Can anyone suggest a extension for M2 which shows a window (left hand corner of screen) with the recently purchased items.

Have seen a few for v1.9, but can't track one down for M2.

Similar to this extension - https://www.alingaecommerce.com.au/magento-extension-someone-recently-purchased

Thanks in advance.

Terry


texts: Magento 2: Overwrite Block file of Magento Module

texts:
I want to overwrite some lines in

  /vendor/magento/module-customer/Block/Account/AuthorizationLink.php

How can I do this? I appreciate any help =)


texts: How to move the block under the sidebar in the payment step of checkout

texts:
I have a block that I display on the checkout at the bottom of the page

<referenceContainer name="page.wrapper">
    <block class="Magento\Framework\View\Element\Template" name="checkout_attention_block" after="main.content" template="Magento_Checkout::checkout-attention.phtml" />
</referenceContainer>

How to add this block under the sidebar block

<aside role="dialog" class="modal-custom opc-sidebar opc-summary-wrapper


texts: Remove "Reorder" Link from customer side

texts:
How to remove "Reorder" link from customer's Account "My order tab" and also from Order view page of Customer.

I want to do this from customer's account. Admin can reorder from back end.

Magento version : 1.7


texts: How to get Product Attribute at Order Success Page Magento 2?

texts:
How can i get a Custom Attribute from an Ordered Product at the Order Success Page? I can load the Product Names but not the Attributes.

<?php
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $order = $objectManager->get('Magento\Sales\Model\Order')->loadByIncrementId($block->getOrderId());
        $items = $order->getAllVisibleItems();
        foreach ($items as $item) {
            $alter = $item->getResource()->getAttribute('altersklasse')->getFrontend()->getValue($item);
            if ($alter == 18) {
                echo $item->getName();
            };
        }
?>


texts: Adding a product in Magento "Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 139564 bytes)"

texts:
I'm new to Magento and I can see that it is a sophisticated system with a lot of depth, but I've come across many headaches since switching to it from OpenCart. The first and foremost is this error that I get when trying to add a product:

  "Fatal error: Allowed memory size of 41943040 bytes exhausted (tried
  to allocate 139564 bytes) in
  /home/vainlane/public_html/mag/app/code/core/Mage/Core/Block/Abstract.php
  on line 944"

In the htaccess there are these lines:

php_value memory_limit 512M
php_value max_execution_time 38000

I modified the original 256 to 512, but no difference. Can anybody point me in the right direction here? Pretty stumped. I'm using this installation on a cPanel configuration on reseller hosting.


texts:
I found out how to get the first item from a collection:

$pageId = Mage::getModel('cms/page')->getCollection()
          ->addFieldToFilter('identifier', 'your name in the pages')
          ->getFirstItem()
          ->getId();

But now I have 3 IDs with the same name but different store views.
How can I get these item-Ids?
When I write that statement above without "getFirstItem()" and/or without "getId()" then Magento throws me an error.


texts: How to apply dependent price combination in product custom options dependency with Main price in Magento 2

texts:
- Product is eligible for purchase and lease
 - purchase price is 240
 - lease price is 24 per month (240 for 240 months)

1. How to make price dependent with this custom option with main price

ex.

If Option is purchase then price will be 240
If option will be lease the price will be Main price/Rental Term

2. How to make combination price for Rental Term and Service (Both are product custom option)


texts: What is best Guide/Resources for Magento 2 custom extension development?

texts:
It looks the major structure changes in Magento 2.x, I was developing a custom extension for Magento 2.x. But it looks nightmare to me.

What is best approach to start on Magento 2.x custom extension ?
What are the major changes there ?
Best follow up guide or resources ?


texts: Good solution to convert a varchar attribute to text attribute

texts:
I want to convert a varchar attribute to a drop down,
is there a better solution than https://www.dckap.com/blog/magento-2-changing-product-attribute-type/


texts:
I am trying to get data from a custom table which I have added to the database. But when I call data from it I do not get anything from that table. My page displays data I had previously requested, from an alternate custom table, but the additional data I require is not showing.

Looking in var/log/exception.log I see a message which includes

  Column not found: 1054 Unknown column 'prefcentreOptions.prefcentreoptions_id' in 'where clause''

from this message I assumed there was a problem with my config.xml (but I can't see one) as you can see from my config my additional table is called prefcentre, I pull data from here successfully, it is prefcentreOptions that I am having trouble with

...
<models>
        <prefs>
            <class>Ps_Prefs_Model</class>
            <resourceModel>prefs_resource</resourceModel>
        </prefs>

        <prefs_resource>
            <class>Ps_Prefs_Model_Resource</class>
            <entities>
                <prefs>

prefcentre

                </prefs>
                <prefsemail>

prefcentreOptions
//not showing
                </prefsemail>
            </entities>
        </prefs_resource>
....

I then took a look at my models (I have commented what my understanding of each file does, I would appreciate it someone could please correct if i'm wrong - which i'm sure i am)

class Ps_Prefs_Model_Prefsemail
    extends Mage_Core_Model_Abstract
{
    public function _construct()
    {   //initalises the model _init('module/modelname', 'targetedColumn')
        $this->_init('prefs/prefsemail', 'prefcentreoptions_id');
    }
}

class Ps_Prefs_Model_Resource_Prefsemail
    extends Mage_Core_Model_Resource_Db_Abstract
{
    protected function _construct()
    {    //initalises the resource _init('module/modelname', 'targetedColumn')
         $this->_init('prefs/prefsemail', 'prefcentreoptions_id');
    }
}

class Ps_Prefs_Model_Resource_Prefsemail_Collection
    extends Mage_Core_Model_Resource_Db_Collection_Abstract
{
    protected function _construct()
    {   ////initalises the collection _init('module/tablename')
        $this->_init('prefs/prefcentreoptions');
    }
}

In my database there is a table called prefcentreOptions with a column called prefcentreOptions_id which contradicts the exception I have recieved

So far I have not really considered what each one of these files does, apart from the very basic comments which I have added any further explination of above files and assistance as to why my module is not working will be very helpful


texts: Magento 2: How to show New Products in a particular Category?

texts:
I have a category named NEW and I want to show all new products in this category (filter by  Set Product as New From To attribute), how can I do that?

Thank you.


texts: Magento 2.3.0 product image cache resizing images

texts:
All my images are 1024X1024 HQ images. When magneto move the imaged to cache folder it resize it and make i get smaller images with white frame all around it (see images "before").
I try to fix it by changing the etc/view.xml file but same problom. to fix it i have copy all images from /pub/media/catalog/product/ TO /pub/media/catalog/product/cache/b3b166914d87ce343d4dc5ec5117b502/
same location the images show on . This have fix the problem BUT after 24H images go back to same size with the white frame.

Can you understand what making it ? how it can be that after 1 day the cache images change back again?

Thanks


texts: Magento2 Cart Discount rules - 2 different rules for two different products

texts:
I have tried setting up the following  Magento2 Cart Discount rule and have not been successful :
If cart total with tax is equal to or greater than 50
15% discount on products A or B or C or D if in cart
25% discount on all other products in cart (except for A, B, C or D which get 15%)
These discounts only apply to those in customer group W.
Any assistance would be greatly appreciated.
Many thanks, LEF


texts: Filter in grid with custom renderer product_id

texts:
My problem is: Filter for columns with custom renderer not working. I tried that,

protected function _prepareColumns() {

    ...

    $this->addColumn('tipo_producto', array(
        'header'    =>Mage::helper('reports')->__('Tipo Producto'),
        'index'     =>'tipo_producto',
        'renderer'  => 'organizadosreports/widget_grid_column_renderer_tipoproducto',
        'filter_condition_callback' => array($this, '_myCustomFilter'),
    ));

    ...

}

Renderer is:

class Organizados_Reports_Block_Widget_Grid_Column_Renderer_Tipoproducto
    extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
    protected $_defaultWidth = 100;

    /**
     * Returns value of the row
     *
     * @param Varien_Object $row
     * @return mixed|string
     */
    protected function _getValue(Varien_Object $row)
    {
        try {
            $product_id = $row->getData('product_id');
            $attributeValue = Mage::getModel('catalog/product')->load($product_id)->getAttributeText('tipo_producto');
            return $attributeValue;
        } catch (Exception $e) {
            return '';
        }
    }
}

My custom filter

protected function _myCustomFilter($collection, $column, Varien_Object $row)
{
    if (!$value = $column->getFilter()->getValue()) {
        return $this;
    }

    $this->getCollection()->getSelect()->where("main_table.tipo_producto like ?","$value");

    return $this;
}

Error:

a:5:{i:0;s:99:"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.tipo_producto' in 'where clause'";i:1;s:6514:"#0 ...

Could anybody help me?

Thanks.


texts: How to execute a set of php functions in every page load?

texts:
My need was to define couple of php functions and call those php functions every time a page is loaded. As of Now I am directly modifying the Head.phtml and Head.php to get it done.

Is there a clean magento way to do this task ?


texts: Can I Prevent Magento 2 from appending a number when uploading images?

texts:
We recently upgraded to Magento 2.  On our M1 install, we used a script which did direct database insertion for our product images.  This had the effect of allowing us to use one image for many products.  For example, a hat may have multiple sizes in the same color, but they can all share the same image.  This made it very easy if we had to replace images, which was a simple file-level copy-and-replace script.

On upgrading to Magento 2, the script was rewritten to use Magento's internal functionality.  However, now when importing images, each size gets its own copy, with a number appended to the end.

This means that now, we're using 4x or 5x more space for a given product, as well as adding the step of deleting all images (up to 6 per product) for all sizes of a given product, since we can't really use the replacement script.  This could mean going in and having to edit 4 or 5 per product that we're updating.  Needless to say, this is a less-than-ideal situation.

Is there any way to prevent Magento from appending that number?  Preferably only when using the upload script?


texts: Magento Product "created_at" Date Format Keeps Changing

texts:
Any time a product is updated and saved, its "created_at" entry in the "catalog_product_entity" database table is updated to the format YYYY-DD-MM, but it should keep it as YYYY-MM-DD. The date/time do not change, only the format. It isn't a big problem in itself, but it is creating problems when I attempt to sort products by creation date.

Here is an example:

created_at before: 2015-04-10 13:21:09 (YYYY-MM-DD)
edit and save product via Magento
created_at after: 2015-10-04 13:21:09 (YYYY-DD-MM)

Extra information: It is a Magento 1.9.1 store with the locale set to English (US) and timezone set to Los Angeles. The products from the store were originally imported via Magento's Import/Export feature from a wooCommerce store. Let me know if you need any more info.


texts: Error on list page - Search results only

texts:
Hi I am getting an error when I try and pull back review stars from Feefo. I have the following code in my list.phtml which works fine when browsing through products. However on the search results page it errors!

<?php echo $this->getChild('feefo_category_product_logo')->setProduct($_product)->toHtml(); ?>
Fatal Error:  Call to a member function setProduct() on a non-object in "/path/list.phtml" on line 98

Does anyone have any idea why it would throw up this error on the search page and not on a category listing page?

Thanks


texts:
We're using an image tool to create product image watermarks, most marketing services (Google Merchant Center for example) do not approve of watermarked images.

Can anybody think of a method whereby product image watermarks could be removed automatically using Magento?

Also, would it be possible to do hotlink prevention on the images themselves?


texts: How to import an existing project on Magento 1.7 to my local workspace?

texts:
I have tried to import an existing project on a web server of Magento 1.7 into my local web server xampp on windows, but it's been impossible.

I have all the files and folders on the project directory, and i also imported the database.

I have access to the dashboard, and i can see some features that are on the database, like for example, when i'm creating a page i can select a custom theme which information is in the database, with this, i can confirm that the magento installation on my web server is reading the database properly.

My problem is that i can't see any of the existing pages on the web server on my dashboard > CMS > Pages and i need to modify one of them, but i can't do it as i can't see it.

Could it be that i'm missing a configuration file?

I aprecciate any help you can offer me, i'm complete new in magento and i really need help with this.

If you need some more details about the installation or something in order to be able to answer, please feel free to do so, i will answer!

Thank you already!


texts: Dynamically change template based on user type

texts:
We're about to move to Magento 2.3.
Trying to understand whether a product page can display one of two actions based on the visitor/customer type.

I have one product with two different customer types.

The product information is the same for both but the action I want them to take is different.

B2C customers should be asked to buy the product.
B2B customers should be asked to fill in a form to speak to a rep.

If the customer is unknown then we ask to self-select their customer type, otherwise we direct them to areas of the website that is relevant to them.

If the customer is B2B then instead of price and Buy Now button they are presented with a button to Speak To A Rep.

I'm not looking for a technical response - just some advice.

I was told this was only possible via an extension that is going to cost more than we can afford at the moment. Is this true?

Seems like it should be configurable natively.


texts: What's the best event/way to listen for all order state changes in Magento 2?

texts:
I want to observe every order state change and react depending on the old and new status. What is the best way to accomplish this in Magento 2?

It looks like there is the event sales_order_state_change_before but unfortunately it does not seem to fire on state changes. There is also a considerable list of other events which fire in some cases of order changes:
sales_order_invoice_pay
sales_order_payment_place_end
sales_order_payment_capture
sales_order_payment_pay
... just to name a few.

However I'm not exactly sure when which of above events fire and it definitely looks like they only fire in very special occasions. But I need a way which guaranteed covers all state changes and allows me to query the old and new status.
What is the best way to achieve this, am I missing an event or is there a better way than registering an observer?


texts: Override construct function in child class magento2

texts:
I want override a model class, for this I have made entry in di.xml and created a respective file on my custom module. My file is calling but now here apart from modify other functions I also need to modify __construct() function of base class. But I don't know how to do it -

Here is my base class construct function -

public function __construct(
    \Magento\Framework\Model\Context $context,
    \Magento\Framework\Registry $registry,
    \Magento\Framework\Api\ExtensionAttributesFactory $extensionFactory,
    \Magento\Framework\Api\AttributeValueFactory $customAttributeFactory,
    \Magento\Payment\Helper\Data $paymentData,
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    \Magento\Payment\Model\Method\Logger $logger,
    \Magento\Framework\Session\SessionManagerInterface $session,
    \Magento\Customer\Model\Session $customerSession,
    \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
    \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
    array $data = []
) {
    parent::__construct(
        $context,
        $registry,
        $extensionFactory,
        $customAttributeFactory,
        $paymentData,
        $scopeConfig,
        $logger,
        $resource,
        $resourceCollection,
        $data
    );

    $this->_customerSession = $customerSession;
    $this->_session = $session;
    /*
     * set api key for payment  >> sandbox api key or live api key
     */
    if ($this->getDebugFlag()) {
        \Stripe\Stripe::setApiKey($this->_helper->getConfigValue('api_key'));
    } else {
        \Stripe\Stripe::setApiKey($this->_helper->getConfigValue('api_key'));
    }
}

I want to modify this construct function and want to add below more objects -

\Magento\Framework\ObjectManagerInterface $objectManager,
\Magento\Checkout\Model\Session $checkoutSession,
\Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig

$this->_priceCurrency = $priceCurrency;
$this->_objectManager = $objectManager;
$this->_checkoutSession = $checkoutSession;
$this->_scopeConfig = $scopeConfig;

In my custom module's overrided class how can I do this ?

Thanks


texts: Magento 2 How to get all images of a product?

texts: How to get all images of a specific product in Magento 2?


texts: Any reason why Magento has chosen not to compress images?

texts:
There is a particular line in htaccess where compressing images are disabled:

# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

I would like to turn image compression on but I'm looking if there's a reason behind it.


texts: How to check whether the customer logged in or not using data attribute in template without using block?

texts:
I have Link to open a popup modal. But before open the popup it should check whether the customer is logged in or not? If logged in It will show my popup modal else it should show one alert
template file
I have mentioned below code in my template

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$context = $objectManager->get('Magento\Framework\App\Http\Context');
$isLoggedIn = $context->getValue(\Magento\Customer\Model\Context::CONTEXT_AUTH);
if ($isLoggedIn):

    $class = "action add add-your-review";

else:
    $class = "open-login-poup";

endif;

How do I get customer id or name using data attribute in my template

js file

 function ($) {
            "use strict";
            // Review form
            var abc = {
                type: 'popup',
                responsive: true,
                innerScroll: true,
                buttons: false,
                title: "Header contant",
                modalClass: "popup-center xxx-product-review",
                clickableOverlay: true,
                heightStyle: "content"
            };
            var xxx = $('#review-form-content-wrapper').modal(abc);
            $(".add-your-review").click(function () {
                xxx.modal("openModal");
            });

            return function (config) {
                $('#review-form').on("click", "#review-submit", function () {
                    var form_data = $("#review-form").serialize();
                    var reviewurl = config.url;
                    $.ajax({
                        url: reviewurl,
                        type: 'POST',
                        // Pass the submitted form data to Controller
                        data: form_data,
                        success: function (response) {

                            var returnedData = JSON.parse(response);
                            if (returnedData.status === 'success')
                                $("#success").html(returnedData.messages);
                            else
                                $("#error").html(returnedData.messages);
                        },
                        error: function (response) {
                            var returnedData = JSON.parse(response);
                            $("#error").html(returnedData.messages);
                        }

                    });
                    return false;

                });
            };

        });


texts: How to close the mobile navigation menu when outside the click of menu Magento 2?

texts:
I want to close the navigation menu when the click on outside the menu like body part how can i do that: i attach the code below

$(".mobile-bar-icon").click(function(){
        $(".mobile-bar-content").addClass("open");
    });
    $(".mobile-bar-close").click(function(){
        $(".mobile-bar-content").removeClass("open");
    });


texts: Clone and append a clonned block - catalog/product_price, only to the current's product price block

texts:
The goal is to append a block, after the product price, on the product view page using an observer.

To this moment, I was able to:

clone the catalog/product_price
set the clone as a child-block
and set a custom type and template for it

The issue is, that there are additional blocks on the page, that include a catalog/product_price block. Tier-prices and related products namely.
I would like exclude them from the block cloning and child addition process.

the relevant config.xml part:

<frontend>
    <events>
        <core_block_abstract_to_html_before>
            <observers>
                <namespace_modulename>
                    <type>model</type>
                    <class>namespace_modulename/observer</class>
                    <method>insertBlock</method>
                </namespace_modulename>
            </observers>
        </core_block_abstract_to_html_before>
    </events>
</frontend>

the observer:

    class Namespace_Modulename_Model_Observer {

    public function insertBlock($observer){

        $_block = $observer->getBlock();
        $_type = $_block->getType();
        if ($_type == 'catalog/product_price') {
            $_child = clone $_block;
            $_child->setType('some/block');
            $_block->setChild('kiddo', $_child);
            $_block->setTemplate('namespace/modulname/additional.phtml');
        }
    }
}

How would you advise to do that, preferably in canonical Magento API way ?


texts:
Today, i login into admin panel & Go into customer->manage customer.
The grid contain lists of customer but customer name column contain URL & in different language instead of english.

Please see the below image. Is this bug ??
If yes, ten how to solve this.


texts: Error 502 when upgrade magento 2.2.3 to 2.2.9

texts:
We're facing a weird issue, we were working with Magento 2.2.3 by a year aprox. and decided to upgrade our Magento open source version to 2.2.9:

We made a clean installation of Magento 2.2.9  in our CI env.
Imported catalog through cvs file generated by our Magento 2.2.3.
Our server has 2G of memory and PHP 7.1 has memory limit 1G

all fine with the installation for clean CI enviroment, but when browse  some products we get a 502 bad gateway nginx error, but only in some products, even if those products are in the same category with others similar products.

that didn't happen with 2.2.3, and really don't know what to do.


texts: The contact us page in the RWD theme has the "name" box as the active element when you land on the page so the cursor is in this box and it is highlighted. This is a nuisance on a mobile device because you are hit with a keyboard in your face whenever you go to this page. How can I disable the "name" box being active?


texts:
I try get custommer is login. it not success. this is my code

protected $_customerSession;
public function __construct(
...
\Magento\Customer\Model\Session $customerSession,
....
){
...
$this->_customerSession = $customerSession;
...
}
 public function getCustommer()
    {
         if ($this->_customerSession->isLoggedIn()) {
            die('islogin');
            return $this->_customerSession->getCustomer();
         }else{
             die('not login');
         }

    }

result not login any help.
what wrong?

or also other ways to GetCustomer isLogin. please tell me.


texts: What is the use of php bin/magento dev:di:info command?

texts:
With Magento 2.3, console command found which helps developers to find all the classes related to dependency injection.

It seems that it shows dependency Injection classes from di.xml from all areas.

Ques: Does anyone know whether it shows which modules do have a dependency on which modules?


texts: Magento 2.3 - Error related to Amasty shopby while RUNNING setup di:compile

texts:
MiBPHP Fatal error:  Declaration of
  Amasty\Shopby\Model\Source\Attribute\Extended::toOptionArray() must be
  compatible with
  Amasty\Shopby\Model\Source\Attribute::toOptionArray($boolean = 1) in
  /home/ubuntu/environment/the-new-craftsmen/app/code/Amasty/Shopby/Model/Source/Attribute/Extended.php
  on line 28

public function toOptionArray()
    {
        $allOption = [[
            'value' => self::ALL,
            'label' => strval(__('All Attributes'))
        ]];
        return array_merge($allOption, parent::toOptionArray());
    }


texts: Magento2 Tax not shows for Not logged in Customer issue

texts:
I'm using magento2. After add to cart product as guest customer tax not showing up on checkout page in Order Summary section but for registered customers tax showing up on checkout page. I have attached two images one for logged in customer and one for non-logged in customer.
Notloggedin image here

Retail customer login after  image

cart page image

Any help should be appreciated here. Thanks.


texts: How to use customer_logout event in magento?

texts:
I wanna use customer_logout event to un-register data from registry.

Can anybody help?


texts: How to fix Magento's incorrect Soap V2 location address

texts:
I'm trying to use Magento's SOAP V2 api. The URI path for the API is http://www.example.com/api/v2_soap.  When I'm making my request I'm using http://www.example.com/api/v2_soap?wsdl.  The request correctly shows the wsdl xml file but if I try to run this code from the command line I get an error that says 'looks like we got no XML document':

        try{
                $client = new SoapClient('http://www.example.com/api/v2_soap?wsdl');
                $session = $client->login('username', 'apiKey');

                var_dump($session);
    }catch(Exception $e){
        var_dump($e->getMessage());
        var_dump($client->__getLastRequest());
        var_dump($client->__getLastResponse());
    }

I believe I've narrowed this down to the soap:address in the wsdl file.  The location value is set to the index.php file rather than the api path or the api.php file.

<service name="MagentoService">
  <port name="Mage_Api_Model_Server_V2_HandlerPort" binding="typens:Mage_Api_Model_Server_V2_HandlerBinding">
  <soap:address location="http://www.example.com/index.php/?type=v2_soap"/>
 </port>
</service>

I can't quite find where this url is generated or how to change it to the correct value.

In addition to using http://www.example.com/api/v2_soap?wsdl I've also tried using http://www.example.com/index.php/api/v2_soap?wsdl as I've seen mentioned in other questions, but that doesn't have any effect on the address location value.

Any help to point me in the right direction would be greatly appreciated.


texts:
How we call getBlockSingleton() in magento 2

echo $this->getBlockSingleton('newmodule/newblock');


texts: Implement Graylog in Magento 2.3 with GelfHandler

texts:
My Magento 2.3 installation came along with a GelfHandler.php class that sends messages to a Graylog2.
The GelfHandler class looks like:

<?php

/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Monolog\Handler;

use Gelf\IMessagePublisher;
use Gelf\PublisherInterface;
use Gelf\Publisher;
use InvalidArgumentException;
use Monolog\Logger;
use Monolog\Formatter\GelfMessageFormatter;

/**
* Handler to send messages to a Graylog2 (http://www.graylog2.org)
server
*
* @author Matt Lehner <mlehner@gmail.com>
* @author Benjamin Zikarsky <benjamin@zikarsky.de>
*/
class GelfHandler extends AbstractProcessingHandler
{
/**
 * @var Publisher the publisher object that sends the message to the server
 */
protected $publisher;

/**
 * @param PublisherInterface|IMessagePublisher|Publisher $publisher a publisher object
 * @param int                                            $level     The minimum logging level at which this handler will be triggered
 * @param bool                                           $bubble    Whether the messages that are handled can bubble up the stack or not
 */
public function __construct($publisher, $level = Logger::DEBUG, $bubble = true)
{
    parent::__construct($level, $bubble);

    if (!$publisher instanceof Publisher && !$publisher instanceof IMessagePublisher && !$publisher instanceof PublisherInterface) {
        throw new InvalidArgumentException('Invalid publisher, expected a Gelf\Publisher, Gelf\IMessagePublisher or Gelf\PublisherInterface instance');
    }

    $this->publisher = $publisher;
}

/**
 * {@inheritdoc}
 */
protected function write(array $record)
{
    $this->publisher->publish($record['formatted']);
}

/**
 * {@inheritDoc}
 */
protected function getDefaultFormatter()
{
    return new GelfMessageFormatter();
}
}

I need guidance how to implement this into my project. Thank you.


texts: Magento 2.1: create a WYSIWYG field in a custom widget

texts: Is there a way to create a custom widget with WYSIWYG fields? I followed this tutorial here but when I enter data, they are not saved.


texts: Why does this code change in text editor each time on save?

texts:
i want to create a footer block for Follow Us

But each time i save the block i lose the code that is between span... tried different ways but no luck...

anyone know how to do this?


texts: How to display options on Magento 2 associated products page if they display individually in catalog page

texts: In magento 2 catalog page all configurable products are listed along with associated products(I changed the Not visible individually to Catalog,Search).Now when clicking on the associated products(Simple product) I want to display the options available with the parent product( Configurable Product)


texts: Magento 2: Clear Direction on Controller Result Factories

texts:
In a controller's execute method, has there been any clear guidance from the Magento core team if client developers should

Be using the individual PageFactory, JsonFactory, RawFactory, etc objects
Or using the more generic Magento\Framework\Controller\ResultFactory object along with the ResultFactory::_TYPE constants

when they want to instantiate an object to return?

If you're not familiar with the issues/confusion around this, I'm talking about the things in the following post.  It's not clear if, going forward, Magento's supporting all these methods, or if there's a particular style/technique they prefer (and will support) going forward.


texts: Is there any option to remove "Amex" card from paypal?

texts: Paypal - Website Payments Standard allows 'master', 'visa', 'amex', 'discover' cards on the paypal page do we have any option to remove amex from the listed cards via magento paypal Api? Is there any core hack. or If this was not a problem with Magento itself then I can go through the paypal settings to stop accepting the amex (But I haven't found any solution, still posting this as a question..)


texts: Got 404 Not Found from nowhere (I guess)

texts:
So I was working fine with my site and my admin panel, but today I wanted to access my frontend and I see this

And in the tab I see

I can't neither access the backend.

What can be happening?
Thank you!!


texts: SUPEE-1533, SUPEE-5344 Possible Problems?

texts:
I tried to install patches Magento SUPEE-1533, SUPEE-5344 CE 1.8.1 without ssh access direct file upload  but after install there's error both backend and website became unaccesable  so i replaced all files with old one

SUPEE-1533

app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php
app/code/core/Mage/Adminhtml/controllers/DashboardController.php

SUPEE-5344

app/code/core/Mage/Admin/Model/Observer.php
app/code/core/Mage/Core/Controller/Request/Http.php
app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php
app/code/core/Mage/XmlConnect/Model/Observer.php
lib/Varien/Db/Adapter/Pdo/Mysql.php

but there's error now when try to access backend . frontend is fine.

Mage registry key "_singleton/catalogsearch2/feed" already exists


texts:
I am new to stackexchange.

Apologies if I am not providing enough information but just wondered if anyone can help.

I am looking at moving my website over to the magento platform as I have been offered an API Feed by my drop shipping supplier.

They have said that I can pull all info from their feed including product info, images, prices, stock ect.

Would anyone know if this is possible? and if so how easy it is?

I look forward to hearing from you.

Bubble


texts: Magento 2 get product name in summary js file / configuration product name get undefined - attribute

texts:
I need to get a parent product name in vendor/magento/module-configurable-product/view/adminhtml/web/js/variations/steps/summary.js (summary.js file)
Is it possible if yes how can I achieve this?
for edit configuration product parent proudct name get undefined - attribute


texts:
This error occurred when the customer has clicked the PayPal button:

  PayPal gateway has rejected request. Currency is not supported (#10605: Transaction refused because of an invalid argument. See additional error messages for details).

Could you help me what should i do?


texts: Magento 2: why we should pass all required fields to update one field of customer by REST API?

texts:
I have created rest api for customers who update the one customer field.
This is below code to updaye customer by REST API
Any other way to update the customer by REST API without the pass mandatory fields ?
I HAVE TO UPDATE ONLY ONE FIELD taxvat for that I have to forcefully passed the firstname,lastname,email,websiteId,email and id.
Any trick in REST API to update the one field without passing all mandatory fields or just passing by email or customer id ?
Note: Mandatory fields have values so why rest api throw message that firstname,lastname and email is missing.
<?php
$url= "https://example.com/rest";
$accessToken=  'asadsadrjt5l46jl45nmnfsdfd';
$setHeaders = array('Content-Type:application/json','Authorization:Bearer '.$accessToken);

$url = $url."/V1/customers/27";
$apiUrl = str_replace(" ","%20",$url);

$ch = curl_init();
$customerData = [
    'customer' => [
        'id' => 27,
        'email'=>'test@test.com',
        "firstname"=>"Identify",
        "lastname"=>"Identify",
        "taxvat" => "1982",
        "websiteId" => 1
        ]
    ]
];

$data_string = json_encode($customerData);
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $apiUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $setHeaders);
$token = curl_exec($ch);

$response = json_decode( curl_exec($ch), TRUE);
curl_close($ch);
echo "<pre>";print_r($response);exit;
?>


texts: How can I add new icon label for category in menu?

texts: I need to display label like new, hot sale, offer for the category in the menu. How can I do that?


texts: How to show simple calatog search form on CMS page?

texts:
How do i add a simple catalog search form on a CMS-page?

Is there a widget code or something for this, just an easy way to implement it anywhere.


texts:
I have created two views, one for English and one for the French.
The default view is French.
When the user chooses the English view there are switched to the French view when switching to https.

I have not found anything in the configuration of magento to resolve this bug.


texts: Magento 2.2.6 overriding css or less files or locating the actual file to edit

texts:
Not sure why i'm finding this so difficult but I have a file that has some css that needs to be fixed. The file and code are in these files:

pub/static/frontend/website/mywebsite/en_US/css/styles-l.min.css
var/view_preprocessed/pub/static/frontend/website/mywebsite/en_US/css/styles-l.min.css

The style change i need to make is only on checkout/cart/ as well.

I looked for this same styles-l.min.css file in app/design/frontend/website/mywebsite/ but it's no where to be found.

I know i'm not suppose to edit those files but when i edit those files directly i get the outcome that i want... but of course when i deploy it gets rinsed. How do i make the proper change?

Not much of a frontend guy so any help would be greatly appreciated. Thank you.


texts:
Just a quick question on Magento file structure.

I have a site where images are coming out too small and being scaled up. I've changed the resize to the correct size but the images are still not looking great with compression turned completely off.

I want to double check what size the product images were before the resize was done. Where are these base images located so I can check their size?

Are they the images in media/catalog/product/[firstletter]/[secondletter]/ ?


texts: How to setup different prices for same product for magento 2 store view?

texts:
We are currently running one website, one store, two store views (languages) for example one default store and second create new store Magento 2 install.
But I want to save prices multiple store views I am not able to how to set it.
I have to set price scope to "Website" instead of global in below settings.

Stores->Configuration->Catalog->Price

Please help me how to set prices in multiple store views?


texts: Script only loading directly after clearing the cache, but cant get found after second reload

texts:
I am using the extension Aheadworks_Wbtab. I don't know whats going on. If I flush the cache and reload then the slider shows and works fine. But if I reload again, then the slider dissapears and I get this error logged in my browser console:

  mixins.js:245 GET
  https://www.example.com/pub/static/version1584092638/frontend/company/base/de_DE/Aheadworks_Wbtab/js/aw-wbtab-ajax.js
  net::ERR_ABORTED 404 req.load @ require.js:1895 ... Show 268 more
  frames

  main.js:37 Error: Script error for: Aheadworks_Wbtab/js/aw-wbtab-ajax
  http://requirejs.org/docs/errors.html#scripterror
      at makeError (require.js:166)
      at HTMLScriptElement.onScriptError (require.js:1681)

So I checked if the file was created in pub/static and it is there (as a symlink):

  pub/static/frontend/company/base/de_DE/Aheadworks_Wbtab/js/aw-wbtab-ajax.js
  -> /home/company/example.com/vendor/aheadworks/module-wbtab/view/frontend/web/js/aw-wbtab-ajax.js

I also opened the file and it has content.

How can I fix it and what causes the bug?

Only this extension from Aheadworks causes this bug, all other extensions from Amasty work fine.


texts: Magento 2 How to show categories name in breadcrumbs in some conditions?

texts:
I am trying to show breadcrumbs when open a product from custom listing or from search result. For example, if I open a product from search result, then it's breadcrumbs look like this image:

The actual result which I want is:
This breadcrumbs must include the category name as well.

I tried to fix this issue by follow this URL but not worked...
https://github.com/magento/magento2/issues/7967#issuecomment-315310890

Please guide me.


texts: How to redirect to a product page from a path such as mymagento.com/path?barcode=123

texts:
I know close to nothing about Magento, but need to add functionality to an existing Magento website, where when a user is taken to a path such as 'mymagento.com/path?barcode=123, it should redirect to the product with a custom attribute 'barcode' where the value is 123.

Where would the right place to add this path be?
Where would I place the php file that will be used for the above url?
How can I query the products, based on the 'barcode' attribute to find the correct redirect url?

Could someone point me to the right direction please?


texts: Prevent page layout from inheriting default.xml?

texts:
I have a <link> tag in the <head> section of my default.xml file, and I'd like to prevent that particular tag from rendering on the checkout page.

Is there anything I can add to checkout_index_index.xml that would prevent this tag from being rendered?

Thank you!


texts: EDIT: How to protect index.php/admin url using htaccess

texts:
As accurate answers still not showing up, I had to take the alternative to remove index.php from http://example.com/index.php/admin

Below is my code at the top of .htaccess file

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/index.php/admin/
RewriteRule ^index.php/(.*) $1 [R=301,QSA,L]

I have written below code at the bottom of .htaccess file

<Files admin>

 AuthUserFile /var/www/magento/.htpasswd
 AuthName "Private access"
 AuthType Basic
 require user dummyuser

</Files>

Problem: Currently it successfully blocked the URL http://example.com/admin but not http://example.com/index.php/admin.

Also index.php is removed from http://example.com/index.php/admin but not from http://example.com/index.php/admin/ with /

I am using Magento 1.9.2.4


texts: Magento 2: How to get specific product attribute on the product page?

texts: I need to display a specific product attribute value.


texts: How to get max_order_value for Payones payment methods?

texts:
We want show our users that they reached a certain limit for some payment methods in their basket. That is why I need to know each max order value for these payment methods.

But when I try to use Payones function:

$methods = Mage::helper('payone_core/config')->getConfigPayment($store);

I get an object with an array full of payment methods. But it is protected and I can not use it. Meanwhile I still do not know if these payment methods are active anyway.

Or is there a totally other way how to retrieve these informations?


texts: Cache:Flush fails after updating from Magento 2.3.4-p2 to 2.3.5-p2

texts:
When deploying the update from Magento 2.3.4-p2 to 2.3.5-p2 the cache:flush command does not work.
As error message I get Class Magento\GoogleShoppingAds\Model\Cache\Type does not exist.
I checked that and actually this class is removed during the update.
Only possible way to get the deployment to work was to disable all caches, then deploy and after flushing the caches enabling them again.
Did anyone have a similar problem and a better solution?


texts: Product image import through csv throws required sku error

texts:
Ive multiple images for single product and Im trying to import it through csv  as shown below.

when I`m importing this csv file it gives me required sku error. So am i missing something here or my csv is incorrect?


texts: Magento - Defer Parsing of Combined Javascript File

texts:
How would I defer parsing of Javascript in magento on a combined JS file?

In System --> Configuration, I have it set so that all JS files are combined into one file.

I found a solution on another thread, which is to use the "defer" keyword on the script tag:

<script type="text/javascript" defer="defer">

I am unsure how to add that to the script tag since the combined JS file is created and added in by Magento.

My question is, how do I add the "defer" keyword into the script tag if all of my JS is combined in a single file?

Or, is there a better, or more easier way to defer parsing of Javascript using another method?

Please don't mark as duplicate, I've checked all of the other threads similar to my question, but the answers don't contain instructions on how to implement, or they simply aren't good answers.

Thank you.


texts: Magento 2 - Create a log file in plugin that will print log when data is inserted in database

texts: I have entered data in the database using object Manager in Model file itself. I want to print a log file from the plugin that will print the log of the last data that is inserted in the database.


texts: how to fix error after deploy:mode: developer?

texts:
In Magento2, after I created custom.less in myTheme, it does not render file less. so I tried run cli php bin/magento deploy:mode:set developer

then in the admin panel, I get the error:

SyntaxError: missing } after property list

};

require...nfig.js (line 381, col 1)
"NetworkError: 404 Not Found - http://localhost/mytheme/pub/static/adminhtml/Magento/backend/en_US/jquery/ui.js"
ui.js
"NetworkError: 404 Not Found - http://localhost/mytheme/pub/static/adminhtml/Magento/backend/en_US/jquery/jquery-storageapi.js"
jquery-...eapi.js
Error: Script error for: jquery/ui
http://requirejs.org/docs/errors.html#scripterror

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

require.js (line 166, col 17)
Error: Script error for: jquery/jquery-storageapi
http://requirejs.org/docs/errors.html#scripterror

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

require.js (line 166, col 17)
"NetworkError: 404 Not Found - http://localhost/mytheme/pub/static/adminhtml/Magento/backend/en_US/prototype.js"
prototype.js
Error: Script error for: prototype
http://requirejs.org/docs/errors.html#scripterror

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

require.js (line 166, col 17)
"NetworkError: 404 Not Found - http://localhost/mytheme/pub/static/adminhtml/Magento/backend/en_US/text.js"
text.js
Error: Script error for: text
http://requirejs.org/docs/errors.html#scripterror

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

require.js (line 166, col 17)
Error: Load timeout for modules: text!ui/template/modal/modal-popup.html_unnormalized2,text!ui/template/modal/modal-slide.html_unnormalized3,text!ui/template/modal/modal-custom.html_unnormalized4
http://requirejs.org/docs/errors.html#timeout

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

I tried removing everything in pub/static except .htaccess and run cli /bin/magento setup:static-content:deploy. but there is no change. Any suggestion? Please help me?

thanks


texts: Magento 2: Is there any option to use MYSQL search engine for magento 2.4.2

texts:
I need to use the MYSQL search engine instead of Elasticsearch in Magento 2.4 so is there any way of plugin for that?
Thanks.


texts: How to send customer a reset password link using REST API?

texts:
EDIT: I made changes to my discussion of IsEmailAvailable to correct an error in my assumption as to how that works.
I am unsuccessfully trying to get Magento Commerce 2.3.6 (on Adobe Commerce Cloud) to send a password reset link email using the REST API. Using Swagger:
swagger#/customerAccountManagementV1/customerAccountManagementV1InitiatePasswordResetPut

which calls the rest endpoint:
/rest/all/V1/customers/password

I get one of two results. If I use "websiteId": 0, then the result is a status of 404 and the response body is:
{
  "message": "No such entity with %fieldName = %fieldValue, %field2Name = %field2Value",
  "parameters": {
    "fieldName": "email",
    "fieldValue": "magento@example.com",
    "field2Name": "websiteId",
    "field2Value": 0
  }
}

If I use "websiteId": 1, then the result is a status of 502 and the response body is HTML with a heading of:

502 Bad Gateway

The websiteId should be 1. Note that
swagger#/customerAccountManagementV1/customerAccountManagementV1IsEmailAvailablePost

which calls the rest endpoint
/rest/all/V1/customers/isEmailAvailable

with a request of:
{
  "customerEmail": "mark@redquark.com",
  "websiteId": 1
}

returns "200 false" (indicating the email address is in use for this store and therefore not available for new accounts), but if I change the websiteId to 0 then it returns "200 true" instead (the email address is available for use in this store and therefore not associated with an account). So a 404 (not found) makes sense for websiteId = 0.
So, here are the questions:

Should the websiteId for requesting Magento send out an email with a password reset link be 0 or 1?
How to fix the 404 (if websiteId = 0) or 502 (if websiteId = 1) error such that the REST API request actually works?
If 404 is correct for websiteId = 0, why does the request work for websiteId = 0 but throw a 502 Bad Gateway error for websiteId = 1? If I can get a result for one store, why not the other?

Thank you for your time and assistance!


texts: How to save key value pair of array from JSON in magento 1.9?

texts:
Here is my test code trying to save data what I am getting in request, but it is not saving in table.

$json = '{
   "isMobileConfirm":false,
   "cid":"85036",
   "managerid":"12345",
   "location":"12.961125000000001,77.64933166666667",
   "studentprofilepic":"studentprofilepic_1496989696628",
   "studentfrontpic":"studentfrontpic_1496989698785",
   "studentbackpic":"studentbackpic_1496989703275",
   "govtfrontpic":"govtfrontpic_1496989713175",
   "govtbackpic":"govtbackpic_1496989707848",
   "selfiepic":"selfiepic_1496989713394",
   "extrapic":[
      {
         "extra_imagepath":"extrapic_1496989714945",
         "extra_doctype":"Hostel Bill\/Receipt",
         "extra_docremark":"gvvg"
      }
   ],
   "loanpic":[
      "LFA\/loanpic_1496989716375"
   ]
}';

  $student = Mage::getModel("customer/customer")->load(85036);
        // load cmupload
        $cmuploads = Mage::getModel("manager/cmuploads");
        // decode the json data into arrya
        $obj = json_decode($json,true);
        echo "<pre>";
        var_dump($obj);
        // check is array or not
        if(is_array($obj)){
            foreach ($obj as $key => $value) {
                echo $key;
                echo $value;
                                // if not array save data student pics
                if(!is_array($value)){
                    $cmuploads->setCustomerId(85036);
                    $cmuploads->setFileName('studentprofilepic_1496989696628');
                    $cmuploads->setFileFilekey('studentprofilepic');
                    $cmuploads->setManagerId($value->managerid);
                    $cmuploads->setStatus(1);
                    $cmuploads->setLocation($value->location);
                    $cmuploads->setCreatedDate(NOW());
                } else if(is_array($value)) {
                    // If it's array check its loan pic or extra pics

                }
            }
            try {
            $cmuploads->save();
         }
         catch(exception $ex2){
            echo "sa";
         }
        }else {


texts:
in observer.php

public function sendProductAlert()
{
    Mage::log('cron working');

    $connectionresource = Mage::getSingleton('core/resource');
    $readconnection = $connectionresource->getConnection('core_read');
    $allrecord = $readconnection->select()->from(array('product_alert_stock'=>'product_alert_stock'));
    $alldata =$readconnection->fetchAll($allrecord);
    Mage::log( $allrecord );
    $somevar = 'Hello check';

    Mage::log( $somevar );
    // die('cron');
    return $this;
}

In config.xml

 <crontab>
    <jobs>
        <amasty_amxnotif_alert>
            <schedule><cron_expr>* * * * * *</cron_expr></schedule>
            <run>
                <model>amxnotif/observer::sendProductAlert</model>
            </run>
        </amasty_amxnotif_alert>
    </jobs>
</crontab>

There are two files at root
1. cron.sh file permission 0744
2. cron.php file permission 0744

still my function don't exexuted

If there is no cron scheduled in cpannel how magento productAlert module sends mail ?


texts: Get all the orders created by admin username(s)

texts:
I want to get and filter orders based on who created it in admin (Orders grid or Reports).

We have few admin users who creates orders from backend, I want to know whether we can get all the orders created in admin (with admin username) for existing orders or it requires custom functionality? If we can do it, can someone shed light on how to achieve it?

Thanks


texts: Magento 2 getCookie() returns wrong values in observer

texts:
I have created an observer that saves cookie data in the sales_order table on the sales_order_save_before event. I have tested that saving to the database in the custom fields works fine but I'm having inconsistent results with retrieving the actual cookie value. Sometimes it returns the cookie value and sometimes it returns nothing or what seems to be a cached value although I'm not sure how that's possible.

namespace Tss\AddDataToOrder\Observer\Sales;

class OrderSaveBefore implements \Magento\Framework\Event\ObserverInterface
{

protected $_cookieManager;

public function __construct(
    \Magento\Framework\HTTP\Header $httpHeader,
    \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager
) {
    $this->httpHeader = $httpHeader;
    $this->_cookieManger = $cookieManager;
}

/**
 * Execute observer
 *
 * @param \Magento\Framework\Event\Observer $observer
 * @return void
 */
public function execute(
    \Magento\Framework\Event\Observer $observer
) {
    /** @var \Magento\Sales\Model\Order $order */
    $order = $observer->getEvent()->getOrder();

    $order->setUtmCampaign($this->_cookieManger->getCookie('_uc_utm_campaign'));
    $order->setUtmContent($this->_cookieManger->getCookie('_uc_utm_content'));
    $order->setUtmMedium($this->_cookieManger->getCookie('_uc_utm_medium'));
    $order->setUtmSource($this->_cookieManger->getCookie('_uc_utm_source'));
    $order->setUtmTerm($this->_cookieManger->getCookie('_uc_utm_term'));
    $order->setUtmAdGroupId($this->_cookieManger->getCookie('_uc_adgroupid'));
    $order->setUtmCampaignId($this->_cookieManger->getCookie('_uc_campaignid'));
    $order->setUtmCreative($this->_cookieManger->getCookie('_uc_creative'));
    $order->setUtmDevice($this->_cookieManger->getCookie('_uc_device'));
    $order->setUtmKeyword($this->_cookieManger->getCookie('_uc_keyword'));
    $order->setUtmMatchType($this->_cookieManger->getCookie('_uc_matchtype'));
    $order->setUtmInitialReferrer($this->_cookieManger->getCookie('_uc_referrer'));
    $order->setUtmLastReferrer($this->_cookieManger->getCookie('_uc_last_referrer'));
    $order->setUtmInitialLandingPage($this->_cookieManger->getCookie('_uc_initial_landing_page'));
    $order->setUtmVisits($this->_cookieManger->getCookie('_uc_visits'));
    $order->setUserAgentString($this->httpHeader->getHttpUserAgent());

    return $this;
}

}


texts: Image not showing on frontend after deleting rows from catalog_product_entity_media_gallery table

texts:
I have products that have images that were deleted from disk. I am trying to remove them from the database, but when I remove the non-existing image rows from the database, the images that ARE on disk no longer show (the placeholder image shows instead).

The weird part is, the image is still showing on the backend.

Re-indexing, clearing cache, chowning & chmoding, PHP memory is set to 1G. Nothing has worked.

Before I ran this code, all images (that existed on disk) were showing on the front-end just fine. After running this code, they no longer were.

Here is how I am removing the images:

 class ProductHelper
 {
    const IMAGE_DB_TABLE = 'catalog_product_entity_media_gallery';

    public static function findImagesThatDoNotExist(callable $callback)
    {
        $stillHasResults = true;

        $read = Mage::getSingleton('core/resource')
            ->getConnection('core_read');

        $select = $read->select()
            ->from(['media' => static::IMAGE_DB_TABLE], '*')
            ->where('value_id > ?', $id = 0)
            ->limit(2);

        while ($stillHasResults) {
            $results = $read->fetchAll($select);

            if (empty($results)) {
                $stillHasResults = false;
            }

            foreach ($results as $result) {
                $callback($result);
            }

            $id = array_pop($results)['value_id'];

            $select->reset(\Zend_Db_Select::WHERE)
                ->where('value_id > ?', $id);

        }
    }
}

$mediaPath = Mage::getBaseDir('media') . '/catalog/product';

/** @var \Zend_Db_Adapter_Pdo_Mysql $write */
$write = Mage::getModel('core/resource')
    ->getConnection('core_write');

ProductHelper::findImagesThatDoNotExist(function ($result) use ($mediaPath, $write) {
    if (! file_exists($path = $mediaPath . $result['value'])) {
         $where = 'value_id=' . $result['value_id'];

        $write->delete(ProductHelper::IMAGE_DB_TABLE, $where);
    }
});


texts:
I originally set up my magento 1.9 site www.atsite.com/demo

and now i am trying to set the site live, at: www.atsite.com
I moved the whole site into the public_html folder and changed the core_config_data to coincide with new site http://atsite.com and the same with the secure site url too.

however now when i go to atsite.com it still is looking for atsite.com/demo and breaks.


texts: Upload image on 'My Account' page frontend Magento 2

texts:
I would like to have my customers upload an image on their account page. I can add an image attribute to my customer model by using the following code. Any idea on how to put this on the frontend and make it work?

$customerSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY, 'logo', array(
            'type'     => 'varchar',
            'backend' => '',
            'label'    => 'Logo',
            'backend' => 'Magento\Catalog\Model\Category\Attribute\Backend\Image',
            'input'    => 'image',
            'visible'  => true,
            'required' => false,
            'default' => '0',
            'frontend' => '',
            'unique'     => false,
            'note'       => '',
            'system'    => false,
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE
        ));

$logo = $customerSetup->getAttribute(\Magento\Customer\Model\Customer::ENTITY, "logo");

    $logo = $customerSetup->getEavConfig()->getAttribute('customer', 'logo');
    $used_in_forms2[]="adminhtml_customer";
    $used_in_forms2[]="customer_account_edit";
    $logo->setData("used_in_forms", $used_in_forms2)
        ->setData("is_used_for_customer_segment", true)
        ->setData("is_system", 0)
        ->setData("is_user_defined", 1)
        ->setData("is_visible", 1)
        ->setData("sort_order", 101);

    $logo->save();


texts: How to get product's price in all allowed currencies?

texts:
I have a setup with two store views.

The first store view has base and the only one currency set to USD. The second one has 2 allowed currencies - USD and EUR. EUR is the default displayed one, USD is set as a base one.

All products' prices are set only in USD and the exchange rate for EUR is set to 0.75. Price of the product is let's say $14.

And my code goes:

// Store ID 2 - default currency EUR, base currency USD
// $product is instance of Magento\Catalog\Model\Product
$priceInfo = $product->getPriceInfo();
$price = $priceInfo->getPrice('regular_price')->getValue();

This code always fetch the correct price (10.50) in EUR. But I need both prices - in USD and in EUR, but I didn't find a way on how to pass currency to any getPrice method.

I tried to use Magento\Directory\Helper\Data to convert:

$helper->currencyConvert($price, 'EUR', 'USD');

But it gives me $13.99 when the real price in USD is $14 - so the calculation is wrong.

Do you know how can I get product's prices for both store currencies? Thanks a lot!


texts: I need to prepare for the Magento Front End Developer Certification and there didn't seem to be a question on this yet. How should one prepare for this certification? Are there some guides and/or test exams that I can go through? Please note that I am looking specifically for  Front End Certification material. There just doesn't seem to be any information regarding this exam or a study guide.


texts:
Toggle function not working properly in foreach function

foreach($this->getCollection() as $res){

<input type="button" value=" <?php echo $helper->__('Order') ?> #<?php echo $res['magerealorderid']; ?>" id="hideshow1">

 <?php echo Mage::getModel('marketplace/saleslist')->getpronamebyorder($res['mageorderid']); ?>

}

Script

First loop working but next loop is not working


texts: Remove product count from layered navigation magento 2

texts:
I've been trying to remove the product count from the manufacturer attribute I'm using in the layered navigation. When using the setting Show product count and turn it off, it won't hide the product count from my attribute. Where do I need to change this?

Thank you very much in advance!


texts: How to exclude specific category id in catalog search result?

texts:
I have to some change in magento catalog search result. I have to exclude specific category Id in catalog search result. I had tried in many way but not getting proper result. Please help me asap.

Thank you in advanced !!


texts: Magento 1 show error on checkout if input is longer than

texts:
Our payment service provider only allow certain input lengths for some fields.

In this case I want to show a inputfield error in the checkout, when the input of the street name is longer than 35 characters for example.

How can I achieve this?


texts: Magento 2: How can I relate/link custom module data to products like Up Sell or Cross Sell?

texts:
I have created modules to store complex information like Dangerous Good Informations (UN-No, Proper Shipping Name, Class, Packing Group etc) or Customs Numbers (Taric Codes).

Now, I want to relate/link these pieces of information to my products.
For that, I would like to use the same method/way like it is used to linking Up-Sell or Cross Sell products.
 Please help.


texts: Static block in between products in grid mode

texts:
I want to place a static block in between the product list of the category 'shoes' (ID 20).

The static block is a simple banner for test:

I want it in the second row, after the first two products of this row:

I have already tried to use the display mode setting for the category in the backend:

But when I do this, the static block is displayed above the grid, not inside.


texts: Magento2 Why I can't get POST data from .\Magento\Framework\App\RequestInterface $request?

texts:
This is my code in my module observer

namespace Customtest\Customlogin\Observer;

use \Magento\Framework\Event\Observer;

use \Magento\Framework\Event\ObserverInterface;

class CustomerLogin implements ObserverInterface
{

     protected $_request;

  public function __construct(

      \Magento\Framework\App\RequestInterface $request

  ) {

      $this->_request = $request;

  }
  public function execute(Observer $observer) {

            $post = $this->_request->getPost('login');

            var_dump($post) ;

  }

}

This code is work in localhost but when I upload to live server,  Browser

show  "http error 500"

  Fatal error: Uncaught TypeError: Argument 1 passed to
  Customtest\Customlogin\Observer\CustomerLogin::__construct() must
  implement interface Magento\Framework\App\RequestInterface, instance
  of Magento\Framework\App\ResponseFactory given, called in
  /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php
  on line 111 and defined in
  /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php:15
  Stack trace: #0
  /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111):
  Customtest\Customlogin\Observer\CustomerLogin->__construct(Object(Magento\Framework\App\ResponseFactory),
  Object(Magento\Framework\Url)) #1
  /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108):
  Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Customtest\Hello...',
  Array) #2
  /opt/stack/magento2/apps/magento/htdocs/vendor/magento/framework/ObjectManager/Obj
  in
  /opt/stack/magento2/apps/magento/htdocs/app/code/Customtest\Customlogin/Observer/CustomerLogin.php
  on line 15


texts: How to add the order items images to the the sales_order_item table?

texts: I need to save the images of the ordered items in the sales_order_table when the order is placed using API.


texts: Banner slider not coming at the home page in Magento 2

texts:
I have block call in the home page and in block, I have added this content:

{{block class="Mageplaza\BetterSlider\Block\Slider" template="Mageplaza_BetterSlider::slider.phtml" banner_id="2" }}

But the error is coming on home page We're sorry, an error has occurred while generating this content.
I think I am calling the template file wrong
any help will be appreciated


texts: after clicking submit button it should redirect to another cms page

texts:
visit this link,

http://hotwheelstoys.in/one/em0113-full-package/index.php/contacts/index/

if you click on " submit" button , it will give you a message in the contact us page only.

we are using this code in :http://pastebin.com/U86VDhd3

i want to to display this message in the other page....

means if we click on "submit" button, it should redirect to another cms page.....


texts:
I just updated a Magento shop from Magento 1.4.2 to 1.7.0

When I go to checkout, it gives following warning and doesn't show further page.

Warning: include(Mage\Eav\Model\Attribute\Data\Label.php) [function.include]: failed to open stream: No such file or directory  in magento\lib\Varien\Autoload.php on line 93

Please tell me how can I fix this error.


texts: Magento 2 : Can we use laravel as a storefront in magento 2

texts:
Is any idea about how can we use laravel as a storefront with magento 2 admin panel, similar like vue.js ?
how can we achieve that? if possible then any though about how can we create some necessary page like checkout and configuration of payment ?


texts: Workflow For Adding Many Products with Similar Options

texts:
I'm working on a site that will have many products with similar options/attributes that a user would have to choose when adding to cart... think of an add to cart form for a t-shirt where you choose a color and size. This site does not need to manage stock/inventory.

The options I can imagine are:

Create simple products with custom options one at a time.
Create simple products with common custom options, but duplicate them to create good starting points.
Configurable products with attribute sets, which implies the user would have to create associated products for all the attributes they want to show up.
Your brilliant suggestion

2 is my best guess and 3 and 1 would be very time consuming. So what's number 4?

Thanks!


texts:
I want to make a copy of the default Sales Order grid in Magento 2 to my own module. In Magento 1 I have build a custom module to show all backorders. See below:

Now I want to create this module in Magento 2 too but I can't find how to make a copy of the default Sales Order Grid. For Magento 1 I used this tutorial: http://inchoo.net/magento/how-to-create-a-custom-grid-from-scratch/

I have already found a lot of tutorials for Magento 2 about creating custom backend modules but none of them describe how te re-use the code for the current/default sales order grid.

Can you simply make a copy of the di.xml to load all the data?

Thanks in advance

Michel


texts:
How to override Adminhtml template files in Magento 2.3? In a proper way.

File to override:

vendor/magento/module-sales/view/adminhtml/templates/order/totals.phtml


texts: How to insert CSS file below styles.css in Magento 2?

texts:
I can add a custom CSS file by adding this to Magento_Theme/layout/default.xml:

<head>
    <css src="css/local.css" />
</head>

However, it is still loaded before /pub/media/styles.css -- how do I get this file to load AFTER styles.css?


texts: data-migration-tool SQLSTATE[42S02]: Base table or view not found

texts:
I am using data-migration-tool version 2.3.5 and my Magento version 2.3.5-p1, when I have to run data migrate command

php bin/magento -r migrate:data
app/code/Vendor/ModuleName/etc/opensource-to-opensource/1.9.3.10/config.xml

It gives me an error

SQLSTATE[42S02]: Base table or view not found: 1146 Table
'tildev_test1.eav_attribute_set' doesn't exist, query was: SELECT
COUNT(*) FROM eav_attribute_set

I have add sourc_prefix tag in confix.xml along <options> tag my file options tag is:
<options>
        <source_prefix>mage_</source_prefix>
        <crypt_key>6fac6c90c2sss774431d5c85c65d8b98</crypt_key>
----other----
</options>

In the error query is SELECT COUNT(*) FROM eav_attribute_set I think it did not get my source_prefix
I think the query should be SELECT COUNT(*) FROM mage_eav_attribute_set.
Can anyone help me here, will be appreciated.
Thank you


texts: Negative Discount does not apply on category page

texts:
I have made it possible to apply a negative Discount in the cataloge rules.

After that, i modified the Mage_CatalogRule_Model_Observer by the following code:

if ($this->_rulePrices[$key]!==false) {
 // $finalPrice = min($product->getData('final_price'),    $this->_rulePrices[$key]);
    $finalPrice = $this->_rulePrices[$key];
    $product->setFinalPrice($finalPrice);
}

Now i can increase the price for example by 5%. The price is increased in the cart and on detail side of the article. But in the category page, only special prices get increased. When a product have a normal price, the price does not get modified.


texts: Why do authentication tokens only last an hour / How can I persist a user

texts:
I'm using magento 2.3 in a headless way via their rest & graphql api's.

By default the auth tokens you get from magento (according to https://devdocs.magento.com/guides/v2.3/get-started/authentication/gs-authentication-token.html) only last 1 hour. This means a user potentially has to authenticate multiple times in the same session and keeping a user logged in is basically impossible unless I actually store his username / password somewhere which is not safe.

Am I misunderstanding the docs / is there something I am missing?


texts:
I have migrated all of my Magento files and database to the new server. I have changed the database information in local.xml file, and changed URLs in the core config table in database.

I get many errors on site, and there is lot of content missing. When I re-uploaded the css, the styles were reloaded and I got the part of the look back.

Now when I go to my cart page, I get 404 error.

This could be related to my server configuration, as for some other sites migration some of my sub-folders are returning me an error, like the .htaccess file isn't configured.

The link is www.nuby.hr

Any ideas?

Thanks