texts: Paypal express checkout causes a redirection to Failure action even when payment was succeeded, in Magento 1.9

texts:
when using Paypal Express Checkout, after authenticating in Paypal sandbox, browser is redirected to "/paypal/express/review/" that shows a page to confirm order... then I press a button called "Place Order" and the order is placed because Paypal funds are decreased by the order amount. Then browser is redirected to /checkout/onepage/success/ from Paypal, but immediately is redirected to /checkout/onepage/failure.

When I see the successAction of OnePageController, I saw this:

public function successAction()
{
    $session = $this->getOnepage()->getCheckout();
    if (!$session->getLastSuccessQuoteId()) {
        $this->_redirect('checkout/cart');
        return;
    }

    $lastQuoteId = $session->getLastQuoteId();
    $lastOrderId = $session->getLastOrderId();
    $lastRecurringProfiles = $session->getLastRecurringProfileIds();
    if (!$lastQuoteId || (!$lastOrderId && empty($lastRecurringProfiles))) {
        $this->_redirect('checkout/cart');
        return;
    }

    $session->clear();
    $this->loadLayout();
    $this->_initLayoutMessages('checkout/session');
    Mage::dispatchEvent('checkout_onepage_controller_success_action', array('order_ids' => array($lastOrderId)));
    $this->renderLayout();
}

There is no a redirect to Failure action.

On the other hand, order is kept in "Payment Review" state and the invoice in "Pending" state.

Finally, I tell you that I have developed an observer that is called on "sales_order_invoice_pay" event. This event is called, even when the invoice remains in pending state.

What may this be causing this failure? when should orderbecome in "Complete" state?

Regards
Jaime


texts:
We are on Magento1.7 using Varnish+nginx+HHVM. Frontend part of the website is fast but on the admin side specifically when there AJAX calls it will take a lot of time.
I observed that disabling Varnish is making admin load quickly but unable to figure out why varnish is causing this problem. Please note that we have an instruction that not to cache admin part and yes we don't have cache issues but performance is killing us.
Please help me with a way to solve this problem.


texts: How to count number of images in view.phtml page?

texts:
I want to add HTML class in view.phtml as per product images.

Like: If product have one image then class add img_1. if have two then img_2

How to get number of images count in view.phtml


texts: How to uninstall / re-install a Magento extension and preserve associated database data

texts:
I already installed an extension on my live site. The extension has a lot of associated data stored in database tables. Due to problems with the extension, I plan to uninstall and re-install it again.

How can ensure that I do not lose the database data associated with my extension?


texts: Order confirmation template : phtml file for payment method

texts:
I have a situation in magento2 where i want to apply css to payment method block in order confirmation template.

But when i inspect it i find additional dl and dt and dd tag.

I have no idea where they are coming from .

So please can someone tell me which file does this tags come from

I have attached the image and the code for payment method

ThankYou

My Phtml Code is:

                                        {{trans "PAYMENT  METHOD"}}

                                        {{var payment_html|raw}}

                            {{depend order.getIsNotVirtual()}}

                                        {{trans "SHIPPING METHOD"}}

                                        {{var order.getShippingDescription()}}

                                                                       {{if shipping_msg}}
                                                {{var shipping_msg}}
                                            {{/if}}

                            {{/depend}}


texts: I would like to display only one country in Customer Address(See below image). How can I do that ?


texts: Magento2 Stripe Extension returns: Uncaught Error: Class 'Stripe\PaymentIntent' not found

texts:
I've installed the Magento2 Stripe extension following this guide: https://stripe.com/docs/plugins/magento/install#manual

The extension is active and I've setup Stripe to send test data. The problem is when I go to the checkout and place the order the following call to http://app.test/rest/default/V1/guest-carts/oza7bFkKh19JjTYedtbp9AyuneWJjtc9/payment-information returns an error:

Fatal error:  Uncaught Error: Class 'Stripe\PaymentIntent' not found in C:\laragon\www\app\code\StripeIntegration\Payments\Model\PaymentIntent.php:149
Stack trace:
#0 C:\laragon\www\app\code\StripeIntegration\Payments\Model\PaymentIntent.php(612): StripeIntegration\Payments\Model\PaymentIntent-&gt;create(Object(Magento\Quote\Model\Quote\Interceptor), Object(Magento\Sales\Model\Order\Payment\Interceptor))
#1 C:\laragon\www\app\code\StripeIntegration\Payments\Model\PaymentMethod.php(232): StripeIntegration\Payments\Model\PaymentIntent-&gt;confirmAndAssociateWithOrder(Object(Magento\Sales\Model\Order\Interceptor), Object(Magento\Sales\Model\Order\Payment\Interceptor))
#2 C:\laragon\www\generated\code\StripeIntegration\Payments\Model\PaymentMethod\Interceptor.php(50): StripeIntegration\Payments\Model\PaymentMethod-&gt;capture(Object(Magento\Sales\Model\Order\Payment\Interceptor), '59.98')
#3 C:\laragon\www\vendor\magento\module-sales\Model\Order\Payment\Operations\CaptureOperation.php(82): StripeIntegration\Payments\Model\PaymentMethod in C:\laragon\www\app\code\StripeIntegration\Payments\Model\PaymentIntent.php on line 149

{"messages":{"error":[{"code":500,"message":"Fatal Error: 'Uncaught Error: Class 'Stripe\\PaymentIntent' not found in C:\\laragon\\www\\app\\code\\StripeIntegration\\Payments\\Model\\PaymentIntent.php:149\nStack trace:\n#0 C:\\laragon\\www\\app\\code\\StripeIntegration\\Payments\\Model\\PaymentIntent.php(612): StripeIntegration\\Payments\\Model\\PaymentIntent->create(Object(Magento\\Quote\\Model\\Quote\\Interceptor), Object(Magento\\Sales\\Model\\Order\\Payment\\Interceptor))\n#1 C:\\laragon\\www\\app\\code\\StripeIntegration\\Payments\\Model\\PaymentMethod.php(232): StripeIntegration\\Payments\\Model\\PaymentIntent->confirmAndAssociateWithOrder(Object(Magento\\Sales\\Model\\Order\\Interceptor), Object(Magento\\Sales\\Model\\Order\\Payment\\Interceptor))\n#2 C:\\laragon\\www\\generated\\code\\StripeIntegration\\Payments\\Model\\PaymentMethod\\Interceptor.php(50): StripeIntegration\\Payments\\Model\\PaymentMethod->capture(Object(Magento\\Sales\\Model\\Order\\Payment\\Interceptor), '59.98')\n#3 C:\\laragon\\www\\vendor\\magento\\module-sales\\Model\\Order\\Payment\\Operations\\CaptureOperation.php(82): StripeIntegration\\Payments\\Model\\PaymentMethod' in 'C:\\laragon\\www\\app\\code\\StripeIntegration\\Payments\\Model\\PaymentIntent.php' on line 149","trace":"Trace is not available."}]}}

I can see in the Stripe webhook logs that the payment is being received also.

Have I missed something during the install step that's causing this to happen?


texts: Magento 2 Can we split order with same order number

texts:
Suppose, there are 2 types of products on my website Product A & Product B.
Here, are 3 cases -

  Case 1 - When customer order Product A(any quantity) type product then from Magento we will get order number like this -
  0000001

  Case 2 - When customer order Product B(any quantity) type product then from Magento we will get order number like this -
  0000002

  Case 3 - When customers order both Product A(2 items) & Product B(3 items) in a single order, then we will get an order number like this - 0000003 - it is fine. But here we need to
  split order number 0000003 into 2 orders internally (maybe like
  this 0000003_1 & 0000003_2 or any other way), a customer must
  have single order number but admin have 2 orders(0000003_1 &
  0000003_2) or any other way so that we can manage internally?

Case 1 and Case 2 is fine, we need to customize Case 3.


texts:
After upgrading my server from Magento 2.1.9 to 2.2.0 my frontend only displays this error:

Error filtering template: Warning: Invalid argument supplied for foreach() in /var/www/root/public_html/vendor/magento/module-catalog-widget/Block/Product/ProductsList.php on line 262

Now I looked into ProductsList.php and looked at lines 262 - 270 but it does not make sense to me why it would output an error...

Heres the code from ProductsList.php:

            foreach ($conditions as $key => $condition) {
        if (!empty($condition['attribute'])
            && in_array($condition['attribute'], ['special_from_date', 'special_to_date'])
        ) {
            $conditions[$key]['value'] = date('Y-m-d H:i:s', strtotime($condition['value']));
        }
    }

    $this->rule->loadPost(['conditions' => $conditions]);
    return $this->rule->getConditions();
}

Can anyone offer some advice on this issue?


texts: same coupon code should apply for diferent conditions

texts:
i want to create a only one coupon code and it should work something like

if subtotal is less than 500 , than 50 discount and if subtotal is more than 500  than 100 discount.

@Amasty posted here Multiple actions on shopping cart price rule : to create 2 different coupons with same coupon codes

but i want to create some 100 coupon codes and those coupon codes should according to above rule

this extension supports what i need, but only for 1 coupon code for one time : http://www.magentocommerce.com/magento-connect/tiered-coupons.html

please help me to find solution.....

thanks in advance.


texts: Magento 2: Add custom binding to an element on the shipping.html knockout template

texts:
I want to extend the module-checkout/view/frontend/web/template/shipping.html so that I can add a new custom binding to the shipping method options so that on init I can trigger another action. I have successfully loaded my shipping.html template and shipping.js files. However, I do not know how to get my customBinding.js file to be picked up by the shipping.html

I copied the module-checkout/view/frontend/web/template/shipping.html to my module MyVendor/MyModule/view/frontend/web/template/shipping.html and modified the <input name="shipping_method" type="radio"></input> button to include a new binding as follows:

File: MyVendor/MyModule/view/frontend/web/template/shipping.html

<input name="shipping_method" type="radio"
     data-bind="
         value: method.carrier_code + '_' + method.method_code,
         checked: $parent.isSelected,
         attr: {
            'id': 's_method_' + method.carrier_code + '_' + method.method_code,
            'aria-labelledby': 'label_method_' + method.method_code + '_' + method.carrier_code + ' ' + 'label_carrier_' + method.method_code + '_' + method.carrier_code
              },
         click: $parent.selectShippingMethod,
         customBinding: $parent.isSelected"
class="radio"/>

I just created a simple custom binding following the instructions of how to do so from the knockout.js tutorial on custom bindings:

File: MyVendor/MyModule/view/frontend/web/js/customBinding.js

define([
    "jquery",
    "ko",
    "uiComponent"
], function($, ko, Component) {
    "use strict";

    ko.bindingHandlers.customBinding = {
       init: function(element, valueAccessor) {
           console.log("I am a custom binding");
           console.log(element);
           console.log(valueAccessor);
       }
    };

});

I changed the shipping component's js file to point to my shipping.js, which is where the template is specified.

File: MyVendor/MyModule/view/frontend/layout/checkout_index_index.xml

    <referenceBlock name="checkout.root">
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="checkout" xsi:type="array">
                        <item name="children" xsi:type="array">
                            <item name="steps" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="shipping-step" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="shippingAddress" xsi:type="array">
                                                <item name="component" xsi:type="string">MyVendor_MyModule/js/view/shipping</item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>
</body>

This is the change i made to the shipping.js file so that it picked up my shipping.html  template instead of the default.

File: MyVendor/MyModule/view/frontend/web/js/view/shipping.js

...
var popUp = null;
        return Component.extend({
            defaults: {
                template: 'MyVendor_MyModule/shipping'
            },
...


texts: How to convert magento1 extensions to magento2?

texts: Is it possible to convert magento1 extensions to magento2?.I am searching but no perfect solution.Can you please help me?


texts: New coupon code comes up as already existing

texts: Am trying to create a new coupon code but when I try to save it an error message comes up saying that this code already exists.  I need to use this particular code as have already heavily advertised it.


texts: How can i make a particular block cachable

texts:
I have a custom block i want only that block's cache to be cleared
I tried 2 methods

set cachable = false in layout file for my block (This clears full page cache)
in my block I added a method

public function getCacheLifetime()
{
    return false;
}

This also clears the cache of all the blocks available for that layout (i.e clears full page cache).
Is there any way to just make my block uncacheable?


texts:
I would like to rewrite a model class which is in the community pool. I've looked for solution but I cannot managed to override a community module. Here's my module:

app/etc/Mycompany_Mymodule.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Mycompany_Mymodule>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Unirgy_Dropship/>
            </depends>
        </Mycompany_Mymodule>
    </modules>
</config>

Config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Mycompany_Mymodule>
            <version>0.1.0</version>
        </Mycompany_Mymodule>
    </modules>

    <global>
        <models>
            <unirgy_dropship>
                <rewrite>
                    <pdf_shipment>Mycompany_Mymodule_Model_Pdf_Shipment</pdf_shipment>
                </rewrite>
            </unirgy_dropship>
        </models>
    </global>
</config>

Could you tell me what I am doing wrong please ? thanks


texts: Magento 2 - Create or change customer to set customerID

texts:
Is there a way to create a customer programmatically and set the customer ID?
Or is there a way to change it afterwards?

We are getting customer data from a central system in csv format and would like to create customer with the same ID like in the central system


texts: How to update catalog product listing layout in Magento 1.9.2

texts:
I have created custom module and update layout for catalog product listing page and product detail page shown below.

<layout version="0.1.0">
<catalog_product_view translate="label">
        <reference name="product.info.addtocart">
            <block type="core/template" name="mytest" template="mytest/mytest.phtml"/>
        </reference>
        <reference name="product.info.additional">
            <block type="core/template" name="mytest"
                   template="mytest/mytest.phtml"/>
        </reference>
    </catalog_product_view>
    <catalog_category_layered translate="label">
        <reference name="product.info.addtocart">
            <block type="core/template" name="mytest" template="mytest/mytest.phtml"/>
        </reference>
        <reference name="product.info.additional">
            <block type="core/template" name="mytest"
                   template="mytest/mytest.phtml"/>
        </reference>
    </catalog_category_layered>
</layout>

Its working fine for product detail page but it won't work on catalog product listing page.

Please advice me how to add custom block under the product price/Add Cart button in product listing page?


texts: Magento 2 "No Payment Methods" in Admin New Order

texts:
In a Magento 2.3.1 site, I have two third-party payment methods and PayPal Express Checkout enabled. On the frontend, the three works perfectly. But, when I am trying to create a new order on admin panel, the payment methods are not displayed when I click on Get shipping methods and rates

I tested enabled the method Check / Money Order in my developer environment, and this is displayed correctly:

What could be causing the other three not are displayed?

Thanks.


texts: Is it better to use solely around function instead of before+after combined?

texts:
The codes below can achieve the same output:

Using solely around plugin

public function aroundXXX(
    SomeClass $subject,
    \Closure $proceed
){
    beforeFunctions();
    /*Perform XXX*/
    $result = proceed();
    afterFunctions();
    return $result;
}

Using before+after plugin combined

public function beforeXXX(
    SomeClass $subject
){
    beforeFunctions();
}

public function afterXXX(
    SomeClass $subject,
    $result
){
    afterFunctions();
    return $result;
}

My question is: Which method is better, in terms of best practice and efficiency?


texts: How to update sales_order_grid table in M2 production mode?

texts:
We have a working, well filled sales_order_grid table. But those orders we add via custom integration do not show up there - or show up, but with a very long delay.

We found in the cron_schedule table that three jobs are running: sales_grid_order_async_insert, sales_grid_order_invoice_async_insert and sales_grid_order_shipment_async_insert - but they never finish.

Is there a way to re-synchronize the entire sales_order_grid table? Would it re-fill if we truncate it? Or can we run the sales_grid_order_async_insert manually? Is there an easy way to debug it?

Some answers to other questions refer to options that are only available in Magento2 developer mode, but do not apply to production mode.


texts: How do I set templateOptions for transactional emails?

texts:
I want to change the date format in transactional emails.
I believe I can do this by settings $created_at_formatted within $templateOptions.
But where/how do I set $templateOptions for say the "New Order" email?


texts:
Each of my products can be sent to a recipient (they're gift products), so I have address fields (just text input fields – custom options) in which the purchaser would add the address of the person to whom they'd like to post the product. As a customer may by two or three products, with each one being posted to a different person, I have no need for the purchaser on my store to enter their delivery address once they go to the checkout page.

Is there a way for me to disable M2 from asking for the customer's delivery address?


texts: Cannot access custom category list mode on frontend (Grid, List, etc...)

texts:
I tried add a list_mode in magento but all that this was able to accomplish (for me, on v1.9.1.0) was appending the list in Configuration > System > Catalog > Front End > List Mode. I saved the new setting but when echoing "$this->getMode()" nothing is returned unless I select one of the grid or list options.

\app\code\local\Mage\Adminhtml\Model\System\Config\Source\Catalog\ListMode.php

class Mage_Adminhtml_Model_System_Config_Source_Catalog_ListMode
{
    public function toOptionArray()
    {
        return array(
            //array('value'=>'', 'label'=>''),
            array('value'=>'grid', 'label'=>Mage::helper('adminhtml')->__('Grid Only')),
            array('value'=>'list', 'label'=>Mage::helper('adminhtml')->__('List Only')),
            array('value'=>'slider', 'label'=>Mage::helper('adminhtml')->__('Slider Only')),
            array('value'=>'grid-list', 'label'=>Mage::helper('adminhtml')->__('Grid (default) / List')),
            array('value'=>'list-grid', 'label'=>Mage::helper('adminhtml')->__('List (default) / Grid')),
            array('value'=>'slider-grid-list', 'label'=>Mage::helper('adminhtml')->__('Slider (default) / Grid / List')),
        );
    }
}


texts: Magento 2 get out of stock products in collection

texts:
I am trying to get all the products from the collection(both in stock and out of stock) but with no luck at all. The setting on admin needs to hide the out of stock products from frontend but I want to show them in a specific page.

This is my code:

$productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection');
$productCollection->addAttributeToSelect('*');
$productCollection->load();

This brings the in stock products only. How can I modify it to bring and the out of stock as well?

Thanks


texts: Magento 2 : Shopping cart is empty but Display product in mini cart

texts:
I have work in Local Environment.
I had install multiple Magento version in my local environment.
I have two Magento project of version 2.3.0 and 2.3.1.
When I had Add one product in Mage231 project and I had run Mage230 project
then Mage230 will display product in mini cart with same options and same Name.
and when i will goto Checkout page it will display Me...

and Mage231 will work Properly.

What is Main issue..


texts: Product select attribute whose value is textarea with wysiwyg

texts:
I have product select attribute for product material. Now I have created select attribute and in admin I can choose product material and it's ok. But in front I want to show material image and description.

So I need that select option value  was textarea and i could put into them image and description.

There is any way to have what I want?


texts:
Magento 2 has multiple session types. I know that each type gives you access to different information ie current customer information.

The sessions I know of are:

\Magento\Backend\Model\Session
\Magento\Catalog\Model\Session
\Magento\Checkout\Model\Session
\Magento\Customer\Model\Session
\Magento\Newsletter\Model\Session

What I need to know is when are these different sessions instantiated / refreshed?

I'm currently having a problem where I add data using ->setData to the Catalog Session. After adding a product to the cart this data (->getData) doesn't exist anymore. Or at least this is what seems to happen.


texts: Magento 2 - Load Balancer - Health Check Failing - 302 redirect

texts:
I am having an issue with my load balancer health checks. It is attempting to access the server hosting the Magento 2 site. When I curl the IP address of the machine I get the following Response Headers:
curl -i xxx.xxx.xxx (ip address of the server)

HTTP/1.1 302 Found
Location: https://www.example.com/?SID=79561247abvhemu78nosr0u32l
....

It appears to be redirecting to the domain set inside the Magento2 configuration.
I have read about the SID value. I am not sure if this is causing the redirect but the site will be a multi store site so I would like to keep the SID enabled.
The issue is that when the Load Balancer hits the server I am getting a 302 which causes the health check to fail.
I am unsure of what is causing this redirect and how to best get the health check to pass.
Update
I have confirmed that it is Magento doing the redirect and not the web server. If I remove index.php and replace it with a new php file (Not running Magento) I get a 200 response. So it appears that something in the codebase is creating the redirect.
I ran bin/magento config:show and it returned the following:
web/seo/use_rewrites - 1
web/unsecure/base_url - https://www.example.com/
web/unsecure/base_static_url -
web/unsecure/base_media_url -
web/unsecure/base_link_url - https://www.example.com/
web/secure/base_url - https://www.example.com/
web/secure/use_in_frontend - 0
web/secure/use_in_adminhtml - 0
web/secure/base_static_url -
web/secure/base_media_url -
web/default/cms_home_page - home
web/cookie/cookie_path -
web/cookie/cookie_domain -
web/cookie/cookie_httponly - 1
web/url/use_store - 0
web/url/redirect_to_base - 0
...
...
...

Plus a lot more config settings, that seemed irrelevant.


texts: Checkout - Accept email id in login.phtml step of one page magento checkout

texts:
During the checkout process, in billing.phtml the following submit code accepts the various inputs given by the user

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

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

It specifically looks like the onclick="billing.save()" causes the entries to be processed.

How do i modify the above to accept email id in the previous login.phtml step of the one page checkout process ?


texts: ifAdmin test in Head.php breaking Admin area

texts:
new to SE, so apologies if this isn't specific enough.

We use Magento CE for a smallish online store (CE1.7.x).

I am trying to delay loading of JS only for shop browsers to speed the page up.

Per this topic, In the head.php (public_html/app/code/core/Mage/Page/Block/Html) I have added this:

        // static and skin javascripts
        // check if logged in user is Admin, if so, do not async JS -- added by Tim Oct 15 2014
        // remove lines 207-214 to remove this -- note, async JS breaks admin
       if (Mage::app()->getStore()->isAdmin()) {

        $html .= $this->_prepareStaticAndSkinElements('<script type="text/javascript" src="%s"%s></script>' . "\n",
            empty($items['js']) ? array() : $items['js'],
            empty($items['skin_js']) ? array() : $items['skin_js'],
            $shouldMergeJs ? array(Mage::getDesign(), 'getMergedJsUrl') : null
        );
       }

        // if not Admin, async JS to speed page up
        $html .= $this->_prepareStaticAndSkinElements('<script type="text/javascript" async src="%s"%s></script>' . "\n",
        empty($items['js']) ? array() : $items['js'],
        empty($items['skin_js']) ? array() : $items['skin_js'],
        $shouldMergeJs ? array(Mage::getDesign(), 'getMergedJsUrl') : null
        );

The problem is:
Whilst it speeds the page load to visitors up (verified by GTMetrix), some aspects of Admin break. For instance, CMS->Pages, I can't edit anything after the second listed page. (When I mouse over, they're inactive).

I commented out the Admin test and reverted to original code, and it's fine.

This indicates it is the code, but I've no idea why.

I am logged in with a user called Tim, not Admin which makes me wonder if I am testing the

My question:
Why would this test cause the CMS pages would be breaking (long shot for the reasons I've explained above).

We test for Admin, and if Admin view, we load first.
If not admin, load async JS.

I should note, I am neither a Magento dev nor PHP dev.

Again, apologies if this is not specific enough.


texts: Changing values in Grid adminhtml of a Multiselect field

texts:
I've created an adminhtml grid which is supposed to map Block Positions to Services. For example: The block "Sidebar right Bottom" could be linked to Facebook, Twitter, Instagram and then that block would have those 3 services linked in it.

The issue I'm having, is that the column "Services" is displaying the IDs of the services, instead of their Titles. I've tried to rectify this issue by modifying my Grid.php file:

protected function _prepareColumns()
{
    // Add the columns that should appear in the grid
    $this->addColumn('id',
        array(
            'header'=> $this->__('ID'),
            'align' =>'right',
            'width' => '50px',
            'index' => 'id'
        )
    );

    // $this->addColumn('name',
    //     array(
    //         'header'=> $this->__('Name'),
    //         'index' => 'name'
    //     )
    // );

    $this->addColumn('name', array(
        'header'    => Mage::helper('sociable')->__('Name'),
        'index'     => 'name',
        'type'      => 'options',
        'options'   => array(
            'sociable.product_page' => Mage::helper('sociable')->__('Inside product page'),
            'sociable.left_top' => Mage::helper('sociable')->__('Sidebar left top'),
            'sociable.left_bottom' => Mage::helper('sociable')->__('Sidebar left bottom'),
            'sociable.right_top' => Mage::helper('sociable')->__('Sidebar right top'),
            'sociable.right_bottom' => Mage::helper('sociable')->__('Sidebar right bottom'),
            'sociable.content_top' => Mage::helper('sociable')->__('Content top'),
            'sociable.content_bottom' =>  Mage::helper('sociable')->__('Content bottom')
        ),
    ));
    $serviceTitle = [];
    $serviceId = [];
    $service = Mage::getModel('sociable/service')->getCollection();
    foreach($service as $data){
        array_push($serviceTitle, $data->getTitle());
        array_push($serviceId, $data->getServicesId());
    }
    $counter = count($serviceTitle);
    $serviceArray = [];
    for($i = 0 ; $i < $counter ; $i++){
        $serviceArray[$serviceId[$i]] = $serviceTitle[$i];
    }

    $this->addColumn('services',
        array(
            'header'=> $this->__('Services'),
            'index' => 'services',
            'type'  => 'options',
            'options' => $serviceArray,
            )
    );

    return parent::_prepareColumns();
}

I've tried providing the services field with "options" and passing in the array of services which is created by mapping the ID of the service to the Title of the service. The Array looks like so:

Array(
    [1] => Facebook
    [2] => Twitter
    etc...
)

When the multi-select field is set with only 1 value, the grid will display the value as needed. However if multiple values are selected, the grid will display nothing. Here is a screenshot to illustrate:

Here is how it looks when I remove the "options" from the services field:

I'm hoping that when multiple values are saved, it will be stored in the Grid like so: "Diigo, Twitter, Facebook" ... etc. Similar to how the IDs are stored in the second image.

Any ideas on how I can resolve this issue?

Thanks so much!


texts: How to extend admin js in magento 2 by mixins

texts:
I want to overide

Magento_Sales/adminhtml/web/order/create/scripts.js

I wrote require-config.js for this

var config = {
    config: {
        mixins: {
            'Magento_Sales/adminhtml/web/order/create/scripts.js': {
                'Magento_Sales/web/order/create/scripts-mixins.js': true
            }
        }
    }
};

My implementation is in file

Magento_Sales/web/order/create/scripts-mixins.js
define([
    "jquery",
    'Magento_Ui/js/modal/confirm',
    'Magento_Ui/js/modal/alert',
    "mage/translate",
    "prototype",
    "Magento_Catalog/catalog/product/composite/configure",
    'Magento_Ui/js/lib/view/utils/async'
], function(jQuery, confirm, alert){

   return AdminOrder.prototype = {
       setCustomerId : function(id){
            return false;
            this.customerId = id;
            this.loadArea('header', true);
            $(this.getAreaId('header')).callback = 'setCustomerAfter';
            $('back_order_top_button').hide();
            $('reset_order_top_button').show();
        }
   }
});

But its not working.
its always executing parent class function.


texts: Magento 2 - what is the purpose of "update" in a layout file?

texts:
I often see code like <update handle='xy' /> in layout files.
vendor\magento\module-sales\view\frontend\layout\sales_email_order_items.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" label="Email Order Items List" design_abstraction="custom">
    <update handle="sales_email_order_renderers"/>
    <update handle="sales_email_item_price"/>
    <body>
        ...
    </body>
</page>

What is the purpose of it?


texts: How to send dynamic data to custom email template from controller action?

texts:
I need to pass Customer Full Name and Order # dynamically to mail, but not receiving in actual Email.

Controller

$templateId = 17;
$emailTemplate = Mage::getModel('core/email_template')->load($templateId);

$processedTemplate = $emailTemplate->getProcessedTemplate();

$mail = Mage::getModel('core/email');
$mail->setToName($customer->getId());

$email_template_variables = array(
   'customer_name' => $fullName,
   'order_id' => $orderID
);

$mail->setTemplateParam($email_template_variables);
$mail->setToEmail($customer->getEmail());
$mail->setBody($processedTemplate);
$mail->setSubject($mailSubject);
$mail->setFromEmail($from_email);
$mail->setFromName($from_name);
$mail->setType('Html');

try {
    $mail->send();
    Mage::getSingleton('core/session')->addSuccess('Your request has been sent');
} catch (Exception $ex) {
    Mage::getSingleton('core/session')->addError('Unable to send.');
}

Accessing those variables by

{{var customer_name}} and {{var order_id}}

It is empty. No Value.


texts: Magento2 plugin around listener not working

texts:
I want to override a method from a Ui component which sets filter values.
My Plugin code

<?php

namespace MyVendor\MyModule\Plugins\DataProvider\Product;

class GiftProvider
{
    public function aroundAddFilter(
          $subject,
          \Closure  $proceed,
          \Magento\Framework\Api\Filter $filter
    )
    {
        if (isset($subject->addFilterStrategies[$filter->getField()])) {
            $subject->addFilterStrategies[$filter->getField()]
            ->addFilter(
                    $subject->getCollection(),
                    $filter->getField(),
                    [$filter->getConditionType() => $filter->getValue()]
            );
        } else {
            $abstractProvider::addFilter($filter);
        }

        if(!isset($subject->addFilterStrategies['is_gift']))
        {
            $subject->addFilterStrategies['is_gift']
                ->addFilter(
                    $subject->getCollection(),
                    'is_gift',
                    [$filter->getConditionType() => 1]);
        }
        return $subject;
    }

}

etc/adminhtml/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider">
        <plugin name="gift_data_provider_around_plugin" type="MyVendor\MyModule\Plugins\DataProvider\Product\GiftProvider" sortOrder="1500" />
    </type>
</config>

Ajax returns

Fatal 500 Internal Server Error

And a message is outputted saying :

"Attention
Something went wrong."

What did go wrong is that the response of the ajax is empty when I inspect it.

Where is my mistake, Is this possible ?


texts: Parent menu item unclickable after adding subcategory.

texts:
Recently I changed some parent menu name and it's path（Those parent menus are all categories, not cms pages）, now I find out those parents menu that has subcategories are unclickable, it can only show the subcategories when hover on I can click subcategories.

But the Parent Menu without subcategories still clickable.

I'm wondering how can I make this parent menu clickable again? Thanks


texts:
I'm trying to add products to a page.
I used this code in contents of the page.

<p>{{block type="catalog/product_list" category_id="4" template="catalog/product/list.phtml"}}</p>.

And I got this error.

  Fatal error: Call to a member function getSortedChildren() on a
  non-object in
  C:\wamp\www\magento\app\design\frontend\rwd\default\template\catalog\product\list.phtml
  on line 180.

How to fix it?


texts: How to Upgrade Custom Module in Magento 2.3

texts:
I am using Magento 2.2.3 currently, and i have created many custom modules. Now i am planing to upgrade my site with Magento 2.3.2. So i have no idea how can i upgrade my custom modules. I am very new to magento 2.3 . I mean what kind of code changes require to make compatiable my custom module with Magento 2.3. Any help?

Thanks in advance...!!!


texts: Which files to update for a custom product layout

texts:
I want to create a new theme for custom layout on some product pages.
I want to remove some items like minimum price.
Which files do I need to include in that theme.

(I wrote something here about that last night but cannot find it anymore)


texts: Disabled products still visible in configurable product options

texts:
Our client prefers not to use Magento's inventory management tools, so when he sells out of an item he prefers to manually disable it. Our problem is that despite disabling the simple product it's still showing up on the front-end of the site on the configurable product page.

If you try to add it to the cart it correctly says the item is unavailable, but we don't want the item to be visible at all… how do we do this?

For both simple and configurable products under Inventory "Manage Stock" is set to "No", and under System -> Config -> Inventory -> Stock options "Display Out of Stock Products" is also set to "No".


texts: Create customer custom attribute checkbox in edit form backend

texts:
I added my customer attribute.

But I want to display these fields as checkboxes. I created checkbox in the frontend easily but the backend is not. And then save to the database. Please help me. Thanks.

my script

<?php
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttribute('customer', 'biz_confirmation', array(
    'label'     => 'Business Customer Confirmation',
    'type'      => 'int',
    'input'     => 'checkbox',
    'visible'   => true,
    'required'  => true,
    'default'   => '0',
));
$setup->addAttribute('customer', 'marketing_consent', array(
    'label'     => 'Marketing Consent',
    'type'      => 'int',
    'input'     => 'checkbox',
    'visible'   => true,
    'required'  => false,
    'default'   => '0',
));
$setup->addAttribute('customer', 'b2b_contact_consent', array(
    'label'     => 'B2B Contact Consent',
    'type'      => 'int',
    'input'     => 'checkbox',
    'visible'   => true,
    'required'  => false,
    'default'   => '0',
));
$setup->addAttribute('customer', 'biz_confirmation_time', array(
    'label'     => 'Business Customer Confirmation Update Time',
    'type'      => 'datetime',
    'input'     => 'datetime',
    'visible'   => false,
    'required'  => false,
));
$setup->addAttribute('customer', 'mkt_consent_updated_time', array(
    'label'     => 'Marketing Consent Update Time',
    'type'      => 'datetime',
    'input'     => 'datetime',
    'visible'   => false,
    'required'  => false,
));
$setup->addAttribute('customer', 'b2b_consent_updated_time', array(
    'label'     => 'B2B Contact Consent Update Time',
    'type'      => 'datetime',
    'input'     => 'datetime',
    'visible'   => false,
    'required'  => false,
));
$attributeCodes = array(
    'biz_confirmation',
    'marketing_consent',
    'b2b_contact_consent',
    'biz_confirmation_time',
    'mkt_consent_updated_time',
    'b2b_consent_updated_time'
);

foreach($attributeCodes as $code) {
    $attribute = Mage::getSingleton("eav/config")->getAttribute('customer', $code);
    $used_in_forms = array(
        'adminhtml_customer',
        'checkout_register',
        'customer_account_create',
        'customer_account_edit');
    $attribute->setData("used_in_forms", $used_in_forms)
        ->setData("is_used_for_customer_segment", true)
        ->setData("is_system", 0)
        ->setData("is_user_defined", 1)
        ->setData("is_visible", 1)
        ->setData("sort_order", 100);
    $attribute->save();
}


texts: How to check installed extensions on database magento 2

texts:
I need to check installed module on database table
I hope your help
Thanks
Thomas


texts: Error in file: "......sql/log_setup/mysql4-upgrade-1.6.1.0-1.6.1.1.php" after upgrading from 1.9.1.0 to 1.9.2.4

texts:
I used the same software installer (Softaculous) that I actually used to install Magento in the first place. Now - Softaculous upgraded my Magento 1.9.1.0 to Magento 1.9.2.4. The upgrade was done successfully but now - when I try to access the home page - it tries for a very very long time and then I get the following Error on the home page:

Error in file: "/home/account/public_html/app/code/core/Mage/Log/sql/log_setup/mysql4-upgrade-1.6.1.0-1.6.1.1.php" - SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Trace:
#0 /home/account/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(644): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/account/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.6.1.0', '1.6.1.1')
#2 /home/account/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.6.1.0', '1.6.1.1')
#3 /home/account/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/account/public_html/app/code/core/Mage/Core/Model/App.php(428): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/account/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()
#6 /home/account/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /home/account/public_html/index.php(83): Mage::run('', 'store')
#8 {main}

**

Magento 1.9.1.0 to 1.9.2.4
             Apache Version 2.4.23
             MySQL Version  5.6.31
             PHP Version    5.5 (I also tried switching to 5.6.25)

**

I also get notifications via Email saying that:

  This message is to alert you that the username ACCOUNT has exceeded
  their MySQL connection limit. Please view the details below.

  Server: new.SERVER.net User: ACCOUNT MySQL Connection Limit:  Current
  MySQL Connections: 150

I have increased the limit many times before but I get these notifications every once in a while. I get them a lot since the upgrade I just did...


texts: Can I add an image in product description page in tabs section?

texts:
I want to do something like that .  Now I can Just add text in highlighted tab I guess . How is it possible to do that.

Any idea?


texts: Magento - upgraded to 1.9 - admin not loading images & js because 403 error

texts:
I am going through the painstaking process of upgrading from 1.6 to 1.9

I choose to do a fresh install of 1.9 instead of each variation.

I followed these steps and seem to have gotten pretty good results but with some hiccups along the way.

(This answer is what I used for the upgrade: https://stackoverflow.com/questions/24043812/how-to-upgrade-magento-1-6-to-magento-1-9)

Problem:
When I log into the admin.. nothing is clickable or updatable, also the Magento logo does not appear, but the files are on the server and the are linked with the correct paths.

When I go to a .js file or image file I am getting a 403 forbidden access to this resource on the server denied!

I'm pretty sure this is an .htaccess issue with permissions but I have been playing with it and no luck.

NOTE: FIXED THIS, May Be Related: I was getting a warning first time i logged into admin and it was because an .htaccess file was missing in the app/etc/ directory... I added it with deny and that warning is now gone in the admin screen.

UPDATE! The permissions for the /skin/adminhtml/default/default/images

The folder Dir are set to 755, but the files themselves are set to 644

I changed the logo file to 755 - and now it pops up on the admin page...

Is there a correct way to set all these files including the JS files to 755 so its not 403? I could try and go in there 1by1 but I assume there is a better way and correct way for the rest of the store not getting these errors...

Please see screenshot of admin with console current trouble:

Assume:
So assume this has something to do with global access.


texts: How to get product QTY on product view page?

texts:
I'm trying to get the quantity of the products in this file below, using $_product->getQty() but doesn't get, is returned NULL.

design/frontend/MyCompany/MyTheme/Magento_Catalog/templates/product/view/type/default.phtml


texts: After following this post clients that register trough /customer/account/create/ successfully is not required to input a lastname, but their whole name won't show on the client grid. If the lastname is changed, it reappears.


texts:
I've following code in Form.php

$chooser = $this->_layout->createBlock('\Magento\Catalog\Block\Adminhtml\Product\Widget\Chooser');
        //var_dump(get_class_methods($chooser));

        $configChooser = [
            'button' => [
                'open' => __('Select Products'),
                'type' => '\Magento\Catalog\Block\Adminhtml\Product\Widget\Chooser',
            ]
        ];
        $chooser->setConfig($configChooser)
            ->setFieldsetId($fieldset->getId())
            ->prepareElementHtml($productChooser);

When I click on Select Products button I'm getting the following error

widget.js:683 Uncaught TypeError: Cannot read property 'value' of null
    at getElementValue (widget.js:683)
    at g.choose (widget.js:620)
    at HTMLButtonElement.onclick ((index):303)

any idea what could be wrong?


texts: showing product lists associated with an invoice in sales_order_invoice_grid.xml

texts:
I was trying to add products bought in sales_order_invoice_grid.xml. I added a column to add products. i am adding code below. I don't know to which table i have to join for that.This is my code.
app\code\Magento\Sales\view\adminhtml\ui_component\sales_order_invoice_grid.xml
<column name="name">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="filter" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Medicines </item>

            </item>
        </argument>
    </column>

app\code\Magento\Sales\Model\ResourceModel\Order\Invoice\Grid\Collection.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Magento\Sales\Model\ResourceModel\Order\Invoice\Grid;

use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy;
use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory;
use Magento\Framework\Event\ManagerInterface as EventManager;
use Magento\Sales\Ui\Component\DataProvider\Document;
use Psr\Log\LoggerInterface as Logger;

class Collection extends \Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult
{
    /**
     * @inheritdoc
     */
    protected $document = Document::class;

    /**
     * Initialize dependencies.
     *
     * @param EntityFactory $entityFactory
     * @param Logger $logger
     * @param FetchStrategy $fetchStrategy
     * @param EventManager $eventManager
     * @param string $mainTable
     * @param string $resourceModel
     */
    public function __construct(
        EntityFactory $entityFactory,
        Logger $logger,
        FetchStrategy $fetchStrategy,
        EventManager $eventManager,
        $mainTable = 'sales_invoice_grid',
        $resourceModel = \Magento\Sales\Model\ResourceModel\Order\Invoice::class
    ) {
        parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel);
    }

     protected function _renderFiltersBefore()
    {
    $joinTable = $this->getTable('sales_order_address');
    $this->getSelect()->joinLeft($joinTable, "main_table.order_id =
    {$joinTable}.parent_id AND {$joinTable}.address_type = 'billing'",
      ['telephone','city','region','country_id']);
       parent::_renderFiltersBefore();
   }

}

i want to products related to that invoice also in sales invoice section.anybody pls help.


texts: Magento2: Order updated_at stored in DB in timezone CEST but delivered/transformed to UTC by $order->getUpdatedAt in Environment "crontab"

texts:
we are facing a strange behavior for value of updated_at saved in db table sales_order. Server timezone is CEST, updated_at date therefor is saved in CEST to database. This is validated. Default config timezone is "Europe/Berlin".

Cron job collects orders with specific state via resource collection to manipulate them. Debugging updated_at value by looping result set prints value/date in UTC, its -2h. This runs in "crontab" environment/area. This happens (in loop) for all those calls:

echo $order->getUpdatedAt();
echo $order->getData('updated_at');
echo $order->getOrigData('updated_at');

//Collection load
$criteria = $this->criteriaBuilder->addFilter('state', Order::STATE_PAYMENT_REVIEW)->create();
$items = $this->orderRepository->getList($criteria)->getItems();

We checked mostly every possibility why and how this transformation happens but we didn't find any hint in code. We found no after collection load observer or any other forced transformation. Magento folks, what could cause this behavior?

Thanks in advance


texts:
Where can I download the patch SUPEE 5994 for release 1.9.1.1 for Community Edition. Tried searching on the net and it directs me to https://magento.com/tech-resources/download. However I am not able to find the download links. Will be great if somebody could direct me to the right url.
Regards,
Joye


texts: Will Magento recognize a theme with empty folders?

texts: I'm trying to learn Magento theme structure, I've been told that I should create a package and a theme folders under app/design/frontend and also under the skin directory, but whenever I save the configuration , I get package with this name does not exist and cannot be set.


texts:
I am having issue while loading bootstrap 4 in magento 2

var config = {
 paths: {
    'popper': 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.5/umd/popper.min',
    'bootstrap': 'https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min'
},
shim: {
    'popper': {
        'deps': ['jquery'],
        'exports': 'Popper'
    },
    'bootstrap': {
        'deps': ['jquery', 'popper']
    }
}
 };

I have create requirejs-config.js as above code.
When I load the page it gives me an error

  GET http://localhost/project/popper.js net::ERR_ABORTED

  Refused to execute script from 'http://localhost/project/popper.js'
  because its MIME type ('text/html') is not executable, and strict MIME
  type checking is enabled.

  Uncaught Error: Script error for: popper.js
  http://requirejs.org/docs/errors.html#scripterror
      at makeError (require.js:166)
      at HTMLScriptElement.onScriptError (require.js:1681)


texts:
I found this class in Varien Varien_Convert_Parser_Xml_Excel however, I couldn't find any source on how to create an XLS file with multiple sheets in it.

Note that it needs to be XLS not CSV.


texts: Custom module: translate string in Mage::throwException

texts:
I'm new to Magento and I've just built a custom module for a store. The module observes the event sales_order_place_before, and checks with an outside source if an item is still in stock. When the customer wants to pay for the order and a product in the cart is out of stock, I throw an error in my Observer.php model. It appears as a popup for the customer.

if(!$success){
    Mage::throwException("item not in stock");
}

Is it possible to throw this error in multiple languages, for example English and Dutch? And how does that work? I can't seem to make sense of how to use translations in an observer instead of frontend. And since this is just a custom string, it could be anything, I would not be overwriting any Magento error.

EDIT:
My module's config xml (I've removed the actual namespace and module name). Do I define a helper like this? What do I put in the helper?

<config>
<modules>
    <Namespace_Modulename>
        <version>0.1.0</version>
    </Namespace_Modulename>
</modules>

<global>
    <helpers>
        <translations>
          <class>Namespace_Modulename_Helper</class>
        </translations>
    </helpers>
    <events>
        <sales_order_place_before>
            <observers>
                <Namespace_modulename_model_observer>
                    <type>singleton</type>
                    <class>Namespace_Modulename_Model_Observer</class>
                    <method>placingOrder</method>
                </Namespace_modulename_model_observer>
            </observers>
        </sales_order_place_before>
    </events>
</global>

<frontend>
    <translate>
         <modules>
             <Namespace_Modulename>
                 <files>
                     <default>Namespace_Modulename.csv</default>
                 </files>
             </Namespace_Modulename>
         </modules>
     </translate>
</frontend>

I have created a helper with an empty class in Helper/Data.php in my module:

class Namespace_Modulename_Helper_Data extends Mage_Core_Helper_Abstract{}

I've added the csv file in app/locale/nl_NL


texts:
$mail = new zend_Mail();
 $mail->setFrom('test@gmail.com','martal');
 $mail->addTo('test1@gmail.com', 'kelvin');
 $mail->setSubject("test mail functionality");
 try{
    $mail->send();
 }catch(Exception $e){
    echo $e->getMesssage();
 }

I use the above for sending mail but it's not working.
I couldn't find any error in exception.log also hasn't got any message in cache
Also, I run the cron.php no use with it.
But could get order confirmation mail etc..

Can anyone suggest me a solution?


texts:
My Magento Adminhtml error about CSS, jQuery, Image. My Frontend is still normal. Although I did deploy with my area is vi_VN but cannot fix this error.

This is my Adminhtml and Error:

I did deploy:


texts: Programatically generate order with custom order#

texts:
I'm using the code available here to generate orders programmatically (importing from an older in-house system) and its actually working quite well. I've made some changes to check/create customers as needed, but it makes the orders just fine with one exception. I'd like to set the order number of these imported orders to match the number they had in the old system (a simple 4 to 6 digit number) without affecting magento's normal order numbering (these imported orders will be in a different "store" from new orders anyway).

I've tried a few variations for setting the IncrementID right before saving the order, but nothing seems to stick.

Some of the things I've tried:

Mage::getModel('sales/order')
    ->setIncrementId('test1234');

Mage::getSingleton('eav/config')
    ->getEntityType('order')
    ->setIncrementId('test1234');


texts: Where is related product place in Magento2?

texts:
In product view xml , i found that

<referenceContainer name="content.aside">
            <block class="Magento\Catalog\Block\Product\ProductList\Related" name="catalog.product.related" template="Magento_Catalog::product/list/items.phtml">
                <arguments>
                    <argument name="type" xsi:type="string">related</argument>
                </arguments>
            </block>
            <block class="Magento\Catalog\Block\Product\ProductList\Upsell" name="product.info.upsell" template="Magento_Catalog::product/list/items.phtml">
                <arguments>
                    <argument name="type" xsi:type="string">upsell</argument>
                </arguments>
            </block>
            <block class="Magento\Catalog\Block\Product\View\Additional" name="product.info.additional" as="product_additional_data"/>
        </referenceContainer>

How is the html called from template?


texts: Remove an item from admin order quote and add new item programmatically

texts:
I am working on a project that needs to tweak admin order creation function of magento.

I need to remove an item and then add another item programmatically while creating order.

For example, few items are already added to order, now if product id matches with my_product_id, remove that product from quote and add new product (my_new_product) to order.

It will not be from observer, since I will need to add a button to call this action and do the job.

I have successfully added a button and linked to my custom controller.

I have gone through loads of links, but no luck.

Please suggest.


texts: Customize Billing Address List in Magento 2

texts:
Below is list.html file for Billing address.
Which contains dropdown with addressOptions.

 1)">
    <select class="select" name="billing_address_id" data-bind="
    options: addressOptions,
    optionsText: addressOptionsText,
    value: selectedAddress,
    event: {change: onAddressChange(selectedAddress())};
"></select>

I want to use radio button instead of drop-down then how can i achieve?
Or how can i print addressOptions in html file with Knockout Js?


texts: "Pending Payment" status for Check/Money Order payment method

texts: Is it possible to change the default status of the order at any stage of the processing to "Pending Payment" if the payment method selected is "Check/Money Order"?


texts: I'm looking for plugin that send invoice automatically when order is in status completed.


texts: magento2- custom categorycontroller not overriding

texts:
Unable to override Magento\Catalog\Block\Product\ListProduct

etc\frontend\di.xml

<?xml version="1.0"?>
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Catalog\Block\Product\ListProduct" type="Vendor\Module\Block\Catalog\Product\ListProduct" />
 </config>

\Vendor\Module\Block\Catalog\Product\ListProduct.php

namespace Vendor\Module\Block\Catalog\Product;

use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\Catalog\Model\Category;
use Magento\Catalog\Model\Product;
use Magento\Eav\Model\Entity\Collection\AbstractCollection;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\DataObject\IdentityInterface;
class ListProduct extends \Magento\Catalog\Block\Product\ListProduct
{
   public function __construct(
    /*passing all Constructors parameters to the parent class */
    \Magento\Catalog\Block\Product\Context $context,
    \Magento\Framework\Data\Helper\PostHelper $postDataHelper,
    \Magento\Catalog\Model\Layer\Resolver $layerResolver,
     CategoryRepositoryInterface $categoryRepository,
    \Magento\Framework\Url\Helper\Data $urlHelper,
    /*passing all Constructors parameters to the parent class */

    \Vendor\Module\Helper\Data $tglssearchHelper,
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $catalogResourceModelProductCollectionFactory,
    \Magento\Catalog\Model\Config $catalogConfig,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    array $data = []
) {
    $this->tglssearchHelper = $tglssearchHelper;
    $this->catalogResourceModelProductCollectionFactory = $catalogResourceModelProductCollectionFactory;
    $this->catalogConfig = $catalogConfig;
    $this->storeManager = $storeManager;

      parent::__construct(
        $context,
        $postDataHelper,
        $layerResolver,
        $categoryRepository,
        $urlHelper,
        $data
    );
    //$this->tglssearchHelper = $tglssearchHelper;
}

 protected function _getProductCollection()
{
    echo 'getproducolle';
    ....
}
}

Magento core _getProductCollection() is executing.
I have cleared var/generation.

My di.xml is under /etc/frontend


texts: 'Not valid template file' error when printing invoice programatically

texts:
I'm trying to find a way to print an order's invoice programatically. For that I tried to get the url that Magento uses in backend to print an invoice but it didn't help as it uses a key that I couldn't find a way to retrieve it.
I'm now trying another solution, is to code a controller function that renders the invoice pdf :

public function printOrderAction() {

        $order_id=json_decode( $this->getRequest()->getParam('order_id'));

        $orderObject = Mage::getModel('sales/order')->load($order_id);

        $invoiceCollection = $orderObject->getInvoiceCollection();
        foreach($invoiceCollection as $inv) {
            $invoice = $inv;
        }

        $pdf = Mage::getModel('sales/order_pdf_invoice')->getPdf(array($invoice));
        $this->_prepareDownloadResponse('invoice'.Mage::getSingleton('core/date')->date('Y-m-d_H-i-s').'.pdf', $pdf->render(), 'application/pdf');
    }

This function, when triggering it, gives that error Not valid template file:frontend\base\default\template\payment/info/pdf/checkmo.phtml

Is there any solution for that error? Or perhaps that there is an other simpler way to get the order's invoice ?


texts: Where block template for email is located

texts:
I found in an old Magento 1.3 installation following code in an email template:

{{block type="symmetrics_impressum/impressum" value="emailfooter"}}

It works and this snippet implement my imprint in system-emails. But I have no idea, where emailfooter is located. I need this for transfer in a new system. Can anybody explain, how type and value works?


texts: Magento 2.1 REST API adding simple product with attribute set results in bad request reponse

texts:
I have configurable product added, sku KudosConfig. I have added an attributes called kudos_size and kudos_colour which have values of Small, Medium, Large and Green, Pink, Orange respectively.
The next step, I thought, was to add the 9 simple products with appropriate attribute value set for both kudos_size and kudos_colour. To do this I am using the following request:

   PUT https://example.com/rest/V1/products/KudosConfigGreenSmall

The body of the request is:

{
  "product":{
    "sku":"KudosConfigGreenSmall ",
    "name":"Kudos Configurable Green Small",
    "price":30.00,
    "status":0,
    "type_id":"simple",
    "attribute_set_id":4,
    "weight":1,
    "custom_attributes":[
      {
        "attribute_code":"kudos_colour",
        "value":"Green"
      },
      {
        "attribute_code":"kudos_size",
        "value":"Small"
      }
    ]
  }

This however returns a http 400 bad request response with message:

  Error occurred during "custom_attributes" processing. Attribute "kudos_colour" has invalid value. Invalid type for value: "Green". Expected Type: "int".

I don't understand why it is expecting an integer, all the values in the setup are strings.


texts: How to migrate WooCommerce to Magento 2?

texts:
I would like to migrate all data as possible to my Magento 2, I wish a module, code snippet or step-by-step tutorial.

It will be very useful, thank you!


texts:
I am getting PHP Vulnerabilities notification and it is showing critical.

  Reminder on PHP VulnerabilitiesMS-ISAC has issued an alert related to
  multiple vulnerabilities that could allow for arbitrary code execution
  and a recommendation that all sites using PHP should update to the
  latest PHP version ASAP. Since Magento Commerce relies on PHP, we
  recommend that all Merchants using Magento Commerce review necessary
  updates for PHP with their hosting provider by September 30 in order
  to mitigate the vulnerability. Magento Commerce customers using our
  cloud infrastructure may redeploy at any time now to take advantage of
  the latest patches (ahead of our previously stated start date of
  September 19).

This link is set on read more: https://support.magento.com/hc/en-us/articles/360033561271-Magento-Recommendations-for-PHP-Vulnerabilities

Can anyone help me apply this PHP patch please, what patch do I need to apply and how can I apply it?

Magento Version: 2.2.5
OS: Ubuntu
PHP Version: 7.1.24
PHP-FPM is also used
Web server: nginx


texts: Magento 2 add product created at date to filter product in admin grid

texts: I want to filter products by date in the admin product grid. Is there any help will be appreciated.


texts: Hi, I'm trying to display a normal message if one payment method is selected in Magento 1.9

texts:
I'm trying to display a normal message if one payment method is selected in Magento 1.9
can any one help me on that? especially the locations of the files to edit?


texts: Override customer sales order history template not working

texts:
I want to override sales order history for customer in frontend like this:

app/code/Test/SuccessPage/view/frontend/layout/sales_order_history.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="customer_account"/>
    <body>
        <referenceContainer name="content">
          <referenceBlock name="sales.order.history.extra.containe">
              <action method="setTemplate">
                  <argument name="template" xsi:type="string">Test_SuccessPage::order/history.phtml
              </action>
          </referenceBlock>
        </referenceContainer>
    </body>
</page>

app/code/Test/SuccessPage/view/frontend/templates/order/history.phtml

<h1> This is a test page </h1>

unfortunately the above code doesnt work at all, it still load the vendor history.phtml


texts:
I'm doing a admin module, but I do not get module tab appears in admin menu.

Here is my config.xml inside Company/LeadPEC/etc/config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <company_leadpec>
      <version>0.1.0</version>
    </company_leadpec>
  </modules>
  <global>
    <helpers>
      <leadpec>
        <class>Company_Leadpec_Helper</class>
      </leadpec>
    </helpers>
  </global>
  <admin>
    <routers>
      <leadpec>
        <use>admin</use>
        <args>
          <module>Company_LeadPEC</module>
          <frontName>leadpec</frontName>
        </args>
      </leadpec>
    </routers>
  </admin>
  <adminhtml>
    <menu>
      <leadpec translate="title" module="LeadPEC">
        <title>Company LeadPEC</title>
        <sort_order>100</sort_order>
        <action>admin_leadpec/adminhtml_leadpec</action>
      </leadpec>
    </menu>
    <acl>
      <resources>
        <admin>
          <children>
            <leadpec translate="title" module="LeadPEC">
              <title>Company LeadPEC</title>
              <sort_order>100</sort_order>
            </leadpec>
          </children>
        </admin>
      </resources>
    </acl>
</config>

Here is my controller in Company/LeadPEC/controllers/Adminhtml/LeadpecController.php

class Company_Leadpec_Adminhtml_LeadpecController extends Mage_Adminhtml_Controller_Action
{
        protected function _initAction()
        {
                $this->loadLayout()->_setActiveMenu("leadpec/leadpec")->_addBreadcrumb(Mage::helper("adminhtml")->__("Leadpec Manager"),Mage::helper("adminhtml")->__("Leadpec Manager"));
                return $this;
        }
        public function indexAction()
        {
                $this->_title($this->__("Leadpec"));
                $this->_title($this->__("Manager Leadpec"));

                $this->_initAction();
                $this->renderLayout();
        }
}

Helper in Company/LeadPEC/Helper/Data.php

<?php
class Company_Leadpec_Helper_Data extends Mage_Core_Helper_Abstract
{
}

app/etc/modules/Company_LeadPEC.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Company_LeadPEC>
      <active>true</active>
      <codePool>local</codePool>
      <version>0.1.0</version>
    </Company_LeadPEC>
  </modules>
</config>

Thank you!


texts: Does a cron job with no schedule ever fire?

texts:
Consider this in crontab.xml which I've found in a third party plugin...

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<group id="default">
    <job name="the_job_name" instance="Vendor\Name\Cron\Order\Retry" method="execute" />
</group>

So it has no <schedule> element. Will it ever fire?


texts: How to write Curl code to Magento 2 code

texts:
This is my curl code. How to write the same in Magento 2

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);

if($method == 'POST') {

curl_setopt($ch, CURLOPT_POSTFIELDS,$data);

}

curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Accept: application/json', 'Authorization:'.$key ));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
$result = curl_exec($ch);
curl_close($ch);
return json_decode($result);

Please help.


texts:
Does anyone know how we can add new custom button beside Addtocart button on product page.
The button I can add custom link, any help or suggestions would be greatly appreciated!

I tried How to add a custom button to Magento 2 product page but doesn't help alot


texts: How to get different image sizes in WYSIWYG editor?

texts:
I'm trying to get some responsive images working on my store using the srcset attribute and I figured one of the simplest way to do so was getting a large and a small version of the image in the backend, the problem is that the {{media url=""}} markup tag returns the URL to the full size image.

Is there a way to resize the image from the editor? Something equivalent to the resize function?

The idea is to have something like:

<img src="{{media url="wysiwyg/image.jpg"}}" srcset="{{media url="wysiwyg/small.jpg"}} 640w, {{media url="wysiwyg/large.jpg"}} 1200w" alt="" />

Without having to upload the same image 3 times


texts: Magento 2.1.7 - how to include js on just the homepage

texts:
I'm trying to add a counter to my Magento homepage that only starts counting when it's visible on the screen. I have got the counter to work with jquery.appear.js and now want to implement it on my Magento 2.1.7 site. I will place all of this code in a custom block and add it to the homepage.

                [SMILEY IMG]
%
Satisfaction

Is this correct?
I want it to only be included on the homepage but it seems like this will make it available sitewide.
I read in another post that they also had to include it in their requirejs-config.js file, does this not need that step?


texts: AWS ami STACK server FTP permission denied Error:File transfer failed

texts:
I have create one server AWS ami STACK then i have connect FTP with user and file but i have not upload any file in server
Error:  /var/www/magento/dev/index123.php: open for write: permission denied
Error:  File transfer failed


texts: I know Magento 1.9 does not support php 7 however is there any version of the Magento database repair tool that would work with Magento 1.9 on php 7 server? I believe our magento database is corrupt and until we migrate to 2.2 we need to fix this current sites database.


texts: Cannot see Browse image option in magento 1

texts:
I am using magento 1.9.2.0
I cannot see Browse option to add images. What can be the issue.
See https://prnt.sc/rapqp5
However, i can see the option in Magento 1.9.4.4.


texts: Magento 2: Any concern to share generated folder across containers?

texts:
We are running Magento on Kubernetes, so every time we have some more traffic new pods/containers scale up and down multiple times a day.

We are seeing some weird things happening and it seems like the generated folder should be shared across containers.
We build the image used to bring the containers up, but it only contains the generated/metadata folder as we run di:compile as part of the docker image build.

We run the setup:upgrade on a separate container that we call post-deploy.

We are thinking about sharing the generated folder on EFS, is there any concern with this?
Thanks.


texts: Checking for attribute value existence. What does this do?

texts:
I got this code from here, and it works. There's a section of it that I don't quite get, however. Please see lines [A] and [B].

public function attributeValueExists($attCode, $attributeValue)
{
    $attributeModel = Mage::getModel('eav/entity_attribute');
    $attributeOptionModel = Mage::getModel('eav/entity_attribute_source_table') ;

    $attributeId = $attributeModel->getIdByCode('catalog_product', $attCode);    // [A]
    $attribute = $attributeModel->load($attributeId);    // [B]

    $attributeTable = $attributeOptionModel->setAttribute($attribute);
    $options = $attributeOptionModel->getAllOptions(false);

    foreach($options as $option) {
        if ($option['label'] == $attributeValue) {
            return $option['value'];
        }
    }

    return false;
}

The variable obtained from lines [A] and [B], $attributeTable, doesn't seem to be used. Yet, if I comment these two lines out, the code doesn't work. What are these lines actually doing and why do $attributeTable for?


texts: Admin to see Quantity change history of a product

texts:
Is there a way to show quantity change history by product in admin interface?

This is a very useful feature and is available in WMS solutions. We used in Solid Commerce for example, was very helpful.
I searched extensions but couldn't find something similar.

Any idea of something or custom code?

1.8.1
Tnx


texts:
If someone click add to cart in list view all is fine:
https://www.gruen-im-kraut.de/hochbeete-krauterspiralen/kraeuterspiralen.html

If someone click add to cart on detail page the product is not added to the cart:https://www.gruen-im-kraut.de/kraeuterspirale-komplett-set-110.html

This is shown in the var/log

[2017-02-21 10:37:41] main.CRITICAL: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2017-02-21 10:37:41] main.CRITICAL: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2017-02-21 10:37:41] main.CRITICAL: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2017-02-21 10:37:41] main.CRITICAL: Broken reference: the 'checkout.cart.item.renderers.gift-card.actions.gift_options' element cannot be added as child to 'checkout.cart.item.renderers.gift-card.actions', because the latter doesn't exist [] []
[2017-02-21 10:37:41] main.CRITICAL: Broken reference: the 'checkout.cart.item.renderers.gift-card.actions.gift_options' tries to reorder itself towards '', but their parents are different: 'checkout.cart.item.renderers.gift-card.actions' and '' respectively. [] []

Any idea why?

This is shown in the var/log

[2017-02-21 10:37:41] main.CRITICAL: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2017-02-21 10:37:41] main.CRITICAL: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2017-02-21 10:37:41] main.CRITICAL: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2017-02-21 10:37:41] main.CRITICAL: Broken reference: the 'checkout.cart.item.renderers.gift-card.actions.gift_options' element cannot be added as child to 'checkout.cart.item.renderers.gift-card.actions', because the latter doesn't exist [] []
[2017-02-21 10:37:41] main.CRITICAL: Broken reference: the 'checkout.cart.item.renderers.gift-card.actions.gift_options' tries to reorder itself towards '', but their parents are different: 'checkout.cart.item.renderers.gift-card.actions' and '' respectively. [] []


texts: How to filter product collection by attribute's admin option values?

texts:
I am currently developing a product configurator. I am submitting a form which sends the admin option values of my custom attributes via POST to a controller action. If I use the current store's attribute option labels all is working just fine, the product collection is filtered correctly and a simple product which is associated to a configurable product is returned.
Sadly I am using the admin values for form and URL generation because the default swedish store values contain too many special characters.

So my question is: how do I get the right product from my collection when using the admin option values or more specific, how do I get the admin option value's ID like using this for the default store's values:

$id = Mage::getResourceModel('catalog/product')
                                    ->getAttribute($key)
                                    ->getSource()
                                    ->getOptionId($value);

I already tried filtering by addStoreFilter(0), but that didn't work either. I already read that it could have something to do with flat tables being used in default store but not for admin, but I am rather unexperienced with Magento, so I don't really understand the difference using flat tables and what that really means.

Here is my last question concerning the filtering for reference:
addFieldToFilter doesn't return the right product for selected attribute values

Here is my getProduct() function:

public function getProduct($attributes)
    {

        Mage::Log($attributes);

        $productModel = Mage::getModel('catalog/product');

        //Get Product Collection
        $collection = $productModel->getCollection()

        //Filter for Selected Product
        $collection->addAttributeToSelect('status');
        $collection->addAttributeToSelect('doorconfig_enable');
        $collection->addAttributeToFilter('doorconfig_enable',array('eq' => 1));

        foreach ($attributes as $key => $value)
        {
            $collection->addAttributeToSelect($key);

            $id = Mage::getResourceModel('catalog/product')
                                    ->getAttribute($key)
                                    ->getSource()
                                    ->getOptionId($value);

            $collection->addAttributeToFilter($key,
                array(
                        'eq' => $id
                     )
            );

        }

        $selection = $collection->getSelect()->__toString();

        Mage::Log($selection);

        Mage::log($collection->getSize(),null,'custom.log');

        $product = $collection->getFirstItem();

        return $product;

    }


texts: Show div after delay on Magento 2 with JQuery

texts:
I need to show this div after 3 seconds on my page.

Tried using this but it's not working. Any help?


texts:
Deal with it,

In product list app/design/frontend/ThemeName/blank/template/catalog/product/list.phtml

i've got

getRatingSummary()) echo $this->getReviewsSummaryHtml($_product, 'short'); ?>

to see getReviewsSummaryHTML we need go deeper

app/design/frontend/ThemeName/blank/template/review/helper/summary_short.phtml

to see this

getRatingSummary()) echo $this->getReviewsSummaryHtml($_product, 'short'); ?>

My question is: How can i change url of review stars on products list to product page url?


texts: Magento 2: How to place order using REST api url via ajax

texts:
I want to create a order in Magento 2 using REST api url i.e. http://localhost/taleb_check/rest/default/V1/carts/mine/payment-information. When we click place order button then this url get calls using ajax in normal magento flow.

So I have created one custom page which consist one button on click of which I  want same functionality i.e. order placement.

Note : I have already all the required data which needs to place order in session.

Can any one please guide me.

So far I have created one js code which gets call using ajax request.

$('#place_order_button').click(function(){
        var param = 'ajax=1';
        var orderData = {
                            "billingAddress": {
                                "city": "Pune",
                                "countryId": "AU",
                                "customerAddressId": "1",
                                "customerId": "6",
                                "firstname": "user",
                                "lastname": "name",
                                "postcode": "1234",
                                "region": "New",
                                "regionCode": "NSW",
                                "regionId": "513",
                                "saveInAddressBook": null,
                                "street": {
                                    "0": "Pune",
                                    "telephone": "9876543210"
                                }
                            },
                            "cartId": "81",
                            "paymentMethod": {
                                "additional_data": null,
                                "method": "casho",
                                "po_number": null
                            }
                        };
        $.ajax({
            showLoader: true,
            url: "http://localhost/taleb_check/rest/default/V1/carts/mine/payment-information",
            data: orderData,
            type: "POST",
            dataType: 'json'
        }).done(function (data) {
            console.log(data);
        });
    });

But its not working can any one please point where I am making mistake.


texts: Memory Limit difference between PHPINFO and Readiness Check!

texts:
when I execute phpinfo() it says 2000M, but when i run Readiness Check it give me 128M... what I have to do?

I don't understand where it takes this value, is there any way to skip this check? I tried to edit the PhpReadinessCheck.php file but it doesn't work, maybe I have to refresh something?


texts: how to change filtered navigation list into a dropdown

texts:
Hi all how can i change a list of attributes from filtered navigation into a dropdown menu?
Does not seem to be a standard option in the attributes field?

im using rwd template.
many thanks
Chris


texts: Magento 2 Open minicart when item is added

texts:
I have a relatively stock minicart implementation, and I wanted to know if there is a configuration option or some other way of setting up the mini cart to drop down (open) when an item is successfully added to your cart on the frontend

Current behavior is the item count updates, but the minicart dropdown stays closed. Thanks!


texts:
I have a requirements to notify the admin through email when a product quantity goes below 5 in Magento 2.0.7.

I have found that there is option on the admin:

System > Configuration > Catalog > Inventory > Product Stock Options section

But setting the Notify for Quantity Below to 5 is not sending any emails to admin when an order is placed.

Please let me know what I am missing here.


texts:
I am using popup for write a review in product detail page. If I am using
{
    "[data-role=product-review-form]": {
        "Magento_Ui/js/core/app": <?= /* @noEscape */ $block->getJsLayout() ?>
    },
    "#review-form": {
        "Magento_Review/js/error-placement": {},
        "Magento_Review/js/validate-review": {}
    }
}
</script>

then success message shows on homepage inplace of product detail page.
Now I checked and found to replace init with mage validation so I used

<script type="text/javascript">
            require([
                'jquery',
                'mage/mage'
            ], function($){
                var dataForm = $('#review-form');
                dataForm.mage('validation', {});
                });
        </script>```

then only one rating validation is working but I have three rating. It submits the form even if I didn't select the rating stars
Any idea how to resolve this issue.


texts: Magento 2.1 override the view.xml file and see changes on site

texts:
I'm pretty new to Magento 2.1 and am trying to figure out how the themes work. I've read through a lot of the documentation, but what I'm having trouble with right now is the view.xml file in my own theme.

I've created a custom theme and installed it in the right location:

/siteroot/app/design/frontend/mybusiness/mytheme

All of that is working, and I was able to enable my theme just fine via the Magento admin. Now, I'm trying to modify my theme. I should probably point out that I'm using the Magento/luma theme as my parent theme and only plan on modifying some of the templates and styles.

I copied the view.xml file from the luma theme (/siteroot/vendor/magento/theme-frontend-luma/etc/view.xml) and pasted it into the following location:

/siteroot/app/design/frontend/mybusiness/mytheme/etc/view.xml

Now I'm trying to make changes to it and see those changes on the site. There's a block of code in it that appears to handle the way the product image gallery handles image transitions:

<var name="fullscreen">
    <var name="nav">thumbs</var> <!-- Fullscreen navigation style (false/thumbs/dots) -->
    <var name="loop">true</var> <!-- Fullscreen navigation loop (true/false/null) -->
    <var name="arrows">true</var> <!-- Turn on/off arrows on the sides preview in fullscreen (true/false/null) -->
    <var name="caption">false</var> <!-- Display alt text as image title in fullscreen(true/false) -->
    <var name="navdir">horizontal</var> <!--Sliding direction of thumbnails in fullscreen(horizontal/vertical)  -->
    <var name="navarrows">false</var> <!-- Turn on/off on the thumbs navigation sides arrows(true/false) -->
    <var name="navtype">slides</var> <!-- Sliding type of thumbnails (slides/thumbs) -->
    <var name="transition">
        <var name="effect">dissolve</var> <!-- Sets transition effect for slides changing (slide/crossfade/dissolve) -->
        <var name="duration">500</var> <!-- Sets transition duration in ms -->
    </var>
</var>

I changed the transition effect from slide to dissolve, then checked one of the products to see if the effect would show up in the gallery, but it still only shows the slide effect. I've enable developer mode already on the site using the command line function:

>magento deploy:mode:set developer

So, I'm kind of stumped as to the way I should go about creating and testing my customized theme. Any help would be appreciated.


texts: Category-selector in Cart Price Rules freezes

texts:
I have only barely used the CPR before, but I seem to remember it working fine. Now I'm set to enter some discount codes, but don't want them to apply to sales items.
I figure I could solve this by either setting the Special Price attribute to be used in CPR. Or put them into a separate category and filter that.

Problem is; whenever I try to select a category, the entire page freezes. And I can never get any filters for attributes. (See screenshots).

Anyone got any ideas as to why these may crash?

M 2.2.4

enter image description here

Edit: I see this is an official bug:

https://github.com/magento/magento2/issues/15121


texts:
I am trying to make anew Theme for Magento 2 but I can't find the skin folder ?? or where I can edit my the theme CSS.

here my new theme structure

TestVender/
└── TestTheme
    ├── etc
    ├── media
    │   └── TestPreview.jpg
    ├── registration.php
    ├── theme.xml
    └── web
        ├── css
        ├── images
        └── js


texts: Magento2 - Move coupon code section inside or before shipping method section

texts: I am using Magento2.3.3 And I want to move coupon code section before shipping method using checkout_index_index.xml.


texts: Want to create dynamic field configuration with dropdown

texts: I want to create dynamic field configuration with dropdown , can anyone help me on this.


texts: Ckfinder, fileupload - You don't have permission to access this resource

texts: When im trying to upload a image though ckeditor im i getting "You don't have permission to access this resource" anyone knows how to bypass this?


texts:
At the moment I have use /async/bulk/V1/products bulk Endpoint to import my products.
It is possible to create my own bulk API Endpoint with my custom logic?
thx


texts: Magmi truncating German text (Special Characters)

texts:
I am importing some attributes in German and also exported the file as CSV with UTF-8. It is truncating some of the German words.

Content of CSV -

header - sku,affiliate_category_de,type,attribute_set

Text which is getting Truncated -

"Wohnen & Lifestyle > Büro - Getting truncated to - Wohnen & Lifestyle > B"

"Wohnen & Lifestyle > Bar & Küche - Getting truncated to - Wohnen & Lifestyle > Bar & K"

"Geschenke > Für Kinder - Getting truncated to - Geschenke > F"

These values are prepoulated in a Global dropdown attribute.

Please advise


texts: After update Magento 2.3.5 to 2.4.2 on all category pages error: Exception #0 (RuntimeException): Catalog Layer has been already created. How fix?

texts:
After updating the version, I started getting on all category pages this error: Exception #0 (RuntimeException): Catalog Layer has been already created

This is error in: vendor/magento/module-catalog/Model/Layer/Resolver.php
 /**
 * Create Catalog Layer by specified type
 *
 * @param string $layerType
 * @return void
 */
public function create($layerType)
{
    if (isset($this->layer)) {
        throw new \RuntimeException('Catalog Layer has been already created');
    }
    if (!isset($this->layersPool[$layerType])) {
        throw new \InvalidArgumentException($layerType . ' does not belong to any registered layer');
    }
    $this->layer = $this->objectManager->create($this->layersPool[$layerType]);
}

$layerType = 'category' from vendor/magento/module-catalog/Controller/Category/View.php
 /**
 * Category view action
 *
 * @throws NoSuchEntityException
 */
public function execute()
{
    $result = null;

    if ($this->_request->getParam(ActionInterface::PARAM_NAME_URL_ENCODED)) {
        return $this->resultRedirectFactory->create()->setUrl($this->_redirect->getRedirectUrl());
    }
    $category = $this->_initCategory();
    if ($category) {
        $this->layerResolver->create(Resolver::CATALOG_LAYER_CATEGORY);
        $settings = $this->_catalogDesign->getDesignSettings($category);

        // apply custom design
        if ($settings->getCustomDesign()) {
            $this->_catalogDesign->applyCustomDesign($settings->getCustomDesign());
        }

        $this->_catalogSession->setLastViewedCategoryId($category->getId());

        $page = $this->resultPageFactory->create();
        // apply custom layout (page) template once the blocks are generated
        if ($settings->getPageLayout()) {
            $page->getConfig()->setPageLayout($settings->getPageLayout());
        }

        $pageType = $this->getPageType($category);

        if (!$category->hasChildren()) {
            // Two levels removed from parent.  Need to add default page type.
            $parentPageType = strtok($pageType, '_');
            $page->addPageLayoutHandles(['type' => $parentPageType], null, false);
        }
        $page->addPageLayoutHandles(['type' => $pageType], null, false);
        $page->addPageLayoutHandles(['displaymode' => strtolower($category->getDisplayMode())], null, false);
        $page->addPageLayoutHandles(['id' => $category->getId()]);

        // apply custom layout update once layout is loaded
        $this->applyLayoutUpdates($page, $settings);

        $page->getConfig()->addBodyClass('page-products')
            ->addBodyClass('categorypath-' . $this->categoryUrlPathGenerator->getUrlPath($category))
            ->addBodyClass('category-' . $category->getUrlKey());

        return $page;
    } elseif (!$this->getResponse()->isRedirect()) {
        $result = $this->resultForwardFactory->create()->forward('noroute');
    }
    return $result;
}

But i can't found where loaded Category Layer too. I check this issue in Google and i found this issue, but without answer.
I have Amasty modules like Amasty_Shopby and required modules for him and after disabling this modules i am not getting this error. How can I fix this error without turning off these modules?
Please, help with this issue! Thanks!


texts:
I need to add the taxvat id into the order confirmation E-Mail but I can´t get it to work.
There is a block
{{var order.getBillingAddress().format('html')}}
and I´ve added
<br/>{{var customer.taxvat}}
right after that.

I would need this taxvat id below the adress or somewhere in it but it doesnt seem to work this way. I´ve made sure there is an id registered within this account but I just can´t fetch it.

Someone in here who has done this before?


texts: How do I make customer telephone number mandatory?

texts:
How do I make the customer contact telephone a mandatory field during the checkout process on the Magento 2.1.3?

Part of our service is to call the customer before the delivery is made to ensure someone is available to receive the items.


texts: How to find valid values for fields in the REST API

texts:
I have been searching for documentation regarding the REST API.

All I have found is the Swagger page. It gives a good overview but it doesn't provide any information about valid values for individual fields.
From what I have found there is no such documentation available.

How can I find out what values are valid for all different fields in the API?

Example:
For a POST to /V1/coupons (salesRuleCouponRepositoryV1), how do I find out what the valid values for "type" are and what they mean?


texts: Test if Block is rendered in EMail or in Page (by PHP code)

texts:
How is it possible to test whether a custom block (extends Mage_Core_Block_Template) is rendered in a HTML page or rendered in an email (transactional email template)? I want to do this in the PHP code of the block (in my case in recentproducts.phtml). It should look like

// recentproducts.phtml
if ($this->rendered_in() == 'page')
    echo('Foo.');
elseif ($this->rendered_in() == 'email')
    echo('Bar.');

The block
{{block someparam="some data" type="recentproducts/recentproducts" name="recentproducts_recentproducts" template="recentproducts/recentproducts.phtml"}}
is used in at CMS -> Static Blocks. I followed the tutorial Custom Block Development in Magento.

Magento Version 1.9.1.1


texts:
I have noticed a weird behaviour as some of the out of stock products display when using size filters, for example when I go to t-shirts category and specify a brand and a size I can see 5 t-shirts, but only 3 of them are available in the correct size. I checked the products and for both it says that the quality is 0 and stock availability is 'out of stock' which seems to be as expected. I made sure that the cache is clear and all the indexes are updated.

So I wonder if anyone faced this problem before and how can it be solved?


texts:
I want to re-index a single category in Magento 1.

The method given in this post is not working for reindexing categories

Is there a way to do it through code?


texts: unfortunately i did the "Run Compilation Process" function after the installation an extension when "Enable status" in magento.. now am getting fatal error in my site. how can i revert my old datas ? please give a suggentsion


texts: How to Insert German setup base price module in different list views

texts:
I have to use the German setup base price module, which is shown at the product view. I want to use it in all list views too.

The template, I am using, has a subprice.phtml, which is used for all product views (listing, grids, cart).
How can I manage to display the base price there too?


texts: Programatically add attribute sets Magento2

texts:
I need idea on how to create a script for adding bulk attribute sets and attributes in magento2?

This is the script i have tried:

AttributeSetupscript.php

<?php
 require __DIR__ . '/app/bootstrap.php';
 $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
 /** @var \Magento\Framework\App\Http $app */
 $app = $bootstrap->createApplication('AttributeSet');
 $bootstrap->run($app);

AttributeSet.php

<?php
use \Magento\Framework\App\Bootstrap;
//include('../app/bootstrap.php');
use Magento\Catalog\Api\CategoryRepositoryInterface;
class AttributeSet extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface
{
protected $_moduleDataSetup;
protected $_eavSetupFactory;

public function __construct(      //not sure if i can include construct here
    ObjectManagerInterface $objectManager,
    ModuleDataSetupInterface $moduleDataSetup,
    EavSetupFactory $eavSetupFactory,
) {

    $this->_objectManager = $objectManager;
    $this->_moduleDataSetup = $moduleDataSetup;
    $this->_eavSetupFactory = $eavSetupFactory;
}

public function launch()
{
    $eavSetup = $this->_eavSetupFactory->create([
                'setup' => $this->_moduleDataSetup
    ]);

    $defaultId = $eavSetup->getDefaultAttributeSetId(self::ENTITY_TYPE);

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    //$entityTypeId  = $objectManager->create('\Magento\Catalog\Model\Product');
    $entityTypeId = $objectManager->create('Magento\Eav\Model\Config')
                                    ->getEntityType(\Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE)
                                    ->getEntityTypeId();    // to get entity_type_id by entity_type_code

    $model = $objectManager->create('Magento\Eav\Api\Data\AttributeSetInterface')
                                    ->setId(null)
                                    ->setEntityTypeId(4)
                                    ->setAttributeSetName($name);

            $objectManager->create('Magento\Eav\Api\AttributeSetManagementInterface')
                            ->create(self::ENTITY_TYPE, $model, $defaultId)
                            ->save();
}

public function catchException(\Magento\Framework\App\Bootstrap $bootstrap, \Exception $exception)
{
    return false;
}

}

I get  Call to a member function sendResponse() on null in \Magento\Framework\App\Bootstrap.php on line 25

1) Is what i tried i construct() in scripts.

2) Or should i run InstallData Schmeas procedure.


texts:
i got this error:

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

How can i fix the database with the correct password


texts: How to change magento theme on refresh page?

texts:
Have multiple different theme in magento.
Is that possible to change or apply different theme on refresh page or resize browser?
Means there are installed 2 magento theme.
theme1 and theme2
default theme is theme1 but when refresh page its apply theme2
is this possible?
If have knowledge please help me for this customization.