texts: Place order button in Magento 2 checkout

texts:
I am using Check / Money Order payment method in my website.

I want to change the text of "Place Order" button on the checkout page.

I tried to change the following file:

vendor/magento/module-offline-payments/view/frontend/web/template/payment/checkmo.html

but nothing is changing on frontend.

Actually I want to override this template into my own module but it is unable to change anything even changing directly to above file location.

Can anybody help me?


texts:
I was wondering if there is an API for the Custom Variables in Magento under System > Other Settings > Custom Variables.

Going through the System > Integrations > API lists it as Available APIs. But I cannot find it anywhere in the swagger doc.

https://devdocs.magento.com/swagger/index_23.html#/


texts:
I'm trying to exclude my custom block from Magento cache (Varnish) but I'm really struggling to figure it out ...I've spent hours trying.

Here's the custom blockL

{{block type="core/template" name="supplier.delivery" template="myphp/delivery.phtml"}}

and here's what I've entered in local.xml:

    <reference name="supplier.delivery">
    <action method="setEsiOptions">
        <params>
            <scope>page</scope>
            <registry_keys>
                <current_category/>
            </registry_keys>
        </params>
    </action>
</reference>

But it doesn't appear to work. Any help would really be appreciated. I've read all the ESI info I can find.

Thanks
Chris

Thanks
Chris


texts:
For some products (same category) we need a different layout. How can I get this new layout only for those products.
I know where to find the view.phtml and to adjust is, but how can you select the right layout in the backend for only that specific product?

When I change the local.xml then it will be changed for every product.

Do I have to make a whole new page layout?
And how further?


texts: Magento 2 - Create Product Programmatically Url Key Can't Assign Multiple Store View

texts:
i have multiple store view, and i create product programmatically with ProductInterfaceFactory, product successfully insert, but when i changing store view in front end, product page result not found, because  table url_rewrite only has one row url store (store id 1). how to fix it ?
        $product = $this->productFactory->create();
        $product->setSku($data['sku']);
        //$product->setStoreIds(array("1,2")); not working
        //$product->setStoreId("2"); not working
        $product->setName($data['name']);
        $product->setDescription($data['description']);
        $product->setTypeId("simple");
        $product->setVisibility(4); //catalog & search
        $product->setPrice($data['price']);
        $product->setAttributeSetId(4);
        $product->setStatus(1);
        $product->setStockData(['qty' => 50, 'is_in_stock' => 1]);
        $product = $this->productRepository->save($product);


texts:
i am trying to do magento 1.3 setup on local.
The setup is not fresh, its a server setup i am doing it on local
and i am getting this error. https://prnt.sc/opxr9g
Can anyone help me out please


texts: How does Magento run if many extensions override it?

texts:
2 extensions are used which override customer_account_create.xml
Example:
Extension 1:

<?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
            <referenceContainer name="content">
                <block class="TTV\TermCondition\Block\RegisterCondition" name="customer_form_register" template="TTV_TermCondition::register.phtml" cacheable="false">
                </block>
            </referenceContainer>
        </body>
    </page>

And this is Extension 2:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Test\Translate\Block\Translate" name="customer_form_register" template="Test_Translate::translate.phtml" cacheable="false">
            </block>
        </referenceContainer>
    </body>
</page>

Which extension will Magento execute?


texts: Getting Product list by category - not returning anything

texts:
So like alot of other people, im building my first Magento custom module - and im trying to make a list of the products in my store. I have worked most of it out by now, but im having a problem when im trying to retrieve the data from my database.

I have googled to my skin starter to fall off, and i have read (and tried) most of the suggestions on stackoverflow - from older posts.

my current Model class looks like this:

public function getRecentProducts()
{
    $categoryID = 4;
    $category = Mage::getModel('catalog/category')->load($categoryID);
    $productCollection = Mage::getResourceModel('catalog/product_collection')
        ->addCategoryFilter($category);
    //$test = Mage::getModel('catalog/product')
    // ->getCollection->()addAttributeToSelect('*');
    return $products;
}

I checked to make sure i get the correct category with xdebug, and its defently the category im looking for - but sadly thats where it stops to work :(
No matter what i try, when i try to retreieve products it returns the array with _data = Null (using the //$test returns exactly the same

I hope somebody can help me, because im about to go crazy from this

P.s i reindexed all the index's, and tried to delete the caches aswell - neither helps


texts: How to calculate the approximate cost of tile in Magento 2?

texts:
I'm selling tiles in my store. How can I calculate the tile price based on the tile dimensions entered by the user?

Note: Input/output unit will be Foot.


texts: How to disable complete magento site from server?

texts:
I have a client who is asking me to Live his site on his server and saying that he will pay me after live completion.

But in future if he refused to pay me then it's a big loss for me.

So, I want to know that is there any extension or feature or script by which I can disable/control my client website in case if he will not pay me?


texts: Get shipping rates in a frontend controller for particular form in magento 2.1

texts:
I am trying to get the shipping rates from the existing shipping methods enabled by the admin in my form in the frontend as the address has been entered.
Further, I don't want to save the product in the 'quote_item' table or quote table.

So, if there's a way to get the shipping rates from the shipping methods enabled in the admin store for the product I have saved in the customer session.


texts:
im using a fresh magento install from Ionos 1&1 (CentOS 8), and just after doing composer require, I test if the module installed correctly, but it says it cant be found. Here is the output:
[root@localhost html]# composer require maurisource/lightspeed
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Warning from repo.magento.com: You haven't provided your Magento authentication keys. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html
    Authentication required (repo.magento.com):
      Username: (hidden)
      Password:
Do you want to store credentials for repo.magento.com in /root/.composer/auth.json ? [Yn] y
Using version ^1.3 for maurisource/lightspeed
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing maurisource/lightspeed (1.3.2): Downloading (100%)
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Package sebastian/finder-facade is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
PHP CodeSniffer Config installed_paths set to ../../codeception,../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility
[root@localhost html]# bin/magento module:status maurisource_lightspeed
Module does not exist

It is happening with different modules. Any ideas on what i can do? Thanks in advance


texts: What are the features and functions of Magento Cloud?

texts: I need some detailed info of Magento Cloud and its features.


texts: Magento 2 Event sales_order_payment_pay not triggering

texts:
I've to call a form after payment successful(before order success page) for Magento 2.2.4. (User will just fill this form & we'll just save corresponding to order-id).

So I'm using "sales_order_payment_pay" event here but it didn't work.

**I also tried some other payment events which didn't work.
e.g-  "sales_order_payment_place_start", "sales_order_payment_place_end".

But when I tried one of other event(to check if any event triggers or not) it works** but it doesn't fullfill my requirement.

To use event I created a separate module.

So please anybody let me know, why I'm not able to use some payment events?

Instead of the event is there any better way(except success page customization) which can fulfill my need?


texts: Magento 2 How to show column on the basis of admin config value in admin custom grid by using UiComponent?

texts:
I had created a Custom Admin Grid by using uiComponent in which I am showing Order Details, please check below Screenshot

I had created System Configuration to show IGST, CST, SGST field or not, if it enables from admin then I will show this in grid otherwise not.

Code:

         <column name="price_igst">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">textRange</item>
                    <item name="label" xsi:type="string" translate="true">IGST</item>
                </item>
            </argument>
        </column>
        <column name="price_cgst">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">textRange</item>
                    <item name="label" xsi:type="string" translate="true">CGST</item>
                </item>
            </argument>
        </column>
        <column name="price_sgst">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">textRange</item>
                    <item name="label" xsi:type="string" translate="true">SGST</item>
                </item>
            </argument>
        </column>

Please help me how to do it?


texts: When setting a product attribute programmatically, can't retrieve it from a collection

texts:
I've got a simple varchar product attribute, let's call it "badge".

If I set values for it programmatically for a set of products like this:

Mage::getModel('catalog/product_action')
    ->updateAttributes($productIds, ['badge' => 123, $store->getId());

... then I inspect the catalog_product_entity_varchar table for that attribute value, I correctly see that 123 has been assigned to the badge attribute for those products, at the given store level. Great!

Now, if I create an EAV product collection by getting child products from a configurable and try and select the value, I can't:

$collection = $configurable->getTypeInstance(true)->getUsedProductCollection();
$collection->addAttributeToSelect('badge');

foreach ($collection as $product) { /** @var Mage_Catalog_Model_Product $product */
    var_dump($product->getBadge()); // NULL
}

On closer inspection the varchar attribute values are assigned at the store level, but there's no default level value. If I manually insert a value at the global/admin level (doesn't matter what the value is), then the same code above works as it should.

Examining app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php I see that it selects attribute values from the default store level then does a left join to the specified store level to get the store value. It returns whichever exists from store -> default priority.

I understand that setting values via $product->setBadge(123)->save() would also create a default value, but that's much slower, and not really the point of this question anyway.

FYI if I edit the abstract collection and switch the order around, i.e. select from the store level value and left join the default value it returns the value in my example code correctly - that was just to test the point, it's obviously not sustainable.

Question: This methodology obviously doesn't work due to a limitation in the core catalog collection. How can I efficiently set store level attribute values for large numbers of products (using vanilla Magento) while still being able to retrieve their values in a child product (EAV) collection?


texts: show out of stock filter in magento admin product listing

texts:
i want to add out of stock colum to magento admin product listing pages, so that it will be easy to view all low stock iteam easily

how can id do it via magento setting or any module ??

I tried to do it via observer but could make it work

<events>
      <adminhtml_block_html_before>
        <observers>
          <add_customer_group_column>
            <type>model</type>
            <class>customizations/observer</class>
            <method>addCustomerGroupColumn</method>
          </add_customer_group_column>
        </observers>
      </adminhtml_block_html_before>
    </events>

Observer.h

Model/Observer.php

class Devshree_Unidesing_Model_Observer {
    public function addCustomerGroupColumn(Varien_Event_Observer $observer){
        if($observer->getBlock()->getType() == 'adminhtml/sales_order_grid'){
            $block = $observer->getEvent()->getBlock();
            $sales_order_grid_block = $observer->getBlock();

            $groups = Mage::getResourceModel('customer/group_collection')
            ->addFieldToFilter('customer_group_id', array('gt' => 0))
            ->load()
            ->toOptionHash();

            $block->addColumn('customer_group_id', array(
                'header'    => Mage::helper('customer')->__('Customer Group'),
                'width'     => '100',
                'index'     => 'customer_group_id',
                'type'      => 'options',
                'options'   => $groups,
                ));

            $block->addColumnsOrder('customer_group_id', 'shipping_name');
        }
    }
}


texts: I have created a root category with name colors in Magento 2. I am trying to access this category by URL http://domain.com/category/colors.html in front end. But its not working for me. What will the URL of colors category for access product listing of this category on front end?


texts: Magento 2 Error After logging in Admin Panel

texts:
An Error code showing After Trying to logging in Admin Panel Only!
An Error Message showing like: Specified invalid parent id (Ves_All::ves_all)

  Error log record number: 1295586411401

how do I solve this problem?


texts: I want to add "Show More" link in Review Tab in product detail page in Magento 2. Only want to show 5 reviews at a time

texts: Add "Show More" link in review on product detail page. Only want to show 5 reviews at a time.


texts: What is the benefit of a pub directory in Magento 2

texts:
Maybe I'm just not getting it but if my files are already cached then what would be the use of a pub directory in Magento 2? My only educated guess would be that the use of the fallback mechanism could be alleviated somewhat by having a known set of files for the theme.

Through reading the docs I don't a clear understanding of the benefit although I feel I have a strong grasp understanding dynamic, static and cached files.

As I understand it the cache is simply a defined known location of assets which led me to guess that the pub directory is a mechanism which standardizes the place of the files to reduce resources being used on the fallback mechanism.


texts: All product images need to be defined in view.xml?

texts:
In Magento 2, the image sizes are defined in theme's view.xml file, e.g. in Luma theme: /app/design/frontend/Magento/luma/etc/view.xml:

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

But what if I create an image programmatically and the size is not defined in view.xml?

For example, I need to display images of unusual size for different categories (based on configuration in admin panel). So I create an image like this:

$_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
$imageId = 'product_base_image';

$customImage = $_imagehelper->init($_product, $imageId)
    ->constrainOnly(true)
    ->keepAspectRatio(true)
    ->keepFrame(false)
    ->resize(399, 399)
    ->getUrl();

If I create image like this, does it mean that my images will not be generated when I run command bin/magento catalog:images:resize? Does Magento only generate product images of sizes which are defined in view.xml?
Will my custom images be cached just like images which are defined in view.xml?


texts: Magento Bug with additional checkbox in register field

texts:
I have small issue with my two checkbox's. They work fine, but i find small bug. They are required to pass registration. If i don't check them both, information about requiment showing under second two times, if i chceck second, dont check first, information still showing under second. I trying to make more space between them by adding some break rows "", but it still happens. I showing a image of my problem, because im not perfect in english and it will help a lot. Red ring showing a issue.

<input type="checkbox" id="regulaminsklepu" name="TEST1" value="1" title="" class="checkbox required-entry"> „Oświadczam, iż zapoznałem/zapoznałam się z treścią Regulaminu Serwisu Internetowego WWW.WARM-IT.PL. Akceptuję treść ww. Regulaminu i zobowiązuję się do jego przestrzegania.”

<input type="checkbox" id="pdane" name="TEST1" value="1" title="" class="checkbox required-entry"> „Wyrażam zgodę na przetwarzanie moich danych osobowych przez Warm IT z siedzibą w Libiążu, na potrzeby i w zakresie niezbędnym do korzystania przeze mnie ze sklepu WWW.WARM-IT.PL, w tym na przekazywanie moich danych osobowych podmiotom trzecim, przy pomocy których Warm IT z siedzibą w Libiążu świadczy na moją rzecz usługi w ramach ww. sklepu.”


texts: VarienForm not working in magento 1.9.2 community edition

texts:
Hello I am developing a login and register form in magento. For form validation I am using this code

var registerForm = new VarienForm('register-form', true);

var loginForm = new VarienForm('login-form', true);

if (this.validator && this.validator.validate()) {
    this.form.submit();
}

when i am using this code in phtml with script tag it is working but when I am putting it in js and calling through xml it is not working here is my xml code

<custom_abc_index>

    <reference name="root">
        <action method="setTemplate">
            <template>page/1column.phtml</template>
        </action>
    </reference>

   <reference name="head">
        <action method="addItem">
            <type>skin_js</type>
            <name>js/custom_abc/customLoginRegister.js</name>
        </action>
    </reference>

    <reference name="content">
        <block type="custom_abc/custom" name="custom" template="custom_abc/Custom.phtml"></block>
    </reference>

</custom_abc_index>

To check whether js is loading or not i put alert() in it , I got the popup but I don't know why the validation code is not working. Any Help will be appreciable.


texts:
I need reset page title all my category store.

How make phpmyadmin query?


texts: Pass string parameters to the model construct in Magento 2

texts:
What is the best way to pass some not predifined string to model construct in Magento 2 with di.xml?
I have an api class which requires incoming params like service url, login and license key which i want to take from config section.


texts: How do you create a new order state for an order status to be assigned to?

texts:
It's clear how to create a new order status. System > Order Statuses > Create New Status

But how do you create a new state?

"processing", "complete", "new" are examples of the default Magento order state codes.


texts: No images or JS on new Magento 2 installation

texts:
I've just installed Magento 2 onto my production server under a development. subdomain. The install appeared to have been successful but I've noticed there are no images or working javascript in both the frontend and the backend.

After inspecting the source code, I found that files being called in such as http://dev.website.com/pub/static/frontend/Magento/luma/en_GB/css/print.css don't actually exist. Any thoughts? I tried solutions on several stacks but haven't had any luck.


texts:
I did a mistake today and deleted all the "Product feeds" today instead of generating them.

I'm re-creating them and it's working for France, UK and Germany.
For no reason it is not working for USA and Switzerland while there are many products in the store :

The feed is just a duplicate of a working one with an other store (For the example: USA).

Why is the feed empty ?


texts: How to show notices with addSuccess() and addNotice() on Configurations page?

texts:
I want to display success and error notification with  Mage::getSingleton('core/session')->addSuccess() and ->addError() if the admin is on a specific Configuration Section.

The reason: I made an extension, which has a separate section in System / Configuration, and I want to give a feedback if it is configured properly or not, but only when the admin is at that section.

I tried to create a default.notifications block, which worked, but the  notification was a 'global notification', not a smaller notification box, which was located on the top of the settings fields of my extensions' settingfields.
Also: I want to add these notifications only if the admin is at this specific section's Configuration page.

Thanks!


texts: magento 2 displays small picture in catalog

texts:
My magento 2 was fine, I upload big image and the display was fine, now, new products show up small (the one in the right), see my screenshot :

I didnt edit my view.xml so I dont know how this suddenly occured!!!
both image in the catalog page are the same size in fact, but obviously whn I uploaded the image, magento makes the pic small and a big frame around.

here is a part of my view.xml:

    <image id="category_page_grid" type="small_image"> <!--page categories product list height -->
        <!--<width>925</width>
        <height>1388</height>-->
        <width>1800</width>
        <height>2700</height>
    </image>
    <image id="category_page_grid-1" type="small_image">
        <width>700</width>
        <height>325</height>
    </image>
    <image id="category_page_list" type="small_image">
        <width>700</width>
        <height>800</height>
    </image>
    <image id="customer_account_my_tags_tag_view" type="small_image">
        <width>100</width>
        <height>117</height>
    </image>
    <image id="customer_account_product_review_page" type="image">
        <width>279</width>
        <height>325</height>
    </image>
    <image id="customer_shared_wishlist" type="small_image">
        <width>100</width>
        <height>117</height>
    </image>
    <image id="gift_messages_checkout_small_image" type="small_image">
        <width>75</width>
        <height>87</height>
    </image>
    <image id="gift_messages_checkout_thumbnail" type="thumbnail">
        <width>100</width>
        <height>117</height>
    </image>
    <image id="mini_cart_product_thumbnail" type="thumbnail">
        <width>75</width>
        <height>87</height>
    </image>
    <image id="new_products_content_widget_grid" type="small_image">
        <width>700</width>
        <height>325</height>
    </image>
    <image id="new_products_content_widget_list" type="small_image">
        <width>2500</width>
        <height>3750</height>
    </image>
    <image id="new_products_images_only_widget" type="small_image">
        <width>75</width>
        <height>87</height>
    </image>
    <image id="product_base_image" type="image">
        <width>2500</width>
        <height>3750</height>
    </image>
    <image id="product_comparison_list" type="small_image">
        <width>100</width>
        <height>117</height>
    </image>
    <image id="product_page_image_large" type="image"/>
    <image id="product_page_image_medium" type="image"><!-- slider in catalog image details -->
        <width>2500</width>
        <height>3750</height>
    </image>
    <image id="product_page_image_small" type="thumbnail">
        <width>100</width>
        <height>117</height>
    </image>
    <image id="product_page_main_image" type="image"><!-- slider in catalog image details -->
        <width>2500</width>
        <height>3750</height>
    </image>
    <image id="product_page_main_image_default" type="image"><!-- slider in catalog image details -->
        <!--<width>467</width>
        <height>544</height>-->
<width>2500</width>
        <height>3750</height>
    </image>


texts: custom payment method place order disabled

texts: I've created a new custom payment method It's added to the methods but when I choose it in checkout the Place Order button is disabled and there is no text in the button. Can anyone help me? Thanks in advance!


texts: Magento 2 : Product Attribute Rule Conditions

texts:
I have added following field in my UI Component Form in a custom module to get the Product Attributes ** in conditions, but the options given in the drop-down are **Cart Attributes whereas I need Product Attributes!

Here is my code,

<fieldset name="conditions">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Products with Conditions</item>
            <item name="collapsible" xsi:type="boolean">true</item>
            <item name="sortOrder" xsi:type="number">127</item>
        </item>
    </argument>
    <container name="conditions_apply_to" >
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="sortOrder" xsi:type="number">10</item>
            </item>
        </argument>
        <htmlContent name="html_content">
            <argument name="block" xsi:type="object">Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Conditions</argument>
        </htmlContent>
    </container>
</fieldset>

How can I change this?


texts:
We're currently working on a brand new Magento 2 theme based on the Snowdog Blank Sass parent. After a lot of research we've figured out a ton of cool features and insights on how to build a solid and extendable theme package.
The thing we are not so sure about is how to make use of external frameworks and libraries like for example Bootstrap3 or Font Awesome.

We came across several cool ideas based on Bower, which can load packages from all over the place and include them inside the theme. The thing is, where do we put them and how is it all gonna work with Sass compiling.
We pointed the Bower directory param to the //lib folder and put a git ignore in the root of the theme. Based on this idea, we can for example @import those into our _styles.scss file and make use of all the given mixins and variables.

In the end, I'm not totally sure if this is the way Magento wants it. I mean, the jQuery library is put inside the /lib/web folder which could act as a vendor folder for Bower. So in the same time I've explained it inside this topic, we've also tried it in practice and put Bootstrap-sass into the lib/web folder.
Unfortunately this wont work because the static deployment will get stuck within the process mainly because it just doesn't know how to handle .scss files?

I hope some of you can help us find the right way / position of where to put all those libraries and framework. Bower can help allot if we get the right way.


texts:
I created one landing page, when customers fill all the details it should display in the custom module grid in magento admin panel,

how can i implement,
<form action="">, what to put in action part.


texts: If I search some query catalog search displays all products for any query. I cant figure out where is problem? My catalog has grouped products and installed amshopby module. Please, who has suggestions, thanks.


texts: Licences, release notes and sample files?

texts:
This is probably a stupid question, but I will ask anyway: Is it safe to delete the licences, release notes and sample files?  Is there any other file I could/should remove? I'm creating an new store with CE 1.9 and want my directory structure to be as compact as possible.

Also what is the mage file for? Is this needed?


texts:
I'm a bit confused with displaying VAT on shopping cart. I've tied to set up a 7% VAT (on porducts and shipping) but my Grant total including tax is still equal to grand total excluding tax.

I've created a 7% VAT rule in Sales > Manage tax and zone rules
I've also tried to define the most appropriate setting in Configuration > Sales > Tax
... but no result.


texts:
This should be so simple, but _removeButton() method is not working.

class Thing_MyModule_Block_Adminhtml_Foo
        extends Mage_Adminhtml_Block_Widget_Grid_Container {

    public function _construct() {
        $this->_controller = 'adminhtml_mymodule';
        $this->_blockGroup = 'mymodule';
        $this->_headerText = Mage::helper('mymodule')->__('Hello There');
        parent::_construct();
        $this->_removeButton('add'); // does not work
    }

}

Needless to say I'm missing something obvious and the "+ Add New" button is still there. Yes, I have tried it before and after the call to parent::_construct();

If I do var_dump($this->_buttons); I get

array (size=3)
  -1 =>
    array (size=0)
      empty
  0 =>
    array (size=0)
      empty
  1 =>
    array (size=0)
      empty

...which makes no sense to me. AM LOSING MY MIND! Please help!

Magento ver. 1.8.1.0


texts: Replace SKU on transactional emails with Product ID

texts:
I have a requirement to replace the default value of SKU on all transactional emails with the products ID.

The only way I have found to achieve this is to modify the files associated with these transactions,  one example is to perform the following modification on this file:

/store_root/app/code/design/frontend/default/store_template/template/email/order/items/order/default.phtml

Replacing this line:

<?php
        echo $Custom_Var = Mage::getModel('catalog/product')->load($_item['product_id'])
        ->getData('Id') ?>

With this line:

    <?php $product = Mage::getModel('catalog/product')
        ->loadByAttribute('sku', $_item->getSku(), array('Id'));
        echo $product->getId(); ?>

While this does work to display the products ID, it negatively impacts the Taxes breakdown on the bottom of the page by showing incorrect tax values as well as multiple tax values on the emails that are sent to the client.

Is modifying these files the best way to replace SKU with the Product ID if so, is the best code to use?

Note: I am aware of the other files involved, I am using this one as an example.


texts:
I have looked through this site for the answer, it seems i can find similar parts but not the exact answer.

we are using Magmi and the products are uploading fine, but the images have the exclude radio button checked. also the image label is blank. this is a configurable product and once i uncheck the radio button the product shows up fine and the configurations are correct.

thank you in advance


texts: Can't rewrite 3rd party module Block class

texts:
I'm trying to rewrite the following class from a 3rd party module:

Magestore_Storelocator_Block_Adminhtml_Storelocator_Edit_Tab_Generalinfo

I've declared the module in Holy_Storelocator.xml.

<config>
  <modules>
    <Holy_Storelocator>
      <active>true</active>
      <codePool>local</codePool>
      <version>0.1.0</version>
      <depends>
          <Magestore_Storelocator />
      </depends>
    </Holy_Storelocator>
  </modules>
</config>

Then I created a config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Holy_Storelocator>
      <version>0.1.0</version>
    </Holy_Storelocator>
  </modules>
  <global>
    <helpers>
      <storelocator>
        <class>Holy_Storelocator_Helper</class>
      </storelocator>
    </helpers>
    <blocks>
        <storelocator>
            <rewrite>
                <adminhtml_storelocator_edit_tab_generalinfo>Holy_Storelocator_Block_Adminhtml_Storelocator_Edit_Tab_Generalinfo</adminhtml_storelocator_edit_tab_generalinfo>
                <!-- Magestore_Storelocator_Block_Adminhtml_Storelocator_Edit_Tab_Generalinfo -->
            </rewrite>
        </storelocator>
    </blocks>
  </global>
</config>

And finally I created the class:

<?php
class Holy_Storelocator_Block_Adminhtml_Storelocator_Edit_Tab_Generalinfo extends Magestore_Storelocator_Block_Adminhtml_Storelocator_Edit_Tab_Generalinfo
{
    protected function _prepareForm() {
    // code ommitted

        return parent::_prepareForm();
    }
}


texts: admin showing Please enter email address in config

texts:
My Magento Admin showing this error Please enter email address in config
I don,t know where should i update the email to hide this error


texts: How to call a controller action from another module?

texts:
I want to call a controller action to send email from my custom module page,

EX : my module template is ->refer.phtml
I want to call a smtp module email controller.
Module path is  HTD/SMTPemail/Smtp/test

My TestController.php

class HTD_SMTPemail_Smtp_TestController extends Mage_Adminhtml_Controller_Action
{
}

How to call this controller action to send emails from refer.phtml file?

Both my phtml file and smtp controllers are in two different module.


texts: Discount rules between cronjobs at 01:00 and 02:00

texts:
By default, Magento has 2 cronjobs that run at 01:00 and 02:00.

catalog_product_index_price_reindex_all 0 2 * * *
catalogrule_apply_all   0 1 * * *

Does this mean that between 01:00 and 02:00 all discount prices are invalidated and it takes another hour until all prices are reindexed?

I have a client complaining that discount prices are often not working around midnight (midnights only).

It seems obvious these are related. Would it be safe to move these two closer to each other? Like 10 minutes in between:

catalog_product_index_price_reindex_all 10 1 * * *
catalogrule_apply_all 0 1 * * *

And, while I'm at it, I assume I can move those to 04:00 as well, right?

So, final question.. should I change these crons to:

catalog_product_index_price_reindex_all 10 4 * * *
catalogrule_apply_all 0 4 * * *

Or will I run into problems?


texts: M2 - Show fixed shipping in shopping cart

texts:
How can I always show the fixed or free shipping in the shoppingcart? I need to display the shipping rate (<50) or the free shipping (>50).

There is nothing that needs to be calculated or something so there should be a way to display it.

Thanks!


texts: How to proceed past shipping in checkout

texts:
We upgraded to the latest version of Magento but it's done some funny things.

We're unable to select a shipping method when trying to checkout

Any ideas how to resolve? Normally there would be a radio button which would be selected prior to clicking continue.

Kind regards,

Scott Hunt

EDIT:


texts: Magento- Create a product, such that no existing coupons is valid for that product

texts:
I have around custom coupon codes generated for various type of offers and free shipment.

All my products are given a price and reduced price to buy for the user. And further discounts are applicable after applying coupon code.

Now i need to create a product with much reduced price than the previous products, so that no new/existing coupons must be invalid on that products.

Is that possible in magento to create a product that disallows the coupon code.

Kindly advise.


texts: Order CSV Export - what fields does it export?

texts:
I am exporting orders Sales > Orders to CSV.

The problem is, I can't see which fields are actually exported.

If anyone has any insight, I would much appreciate it.


texts: Populate magento 1.9 database with more users and orders

texts: I really need to know if there is a tool to help me generate more than the available 20 users and 40 orders. The module that I am developing requires much more data than what is provided in the sample data. I have tried searching google and GitHub for half a day now with no results. Any tips are greatly appreciated. Thanks.


texts: How to creator a custom router in pwa magento 2.3.1

texts:
I want to create a custom router in pwa.

I want to create blogs url. ( website.com/blogs )

so I can show all blogs list here.

Is anyone have an idea about this?


texts:
I would like to customize the add to wish list functionality from my custom module In magento 2.

Actually i need custom options chosen and product id when i wishlist a product. i have found a link for list of magento 2 events below https://cyrillschumacher.com/magento2-list-of-all-dispatched-events/ please suggest me how to achieve this?

I have written code as shown below the event has been calling perfect but i unable to get the product id and custom options how to get in the observer?

app/code/Demo/Pricecalculations/etc/frontend/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="wishlist_add_product">
       <observer name="Demo_Pricecalculations_Wishlistproduct" instance="Demo\Pricecalculations\Observer\Wishlistproduct" />
   </event>
</config>

app/code/Demo/Pricecalculations/Observer/

<?php
namespace Demo\Pricecalculations\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\RequestInterface;
class Wishlistproduct implements \Magento\Framework\Event\ObserverInterface
{

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $writer = new \Zend\Log\Writer\Stream(BP.'/var/log/Wishlist.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info("custom Wishlist function has been Calling");

    }

}


texts: Magento 2.2.3- ACL Permissions not Working for Customer module

texts:
I have created a user and provide a new created  role customer which have access to customer module only . When we logged in with that particular user , we are able to see the customer list but when click on edit customer
it gives This page isn’t working, currently unable to handle this request.
HTTP ERROR 500


texts: Magento2 unfriendly urls after import products

texts:
I've imported products with the build in importer.
Since then a lot of products are only reachable via the long url's.

http://domain.com/catalog/product/view/id/295/s/product-name/category/4/

But when i check in the backend both as default value as for the storeview a url key is filled in. (also in the url's "product-name" element)

tried re-indexing, refreshing cache. but no result. when adding a product by hand we do not seem to have this issue.

Update: 28 jul 2016:
After a lot of trying things out, there is still a issue with this.
I did a clean install of 2.1
After playing around i got all urls working (import / exporting and so on)
A huge issue was that the urls where not added to the main store but only to the store view)

Anyone more experience with this issue?

Creating the url by hand in the backend (marketing->url management) seem to solve it. but thats horrible work.

Edit, i have found some more information.
We have a site with multiple storeviews, i notice that our first store has problems with the url. when i search the url key in the url_rewrite database i do find the url for all store's (2,3,4,5,6,7,8,9,10) excpect for store. 1.

Should't there be a store 0 url key ??


texts: Magento 2:Store View in Ui Component Form

texts:
I have displayed an admin form using UiComponent form. As one of my admin field I want to display all store views in a multi-select field.

Please help me with a solution.


texts: wysiwyg widget not working in custom plugin module

texts:
In our Magento webshop, we have a custom plugin that was build by our template builder that we bought on themeforest a vew months ago. There is no support anymore on this template, so if something is wrong with the template of plugins, we have to figure it out ourselfs.

A week ago, we created two additional store views for two additional languages. These are working now. But the problem is that a certain widget in the wysiwyg of this plugin is not working anymore.

The template is from Cooncook, and it has a custom megamenu plugin build in.

When I go to the megamenu item and I select one to edit, it gives me a wysiwyg editor to edit the contents of the menu dropdown div.

And there are a few widgets that we put in the content.
The problem is that when we want to edit the widgets, we get a 404 page.

The strange thing is that I can add widgets on static blocks or normal pages, but I get a 404 on this plugin page.

Can anybody give me a lead on where I can look for code or a trace on where to look for a fix?

I hope somebody can give me a clue!


texts: Magento2 product meta title and description

texts:
Use magento2.1
Need to generate meta title and description for my products dynamically, forexample: BASEURL-for your(Static string)-Product title, and for meta description example: static string-attribute1-attribute2


texts: "Undefined class constant 'PDO::MYSQL_ATTR_SSL_KEY' " what is this error? I am using magento 2.3 and php 7.3

texts: When I try to enable a new module by php bin/magento module:enable Mageplaza_HelloWorld command this comes.


texts: how to remove the extra fields in fire checkout 2,7?


texts: Really Easy Question about CMS ! the directory setting

texts:
I got my custom template on my
app/design/frontend/default/default/template/Company/contacts.phtml

Then, I want to put it on my CMS. How Can i write on that cms part?
The information about BBB.phtml is in /app/code/local/company/Contacts

{{block type="?????????" name="contactForm" form_action="/contacts/index/post" template="?????????"}}

how can i set these blanks?


texts: How can I get a coupon for "first item free"

texts:
It's hard to believe that this hasn't been done before, but I can't find any information or documentation on how to accomplish this.

If there are multiple items in the cart that share an attribute, I want to have a coupon code that will make only one item in that collection free. (preferably lowest cost item, but i'll settle for just "first" in whatever order)

Ex. (custom attribute is color)

Item 1 color=red $5.99
Item 2 color=blue $6.99
Item 3 color=blue $7.99
Item 4 color=green $8.99
Item 5 color=blue $9.99

SubTotal = $39.95

Coupon would be to the effect of "first blue item free", and after applying, it would look like the following

Item 1 color=red $5.99
Item 2 color=blue $0.00
Item 3 color=blue $7.99
Item 4 color=green $8.99
Item 5 color=blue $9.99

Is anyone aware of an extension that covers this?


texts:
I'm trying to use the below code which is based on another install which works fine.  I'm at a loss as to why this wouldn't work.

/opt/plesk/php/5.5/bin/php -f /var/www/vhosts/gsworkwear.backup.com/gsworkwear.com/cron.php -- -mdefault >> /var/www/vhosts/gsworkwear.backup.com/gsworkwear.com/var/log/cron.log 2>&1

running with:

*/5 * * * *


texts:
I have created some links that i have added to my customer account nav.

But there's some problem :

My links aren't order one under each other
The class current is only active on "Mon cadencier" link.

Here's customer_account.xml :

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customer_account_navigation">
            <block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-contacts">
                <arguments>
                    <argument name="path" xsi:type="string">mycontacts/contacts/index</argument>
                    <argument name="label" xsi:type="string">Mes contacts</argument>
                    <argument name="sortOrder" xsi:type="number">70</argument>
                </arguments>
            </block>
            <block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-factures">
                <arguments>
                    <argument name="path" xsi:type="string">mybills/factures/index</argument>
                    <argument name="label" xsi:type="string">Mes factures</argument>
                    <argument name="sortOrder" xsi:type="number">60</argument>

                </arguments>
            </block>
            <block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-reclamations">
                <arguments>
                    <argument name="path" xsi:type="string">mycomplaints/reclamations/index</argument>
                    <argument name="label" xsi:type="string">Mes réclamations</argument>
                    <argument name="sortOrder" xsi:type="number">50</argument>
                </arguments>
            </block>
            <block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-cadencier">
                <arguments>
                    <argument name="path" xsi:type="string">customercadencier/order/cadencier</argument>
                    <argument name="label" xsi:type="string">Mon cadencier</argument>
                    <argument name="sortOrder" xsi:type="number">40</argument>
                </arguments>
            </block>

        </referenceBlock>

        <referenceBlock name="customer-account-navigation-address-link" remove="true"/>
        <referenceBlock name="customer-account-navigation-downloadable-products-link" remove="true"/>
        <referenceBlock name="customer-account-navigation-newsletter-subscriptions-link" remove="true"/>
        <referenceBlock name="customer-account-navigation-billing-agreements-link" remove="true"/>
        <referenceBlock name="customer-account-navigation-product-reviews-link" remove="true"/>
        <referenceBlock name="customer-account-navigation-my-credit-cards-link" remove="true"/>
        <!--<referenceBlock name="customer-account-navigation-account-link" remove="true"/>-->
        <!--<referenceBlock name="customer-account-navigation-account-edit-link" remove="true"/>-->
        <!--<referenceBlock name="customer-account-navigation-orders-link" remove="true"/>-->
        <referenceBlock name="customer-account-navigation-wish-list-link" remove="true"/>
        <referenceBlock name="catalog.compare.sidebar" remove="true"/>
        <referenceContainer name="sidebar.additional" remove="true" />

    </body>
</page>

See the result :


texts:
I should to make possible to choose "Amazon pay" in checkout, when you choose payment method. But i cant setup "Amazon pay" in Sales->Payment Method. Everything what i do, does not make changes. I try it on 2.2.4 clean project and 2.2.5.
So, how to setup "Amazon pay" that it appear in checkout?


texts:
I took my Magento store from a live site to a localhost. Magento's version is 1.7, and it's running over WAMP on my localhost. The homepage was working fine, but all URLs from there gave 404 error from the server. However, if I included index.php manually in each URL, everything worked fine. I figured out that going to Admin/System/Configuration/General/Web, I had enabled the option for URL rewrites that removes index.php. When I disable this option, my site works properly. So, I searched about this problem, and tried different things, but I have not been able to solve it.

I have mod_rewrite enabled, that's the first thing I checked.

I have seen lots of posts recommending to overwrite either an .htaccess file or a httpd.conf (Apache's    configuration file) file.

My .htaccess looks like this right now:

<IfModule mod_rewrite.c>

Options +FollowSymLinks
RewriteEngine on

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule .* ../get.php [L]
</IfModule>

I also checked that in httpd.conf I had AllowOverride al, and indeed, among other things, I have the following:

code:

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all

My site is still not working when enabling the option for removing index.php from all URLs.

Does anyone have an idea of what I might be missing? Any help will be much appreciated :-)


texts:
I have this ACL in my module:

<acl>
    <resources>
        <admin>
            <children>
                <report>
                    <children>
                        <modulename translate="title">
                            <title>Reports (SQL)</title>
                            <children>
                                <edit translate="title">
                                    <title>Add/Edit Reports</title>
                                    <sort_order>10</sort_order>
                                </edit>
                            </children>
                        </modulename>
                    </children>
                </report>
            </children>
        </admin>
    </resources>
</acl>

I have some reports where my url  is like:

adminhtml_customreport/viewtable/report_id/30/

or

adminhtml_customreport/viewtable/report_id/31/

is there a way to assign them to a specific role ?  if  Yes  , how  ?  All idea is welcomed .


texts: Magento2 top menu with attribute filters

texts:
Magento2 in top menu I want to add filter attributes like color, size etc.
For e.g. Let's say Shoes is my main category, which is displayed in menu.
Now instead of sub-category in the dropdown, I want to add a color filter. Like when someone hovers Shoes it will display Colors like White, Black etc in top menu.
How can I achieve this?


texts: The directory is not writable by server. Magento 1.9 on XAMPP

texts:
When I added an image above error display.

How to change permission to add image for all ?


texts: Add a block to product page if the product has an attribute set to specific value

texts:
I have a custom attribute that can be Yes or No. If a product has this attribute set to Yes then in product page view I want to display a block below "Add to Cart" button.

How can I achieve this?


texts:
I have a custom theme in which a certain template uses jQuery - everything works like a charm. I put the changes in the template from the default theme - everything OK. This is on my developer machine.

Then I put the changes, in both the custom and the default themes, on the testing machine (another, separate machine) and it works with the custom theme, but does not on the default theme. When debugging in FireBug, I get thrown exception on this line of code:

var $j = jQuery.noConflict();

whereas I get the ReferenceError: jQuery is not defined exception. This is weird, because the code on the dev machine and on the testing machine is completely identical for both the custom and the default themes.


texts:
I moved my site based on Magento 2 from hosting to my localhost.
I cleared cache, adjusted(secure and unsecure) urls in core_config, ran static content deploy using cli. Checked all permitions for "folder".

Magento runs but with no css and js files.

In console I can see following:

Please give some advice, what should I do to remove this issue?
Thanks in advance!

P.S:
Win 10
Open Sever (PHP7x64, MySQL5, 7x64, Apache-PHP7-x64+Nginx1.10)
No external caching

P.P.S Before I copied site from host I tried to setup magento with sample data using cli and I received the same issue! So I believe it's not only issue about moving magento 2 from host to local.
I can see that M2 tries to load all files from version1485628564 folder which doesn't exist in pub/static
http://magehost.two/pub/static/**version1485628564**/frontend/Magento/luma/en_US/mage/calendar.css


texts:
how to create a block or what is the alternate of the below code

Mage::app()->getLayout()->createBlock('core/template')->setData('area', 'frontend')->setTemplate('template.phtml');

I am searching inside Magento\Framework\View\LayoutInterface Not pretty sure that I am on right side. can someone help sorting this.

Also I'm looking for some cheat sheet/ quickies that provide the alternate of mostly used methods and functions of Magento 1 to Magento 2.


texts: How to solve the issue : Deprecated: __autoload() is deprecated?

texts:
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in C:\wamp64\www\magepro\app\code\core\Mage\Core\functions.php on line

My php version : 7.1.29


texts: Problem when editing individual product images upload

texts:
PROBLEM:
In Magento admin while adding products image is not uploading. I tried by uploading in different browsers but it too doesn't worked. I have given 777 file permissions to media folder. When I upload image, image is stored in media/tmp/catalog/media folder. Magento redirect to the login page and does not save the info.

We are using Magento version 1.9.2.3. It happened in product edit time.

How can I solve this issue?


texts: Magento2 How can i create block on popup with product details?

texts:
I want to show product details on popup using controller.

So how is it possible?

$htmlCatInfo = $layout->createBlock(
                \Tigren\Ajaxcart\Block\BuildProductInfo::class,
                'ajax.buildproduct-info',
                ['data' => ['itemid' => $itemid]]
            )->setTemplate('Tigren_Ajaxcart::buildpopupcatinfo.phtml')->toHtml();

Any one can tell me how can I manage data .phtml to block


texts: How to create popup to switch store on landing page

texts: I am using Magento 2 and created 2 stores in site. By default store switcher is available only at bottom of page. I wish to have a pop up on first landing page which asks to select store.


texts: Magento 1.9.1: Fatal error: Call to a member function setLinkModel() on a non-object

texts:
When I try to see in the backend "Product Information"/"Related Products" I see this error:

  Fatal error: Call to a member function setLinkModel() on a non-object in   /XXXXXXXXXX/app/code/core/Mage/Catalog/Model/Product/Link.php on line 105

Same error on the right of the front-end for each products.


texts: magento 2 : knockout value render not working under script template

texts:
I want to render textname value using knockout under

js file

define([
'jquery',
'ko'
], function($,ko) {
'use strict';
 return function(config) {
  this.textname = "this is very good name";
  this.textname2 = "this is textname 2";
 }
});

Is there any way to render this. Actually, I am rendering the select options using knockout. Under script template it does not render.

Any help would be appreciated.

Thanks in advance


texts: How to create a custom form for sending email with file attachment in magento 2

texts:
How to create a custom form for sending email in Magento 2

Fields are like

First name
Last name
Address
City
State
Zip code
Email
Phone
Product type: checkbox Option like (1) One (2) Two
File upload
comment


texts:
I have in my magento 2 store view:

English
Poland

After entering the website the shop view is displayed: English

But I want display Poland, so I have configure this on:

store --> Configuration ---> General ---> Default setting ---> Locale and set Poland.

But not work, anyone know how to do ?


texts: How can I include JS/CSS files only on pages which have my widget?

texts:
I'm creating a custom widget of a form element which requires some CSS and Javascript. I plan on injecting the CSS and Javascript files into the <head> section of any pages which uses that widget.

So what I did was I used the addJs() method within the _prepareLayout() method in my Block class:

class TestSpace_MyWidget_Block_Widget_TestWidget extends Mage_Core_Block_Abstract implements Mage_Widget_Block_Interface
{
    public function _construct()
    {
        parent::_construct();
    }

    protected function _prepareLayout() {
        $this->getLayout()->getBlock('head')->addJs('mywidget/script.js');
        return parent::_prepareLayout();
    }

    public function _toHtml()
    {
        return "Testing widget";
    }
}

However, this doesn't seem to put that Javascript file into the <head> section.

I'm not putting my widget through the CMS or admin panel. My widget is placed in a few other templates (a phtml file) of the site like so:

$widget = $this->getLayout()->createBlock('mywidget/testwidget');
$widget->toHtml();

I'm not sure why this doesn't work since nothing should be rendered on the page yet at this point, right?

I'm aware that I can define my Javascript in a Layout file, but I'm avoiding doing so because that would mean I would either have to put that Javascript file in every single pages or hard code those pages that I want to include my JS file.

How can I include JS or CSS files in the <head> section only on pages which have my widget?


texts: magento 2 error while placing order from admin

texts:
While placing order from admin getting constraint violation error.
when I printed exception i am getting below error string,
Order saving error: SQLSTATE[23000]: Integrity constraint violation:
1062 Duplicate entry '0' for key 'PRIMARY', query was: INSERT INTO
`sales_order_grid` (`last_admin_edit`) VALUES (?)

Any idea what is the cause?


texts: magento2 what exactly purpose of Factory class?

texts:
From this documentation Factories are special objects that have only one purpose: to create an instance of one non-injectable class or interface
non-injectable object are Objects that cannot be instantiated by the object manager.
this \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory
is a factory class that really exist in vendor/magento/catalog directory

why we should use this function instead of inject directly \Magento\Catalog\Model\ResourceModel\Category\Collection in constructor , and why \Magento\Catalog\Model\ResourceModel\Category\Collection is a none-injectable class because from this link it is not instance of entity to provide or a model representing a database entity it is a collection of models

and another question is
why \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory already exist in vendor directory because from the documentation factories are an automatically generated class type. Factory classes do not need to be explicitly defined


texts: How to Get Configurable Attributes of a Simple Product

texts:
We're currently developing our first Magento module, which will be used to sync with our platform.
The problem comes when trying to get product "variations" configurable attributes.

Let's say that the module loads a simple product to send to our API. The result will be something like:

item = {
"id": {
  "sku": "123130999"
},
"lang": "EN",
"currency": "EUR",
"category": "product",
"name": "myProduct",
"stock": "100",
"tags": ["someproduct", "sometag", "anotherone"],
"description": {
  "short": "Here is a short description.",
  "long": "And there's a long description."
},
"images": ["http://img.domain.com/myproduct-1.png", "http://img.domain.com/myproduct-1.png"],
"attributes": {
  "model": "MP34135",
  "dimensions": "25x15x0.7cm"
},
"price": {
  "final": "25000",
  "market": "22500",
  "cost": "19900"
}

}

I've managed to get that working already, but if the product is configurable we need another field to be passed. This field must contain product "variants", such as color, size, etc... Which will add something like that to the previous item:

variants : [
  {  "id": {"sku": "123130999"},
     "attributes":{"color":"black"},
     "price":{ discounted: 19900, min: 15000 }
  },
  {  "id": {"sku": "123130998"},
     "attributes":{"color":"white"},
     "price":{ discounted: 29900, min: 25000}
  }
]

That's what I'm not able to manage. So my question is, which is the best way to get, for each simple product related to a configurable one, the attributes that can be "configured" at front in order to get the final product (i.e: color: black, size: small).

Thanks!


texts:
I having an API that has to call the /V1/carts/mine/items, no point calling it via curl, can I call the same directly ?

the webapi.xml says :

<route url="/V1/carts/mine/items" method="POST">
    <service class="Magento\Quote\Api\CartItemRepositoryInterface" method="save"/>

di.xml says:

<preference for="Magento\Quote\Api\CartItemRepositoryInterface" type="Magento\Quote\Model\Quote\Item\Repository" />

Now, the Magento\Quote\Model\Quote\Item\Repository says :

public function save(\Magento\Quote\Api\Data\CartItemInterface $cartItem)

So you need to pass object the implements : \Magento\Quote\Api\Data\CartItemInterface

I have an array which the above call needs but obviously the call won't work.

and will say

Fatal Error: 'Uncaught TypeError: Argument 1 passed to Magento\Quote\Model\Quote\Item\Repository::save() must implement interface Magento\Quote\Api\Data\CartItemInterface, array given

What are my options ?


texts: Magento 2 : How to change customer account page title

texts:
Hi, I have created custom theme. I want change account page title from "My Dashboard" to loggedin customer name. How I can do this.

Although I have found file customer_account_index.xml that is setting title. But no idea how to make dynamic.

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="customer_account"/>
<body>
    <referenceBlock name="page.main.title">
        <action method="setPageTitle">
            <argument translate="true" name="title" xsi:type="string">My Dashboard</argument>
        </action>
    </referenceBlock>
    <referenceContainer name="content">
        <block class="Magento\Framework\View\Element\Template" name="customer_account_dashboard_top" as="top"/>
        <block class="Magento\Customer\Block\Account\Dashboard\Info" name="customer_account_dashboard_info" as="info" template="account/dashboard/info.phtml" cacheable="false"/>
        <block class="Magento\Customer\Block\Account\Dashboard\Address" name="customer_account_dashboard_address" as="address" template="account/dashboard/address.phtml" cacheable="false"/>
    </referenceContainer>
</body>

Thanks in advanced!!!!


texts: Magento 2: Customer data from JS component

texts:
I need to get customer status in JS component - authenticated or anonymous. Could I get it using Magento_Customer/js/customer-data and how?

define([
    'Magento_Customer/js/customer-data'
], function (customerData) {
    let isAnon = customerData.???
});


texts: How to Get links from Magento customer menu?

texts:
I'm trying to get url's from Customer Menu (My Account) from Dashboard, in a controller that extends Mage_Customer_AccountController.

I've tried this:

class Namespace_Module_AccountController extends Mage_Customer_AccountController
{

    public function logoutAction()
    {
        $cpBlock = Mage::app()->getLayout()->createBlock('Mage_Customer_Block_Account_Navigation');
        print_r($cpBlock->getLinks());
    }
}

but it displays just an empty array. Any ideas to get Url's?


texts:
I add new link to top links using

<block type="page/template_links" name="top.links" as="topLinks">
      <action method="addLink" translate="label title">
           <label>Blog</label>
           <url>/blog</url>
           <title>Blog</title>
           <prepare/>
           <urlParams/>
           <position>1</position>
      </action>
</block>

It works properly.
I want to add target="_blank" to this link.
Is there any way to do this?

Thank you.


texts: How do I fix Magento API URL redirect on HTTP?

texts:
I'm running Magento CE 1.8.1 and trying to access my Magento site over the API using the URL http://www.mysite.com/index.php/api/v2_soap?wsdl=1, but I'm getting redirected to https://www.mysite.com/index.php/api/v2_soap?wsdl=1.  The site recently went live, and the API worked fine.  The development site was not running over https, and was not getting redirected.

Any thoughts on how to avoid the URL getting redirected to https?

Thanks!


texts:
I've just spent the last 45 minutes entering new information into a magento 1.9 store admin specifically the pages section. I go to hit save, only to find that Magento has logged me out. I've lost the last 45 minutes of my progress, leaving me frustrated and annoyed.

Is there a way to find this data or have I got to write the information again?


texts:
Is it possible to add a second shipment tax in Magento. Currently all the products have a 6% tax rate and the shipment has also a 6% tax rate. Now we need to add products which has 21% tax rate and the shipment tax rate needs to work as following:

If there are only products with 6% tax rate on checkout, than shipment tax rate is also 6%
If there are only products with 21% tax rate on checkout, than shipment tax rate is also 21%
If there are products with 6% and products with 21%, than shipment tax needs to be 21%

Does someone know if this is possible inside magento? I have looked around but I can't find any solution.


texts: Mage_Catalog_Model_Product is missing attributes

texts:
in frontend/rwd/default/template/catalog/product/list.phtml round line 48 the $_product is fetched from the collection.

Our products have a style attribute. But that is missing here.

var_dump(get_class($_product)); // Mage_Catalog_Model_Product
var_dump( $_product->getAttributeText('style') // false

If below that I do this:

$_product = Mage::getModel('catalog/product')->load( $_product->getId() );
var_dump(get_class($_product)); // Mage_Catalog_Model_Product
var_dump( $_product->getAttributeText('style') // get the string with the value

But (re)loading every product here for 1 attrubute is probably bad for performance.
What is going on here? How can I do this better.


texts: In ver  1.9.0.1 when I edit any product in the admin the product page is blank and none of the navigation works, except for the dashboard link. I do not get any error, nor do I see any related notices in the system.log or exception.log. The frontend is still functioning properly. Any thoughts about this problem?


texts: Will I have a problem developing my module using a zip installation?

texts: I'm trying to create and learn how to develop a module for Magento 2. The problem is that installation through the composer is too dependent on handling, is necessary to install and enable, and uses too much for each installation of the operating system. I chose to do the installation via zip file, while the resolved one removes the installation via composer. My question is whether my module can stop working when I use a compositor installation.


texts: Loop through all products in category, change value and save

texts:
I need to loop through all the products in a particular category, change a custom attribute and then save each product.

Currently i have:

$_category = Mage::getModel('catalog/category')->load($_POST['id']);
$all_products = $_category->getProductCollection();

foreach ($all_products as $product) {
    $product = Mage::getModel('catalog/product')->load($product->getId());
    $product->setCustomAttribute(xxxx);
    $product->save();
}

Is this best practice and can it be improved for performance? The collections average around 15-20 products in each and i am getting a very slow loadtime or even the script timing out.

I've used set_time_limit(0); to try and force it through but i imagine i can improve my code to stop me having to do this? Eventually the collections may have over 100-200 products each so need to find a good performance now


texts: Magento category tree not showing all sub categories when adding a new product

texts:
Hello Everyone I hope you are doing well. I have an issue I need help with Please.

I'm trying to add products to specific sub categories using Magento ver. 1.9.0.1  I've been able to do it with no major problems until recently. I am not sure why. Now when I get to the point in which I am to select a category it does not give me the ability to expand the category tree (folder tree) to show sub categories to choose from.
Could you please help me to solve this problem.

Here is a picture of what it looks like:

In my particular situation the books category should be able to expand to show sub categories, but it is not doing so. That is my problem.

I'd like to have the sub categories of the books category show up in the category tree.

on a side note if I were to save the products to the books category then later on go back to change the category only the root and workshops folders are visible.

on another side note sometimes when I save and continue when adding a product it does not save properly and it redirects me to the dashboard.

Please help me


texts: product flat data no reindexing 1.9.1 magento errno: 121

texts:
We started having a product flat data re indexing error out of no where. We didnt install any new extensions, the only thing we have done was added new products.

running re-index via ssh we see the following error:

Product Flat Data index process unknown error:
exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1005 Can't create table 'databasename.#sql-4e0_3486' (errno: 121)' in /public_html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 /public_html/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 /public_html/lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('ALTER TABLE `ca...', Array)
#5 /public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('ALTER TABLE `ca...', Array)
#6 /public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(347): Varien_Db_Adapter_Pdo_Mysql->query('ALTER TABLE `ca...')
#7 /public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(2731): Varien_Db_Adapter_Pdo_Mysql->raw_query('ALTER TABLE `ca...')
#8 /public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(815): Varien_Db_Adapter_Pdo_Mysql->addForeignKey('FK_CAT_PRD_FLAT...', 'catalog_product...', 'entity_id', 'catalog_product...', 'entity_id', 'CASCADE', 'CASCADE')
#9 /public_html/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php(1389): Mage_Catalog_Model_Resource_Product_Flat_Indexer->prepareFlatTable(1)
#10 /public_html/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php(296): Mage_Catalog_Model_Resource_Product_Flat_Indexer->reindexAll()
#11 /public_html/app/code/core/Mage/Catalog/Model/Product/Indexer/Flat.php(350): Mage_Catalog_Model_Product_Flat_Indexer->reindexAll()
#12 /public_html/app/code/core/Mage/Index/Model/Process.php(212): Mage_Catalog_Model_Product_Indexer_Flat->reindexAll()
#13 /public_html/app/code/core/Mage/Index/Model/Process.php(260): Mage_Index_Model_Process->reindexAll()
#14 /public_html/shell/indexer.php(167): Mage_Index_Model_Process->reindexEverything()
#15 /public_html/shell/indexer.php(215): Mage_Shell_Compiler->run()
#16 {main}

I tried truncating the  "catalog_product_flat_1 table" and then reindex but it still didnt work. I had to turn off "Use Flat Catalog Product" because the search box wasnt working. Please help.


texts: Get Coupon code on cart page and checkout page?

texts: I have only one coupon code, I want to display this coupon code on the cart page and the checkout page.


texts: Save Configurable Products automatically

texts:
My configurable product prices are updated with Lowest Price simple product on Save.

As I have thousands of configurable products I can't manually open and save all of them.

Is there any way I can Open/Save all configurable products with a cron/script etc.


texts:
I'm trying to determine on a plugin if the request comes from admin or for frontend.
I had to make a plugin for Magento\Framework\App\Config\ScopeConfigInterface, and in my plugin I need to detect the area code on my aroundGetValue function.
I'm trying this:

$om = \Magento\Framework\App\ObjectManager::getInstance();
$area = $om->get('Magento\Framework\App\State');
$areaCode= $area->getAreaCode();

But when I deploy my code I'm getting this error:

[Magento\Framework\Exception\LocalizedException]
  Area code is not set

I don't know how to check at that level if the request comes from admin or for frontend.
Can anyone help me with this?


texts: displaying Text if a statement isnt true

texts:
How would i wrap this in an IF statement so it displayed a message if there is no text in the PDF attribute ??

<?php $_pdf = $this->getProduct()->getPdf(); ?>
<?php if ($_pdf): ?>

<?php echo $this->__('PDF') ?>

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

<?php endif; ?>

I know this is an easy question but i am new to magento and PHP so i am struggling to work this out.

Thank you in advance


texts: Paypal Payment PRO: the invoice email is not sent

texts:
I use Paypal Payment PRO Service. I set Payment Action as "Sale". When someone orders, an order email is generated. An invoice is also generated automatically. But an Invoice Email is not getting sent. It says "the invoice email is not sent" in the Invoice Header. I have gone through couple of posts here but could not come to a conclusion yet so posting.

Invoice Emails are being sent when an Order is placed through  "Check / Money Order" method. But not with the "Paypal Payment PRO".

Why the invoice emails are not being sent?

Magento Version 1.6.1.0


texts:
The upload image function recently broke on my backend, and I have no idea what may have caused it. This product already has a photo. I can click to add a photo, select the photo, but it never actually shows up on this page, or updates the product. Any help would be greatly appreciated. Here is what it looks like:

EDIT: I'm still having this issue. Turns out it returned after compiling again. It's not related to extensions as I originally had thought. Any ideas? I'm now up to 2.2.7 with the same issue.


texts: Magento 2: Which extension mechanism to choose?

texts:
We can extend controller in two ways: using preference and using plugin.
But I do not understand that, which one is good and advantages/disadvantages of preference vs plugin.

<preference for="Magento\Checkout\Controller\Index\Index" type="mymodule\Helloworld\Controller\Index\Index" />

<type name="Magento\Catalog\Model\Product">
    <plugin name="getname-test-module" type="mymodule\Helloworld\Model\Plugin\Product" sortOrder="10"/>
</type>


texts:
Good afternoon, have me paged Order Magento One section, in which sample a list of products. The problem is that this shows the products as seen in the photo.

I wish to stay with pagination, But Magento version is 1.3.2.3. So I can not install widgets.
How do I?


texts: Magento 2 :Error while checkout using Paypal

texts:
I got this error while checkout.

A match of the Shipping Address City, State, and Postal Code failed.

currency is US Dollar($).


texts: Magento 2 product collection in special price date

texts:
I've got two products with special price, but 1 has expired special price period and the other one has no special_to_date field. How can i get product collection with active special price? My code looks like:

$collection = $this->_collectionFactory->create()
        ->addAttributeToSelect('*')
        ->addFieldToFilter(
            'entity_id',
            array(
                'in' => $product_ids
            )
        )
        ->addFieldToFilter('special_from_date', ['lteq' => $now->format('Y-m-d H:i:s')])
        ->addFieldToFilter('special_to_date', ['gteq' => $now->format('Y-m-d H:i:s'),])
        ->addCategoryFilter($this->getCurrentCategory())
        ->setPageSize($qty)
        ->setCurPage(1);
    return $collection;


texts:
I use third-party library in my module. I want to create a class object of this library using the factory class. But the problem is that constructor is this class takes 3 arguments string types.

namespace VendorName\ModuleName\Block\Adminhtml\System\Config\Form\Field;
class Shipping extends \Magento\Config\Block\System\Config\Form\Field
{
private $systemStore;
private $formFactory;
private $config;
private $shippingConfig;

public function __construct(
    \Magento\Framework\Data\FormFactory $formFactory,
    \Magento\Store\Model\System\Store $systemStore,
    \Magento\Framework\App\Config\ScopeConfigInterface $config,
    \Magento\Shipping\Model\Config $shippingConfig,
    \VendorName\ClassNameFactory $classNameFactory
) {
    $this->systemStore = $systemStore;
    $this->formFactory = $formFactory;
    $this->config = $config;
    $this->shippingConfig = $shippingConfig;
    $var = $classNameFactory->create([
        'param1' => 'value1',
        'param2' => 'value2',
        'param3' => 'value3'
    ]);
  }
}

And when I try create object like this I get error

  main.CRITICAL: Warning: Missing argument 2 for Vendor\Class::__construct(), called in vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93


texts: Sucess and Error Message is not shown on Contact Form

texts:
I am using Magento version 2.4, When i submit the contact Form it not shown Error or success message.Mail For contact form is working properly.
Please Let me know the solution.
Thanks in Advance.


texts:
does anyone know how can I change the style for the price in product listings (not on product details page) on front-end? I would like to make the price bigger and change its color. I tried but I simply cannot locate the CSS (LESS) file that controls the style of the price tag.

Please see the image


texts: How to remove order id from print order page URL

texts:
Using Magento CE 1.9.2.0, I noticed that the print order page URL contains the order ID. For example: http://superawesome.store/sales/order/print/order_id/21/.

The presence of the order ID in the URL means that a customer can view other orders simply by changing the order ID, exposing the data of other customers.

I'm tempted to just disable the print order page for now while I look for ways to mitigate the risk of data exposure, but thought I'd ask you smart people if you know of a way to fix this issue.


texts:
I am migrating from Magento open source 1.9 to 2.3.3
the initial migration went well, however, I am trying to do delta migration by using Magento migration tool.

Running the delta command for migration tool gives me the error

  Base table or view not found: 1146 Table
  'magent7.catalog_url_rewrite_product_category' doesn't exist

Although, the table is existing, but I believe the tool doesn't add the database prefix before forming the query.
Any help is appreciated.

Thank you


texts: How can i make the preview image bigger?

texts:
I am making a module that will pretty much do the same with the catalog->product manager do.
In my module i need to upload an image.Everything is fine so far.The problem is that i can't find a way when i have upload an image and go to edit that product, the image is 22x22 px.

My field is in the form is like that:

$fieldset->addField('imagebook', 'image', array(
          'label'     => Mage::helper('books')->__('Image'),
          'required'  => false,
          'name'      => 'imagebook',

       ));

So my question is from the image below.How can i make that image bigger?When i edit the css that magento uses it change all the preview images for all the site.

Thanks in advance for your time.


texts: I getting the Error on product page magento 2.3

texts:
I tried to update the product using REST API but it shows the page this like i can't recognise the error please any one help to resolve it.
Header : rest/all/V1/products/SKU
My API :

{
   "product":{
      "id":10,
      "sku":"SKU",
      "name":"My product name",
      "attribute_set_id":4,
      "status":1,
      "visibility":4,
      "type_id":"simple",
      "weight":"0.0",
      "extension_attributes":{
         "category_links":[
            {
               "position":0,
               "category_id":"99",
               "extension_attributes":{

               }
            }
         ],
         "stock_item":{
            "qty":"0",
            "is_in_stock":true,
            "extension_attributes":{

            }
         }
      },
      "custom_attributes":[

         {
            "attribute_code":"manufacturer",
            "value":"5824"
         }
      ]
   }
}

I find the line in UI DataProvide ( vendor\magento\module-catalog\Ui\DataProvider\Product\ProductDataProvider.php )

  $this->getCollection()->toArray()

Thanks in Advance :)


texts: Magento 2.3.3 - Catalog price rule and tax

texts:
can anyone hint me, how I can let the Catalog Price rules be applied including tax. Means, when we set up a voucher in the system, that the discount of the voucher is taken into account incl. tax already.

Best regards


texts: Magento2- UI Component - Remove form validation for telephone

texts:
I have tried to override the form validation for telephone which added in core file vendor\magento\module-customer\view\base\ui_component\customer_form.xml as follow:

 <field name="telephone">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">address</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
 </field>

Tried to override this file in local module and changed the line

<item name="required-entry" xsi:type="boolean">false</item>

This remove only the mandatory (*) mark from address form for telephone number but the validation remain same.

If you removed the complete entry from base file (vendor\magento\module-customer\view\base\ui_component\customer_form.xml) then complete validation get also removed. anyone know how we can override the form config validation using local module?


texts: What would be the Mage::getSingleton('customer/session')->getCustomer() in Magento 2?

texts:
In Magento 1 my code is

$customer = Mage::getSingleton('customer/session')->getCustomer();

How I set this code in Magento 2


texts:
I run 4 stores with the following timezones:
Store A: GMT -7 hours
Store B: GMT 0 hours
Store C: GMT +8 hours
Store D: GMT +4 hours

Product price reindex starts at 2:00am and 9:00am (GMT +8 hours). Recently some customers are complaining that they do not see the discounts at approx 5:00am (GMT +8 hours) in Store C or Store D.

When should the price reindex start to ensure all the discounts are effective across all the available timezones?

Edit:
I changed the default timezone on the MySQL database to UTC in the testing environment (before the timezone was not set and therefore MySQL was using the Linux server's timezone which was GMT +8 hours). The discount rules start to disappear after 12:00am (GMT +8 hours).

The reason why the production environment had the database set to UTC was that the Magento MySQL was hosted in Amazon RDS. The default timezone was set to UTC and there's no way to change it.

So it seems that the default/admin timezone has to match that of the Magento database. Unfortunately there's no UTC timezone in Magento. I set it to GMT Standard (Europe/London) but now I found that the time is actually GMT +1 hour (following BST?). I am running Magento CE version 1.8.1.0.


texts:
I'm working on a manufacturer extension. I added a password field to the form in admin side. How to encrypt that password to save it to the DB.

In Magento 1 we encrypt it this way:

Mage::getModel('core/encryption')->encrypt($data['password'])

How to do the same on Magento 2?


texts: Extend a default Ui component in adminhtml

texts:
Is there any good example code on how to work with RequireJS and knockoutJS (built into magento2) for adding additional functionality to fields in the admin side?  I'm looking for Magento docs and google and this is about only thing I can find:

Extend a default UI component

To extend a default JS UI component, your custom script must contain the following:

define([
  '<component_path>'
], function(<component_alias>){

  return <component_alias>.extend({

    defaults: { ... }, // properties with default values
    ... // methods of your component
  });
});

Thats HARDLY an example.  I can find tons of examples for the frontend, but magento backend doesn't rely as heavily on templates. Instead, forms are dynamically generated. I have my module configured, I have the /view/adminhtml/web/myjavascript.js containing the define, but I have no idea really what to inject, nor which functions to return.

EDIT:
I'm extending the functionality of the Admin Customer Edit / Add form.  I'm not creating new forms or any new areas.  I'm trying to add on-blur type functionality to certain fields (name/email address) so our API can be called and check if the customer already exists in our main database and can be imported.

EDIT2:

I've coded the following:

  My/Module/view/adminhtml/layout/customer_index.edit.xml

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <!-- add the code to make the customer admin not create dupes -->
        <link src="Stti_Customer::js/customer-admin.js"/>
    </head>
</page>

  My/Module/view/adminhtml/web/js/customer-admin.js

require([
    'Stti_Customer/edit/edit-wrapper'
]);

  My/Module/view/adminhtml/web/edit/edit-wrapper.js

define(['Magento_Ui/js/lib/core/element/element'],function(Element) {
    var BLAH = Element.extend({
        defaults: {
            test: "SOMEDATA"
        },

        /**
         * Invokes initialize method of parent class,
         * contains initialization logic
         */
        initialize: function () {
            debugger;
            return this;
        }
    });

    return BLAH;
});

When I set a breakpoint in the debugging console on the line declaring BLAH, it stops.  The debugger command never runs.  I know this define is executing but I am not sure why its never initializing for each Element on the customer form. I've tried abstract as well.  I've tried uiComponent, Form, all sorts of injectors.


texts: Suggestions for making Magento CE faster

texts:
I have a Magento CE 1.9.1.0 which is used to run a website containing 130,000 sku's . Our issue is the website seems to load slow. We have it hosted on an Amazon AWS cloud with plenty of RAM and processor speed. Yet still it is slow.
We also setup Redis to cache the database in hopes it would speed up the site. However it still seems to load category pages slow.

We are wondering if anyone else has fasted this and what solutions they tried?


texts: Magento 2.2 CMS Blocks/Pages modified date not updating

texts:
The blocks and pages which were created before upgrading to Magento 2.2.1 do not update the "Modified" date in the admin. The contents are updated, but it appears only the date modified is not changed.

Its sounds silly, but i like to sort my modified date for pages and blocks and this has made it so that is no longer a possibility.

I have tried reindexing, update, compile, deploy many, many times without effect.

It also seem to be affecting products "updated at" settings as well. I am guessing this is SQL related, but have no idea where to begin to address this issue.

Any assistance would be appreciated.


texts: Get Base URL value from JS in adminhtml/frontend (Magento 2)

texts:
I want to send AJAX request to the REST API on server from popup in adminhtml and I need "Base URL" value to construct complete URL. I see the following code on the HTML page:

I can remove /admin/catalog/ from global BASE_URL and get the target value, but is there a better way to get Base URL value in JS in adminhtml?

This global variable does not present on the frontend:

Does exist a method to get Base URL value in JS that is common for both adminhtml & frontend?


texts: Cache type to regenerate schema.graphqls files

texts: after changing the schema in schema.graphqls file I always must clean the cache. It's take a while, so I'd like to know, what the cache type in magento is responsible for regenerating this files?


texts:
How to modify invoice email template code?

how to find the invoice email file path.


texts: Display all filters in layered navigation after applying any filter in magento1

texts:
I have to Display all filters in layered navigation after applying any filter on it.

The filter shouldn't change according to product resultset on the category page.

Does anyone know how can I achieve this functionality in Magento 1.9 and aw_layerednavigation 1.5.0.community_edition?


texts: Magento\Ui\TemplateEngine\Xhtml\Result::__toString() must not throw in Magento 2.1

texts:
After I created some product in magento backend, there is an error.

Method Magento\Ui\TemplateEngine\Xhtml\Result::__toString() must not throw an exception, caught Error: Call to undefined method Magento\Framework\Data\Collection::__sleep() in /var/www/vhosts/plchk/vendor/magento/module-ui/Component/Wrapper/UiComponent.php on line 0

By searching the net, I found Magento 2 Impossible To Trace Admin Grid Error: Fatal error: Method Magento\Ui\TemplateEngine\Xhtml\Result::__toString() must not throw an exception.

Using this method, I found that the 'product.form.configurable.matrix' is the cause of problem.

I changed

    protected function _toHtml()
{
    foreach ($this->getChildNames() as $childName) {
        $childBlock = $this->getLayout()->getBlock($childName);
        if ($childBlock) {
            $wrapper = $this->blockWrapperFactory->create([
                'block' => $childBlock,
                'data' => [
                    'name' => 'block_' . $childName
                ]
            ]);
            $this->component->addComponent('block_' . $childName, $wrapper);
        }
    }

    $result = $this->component->render();
    return (string)$result;
}

to

 protected function _toHtml()
    {
        foreach ($this->getChildNames() as $childName) {
            $childBlock = $this->getLayout()->getBlock($childName);
            if ($childBlock) {
                $wrapper = $this->blockWrapperFactory->create([
                    'block' => $childBlock,
                    'data' => [
                        'name' => 'block_' . $childName
                    ]
                ]);
                if($childName != 'product.form.configurable.matrix'){
                    $this->component->addComponent('block_' . $childName, $wrapper);
                } else {
                }

                //var_dump($childName);
            }
        }
        $result = $this->component->render();
        return  (string) $result;
    }

Now, I can load the admin/product/edit page but I cannot save the product. Anyone got a solution?


texts:
I added some images to my local site and after this when going to the product detail page I got the Magento error page saying that there has been an error processing your request and Image file was not found.
After this the product flat data says that it needs to be re-indexed but when I try to re-index it, it says There was a problem with reindexing process.
I assume the images are related to the issue as it didn't need reindexing prior to this.
I deleted the product that I had uploaded images for, I deleted the cache and cleared the lock files as had been suggested on another post similar to this that I found.
Can anyone suggest any further actions I can take to debug this.

<--- FURTHER DETAILS  --->
I ran the reindex file in the console and it returned the following error

   Product Flat Data index process unknown error:
exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`startlondon_live`.`#sql-448_15e`, CONSTRAINT `FK_MAG_MAG_CAT_PRD_FLAT_1_ENTT_ID_MAG_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `mag_catalog_product_entity` (`entity_id`) ON DE)' in /home/start-london/public_html/lib/Zend/Db/Statement/Pdo.php:228

The only thing I could think of was to turn off foreign key restraints in the database but this didn't help


texts: How to create blocks as part of the theme?

texts:
Is it possible to create blocks as part of a theme, and have those blocks visible without actually having to create the block manually in the admin panel? I want to ship a theme with the blocks automatically created.
For my client they would simply select their page and select what blocks they want on the page. All of the blocks in this instance are static HTML blocks.
I would also like to note a development issue. If the above problem can be solved it would also work for my development issue ...
Writing code for blocks is done in my text editor and I copy and paste the code over into the block while developing. Often times I forget to copy over the code and waste time wondering why I'm seeing no changes.
To be able to write blocks in my text editor and have them appear on pages without having to copy and paste.
Any idea how I can do this?


texts: Magento 2 : API Get Customer Cart Data using customer ID

texts:
I am building custom magento 2 API. I want to get customer CART DATA using CUSTOMER_ID.
I have tried following code but its not working.
$params = $this->request->getPostValue();
$customerId = $params["customer_id"];

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerData = $objectManager->create('Magento\Customer\Model\Customer')->load($customerId);

//Code to get customer cart data
$quote = $this->quoteFactory->create();
$customerQuote=$this->quoteModel->loadByCustomerId($quote,$customerId); // where `$customerId` is your `customer id`
return $items = $customerQuote->getAllItems();

I have also tried many other sample codes but they are not working anyone can help me here.
Thanks


texts:
I have uploaded 2000 simple products through csv just now.
But i didnt include images.
How we can upload images at a time through csv?


texts: Show, sort , and limit by products based on subcategory on category page

texts:
How do I sort products on a category page by subcategory as well as limit the number of products from each subcategory:

For example if the category was Food I would want to display the following:

Drinks
Coke 12oz, Orange Juice 8oz, Milk Gallon,

Pasta,
Spaghetti 1lb, Pesto 12 pc, Tortellini 1 PC.

And so on, displaying each subcategory name followed 3 products (images etc.)

I currently have a custom template that displays the subcategories but can't figure out the products. Here is my current code:

<?php
    $_category = $this->getCurrentCategory();
    $collection = $_category->getCollection()
        ->addAttributeToSelect(
            array('url_key','name','all_children','is_anchor','description','image')
        )
        ->addAttributeToFilter('is_active', 1)
        ->addIdFilter($_category->getChildren())
        ->setOrder('position', 'ASC')
        ->joinUrlRewrite();

    $helper = Mage::helper('catalog/category');
?>

<?php foreach ($collection as $cat): ?>

        <a href="<?php echo $helper->getCategoryUrl($cat); ?>">
            <img src="<?php echo $cat->getImageUrl(); ?>" class="catlevel1image" />

<?php echo $cat->getName(); ?>

        <?php
            $catdesc = '';
            $catdesc = strip_tags($cat->getDescription());
            if (strlen($catdesc) > 300) {
                $catdesc = substr($catdesc, 0, 300) . ' ...';
            }
            echo $catdesc;
        ?>

    <?php

        $childLevel2Category = $cat->getCollection()
            ->addAttributeToSelect(
                array('url_key','name','all_children','is_anchor','description','image')
            )
            ->addAttributeToFilter('is_active', 1)
            ->addIdFilter($cat->getChildren())
            ->setOrder('position', 'ASC')
            ->joinUrlRewrite();
    ?>

        <?php foreach ($childLevel2Category as $catLevel2) { ?>

            <a href="<?php echo $helper->getCategoryUrl($catLevel2); ?>">
                <img src="<?php echo $catLevel2->getImageUrl(); ?>" class="catlevel2image" />

<?php echo $catLevel2->getName(); ?>

            <?php
                $catdesc = '';
                $catdesc = strip_tags($catLevel2->getDescription());
                if (strlen($catdesc) > 60) {
                    $catdesc = substr($catdesc, 0, 60) . ' ...';
                }
                echo $catdesc;
            ?>

        <?php } ?>

<?php endforeach;?>


texts:
How do you run magento commands when using a docker container, like

php bin/magento setup:deploy

I have a docker container with php 7, mysql 5.6. The website works ok, but if I try to run some magento commands it tries to run them through the system php, which is 5.4.

It is more of a docker workflow question, as I'm unsure what to do next. I tried docker exec 281cbd203f92 magento setup:upgrade but obviously it doesn't recognize the magento command. Should I add it to the path in the container?

My container:

281cbd203f92        cloudwaysdocker/docker_debian   "/bin/bash /start.sh"   5 days ago          Up 3 hours          0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   magento2


texts: When customer logged in, checkout is spinning after Defer JS merged

texts:
We are using Magento 2.2.4 and PHP 7.0, Configured enabled on Merged Js and Minify Js also.
Getting checkout is loading issue when customer is logged in only.
Any solution on this