texts: Magento 2 : Add discount label on product page (already in Category view)

texts:
Hi the Magento Community,

I would like to add a discount label on my pictures on my product pages : I already have one for each product on category page (see picture below) but not on product pages.

I took the code from the category, but I don't know where I should paste it and if it will work with fotorama.

My question is : Is it possible and which file I need to edit ?

Here is the code (I use Porto Theme) :

<?php
                        $product_label = "";
                        if($_product_label_config['sale_label']) {
                            $orgprice = $_product->getPrice();
                            $specialprice = $_product->getSpecialPrice();
                            $specialfromdate = $_product->getSpecialFromDate();
                            $specialtodate = $_product->getSpecialToDate();
                            $today = time();
                            if(!$specialprice)
                                $specialprice = $orgprice;
                            if($specialprice < $orgprice) {
                                if((is_null($specialfromdate) && is_null($specialtodate)) || ($today >= strtotime($specialfromdate) && is_null($specialtodate)) || ($today <= strtotime($specialtodate) && is_null($specialfromdate)) || ($today >= strtotime($specialfromdate) && $today <= strtotime($specialtodate))){
                                    if($_product_label_config['sale_label_percent']) {
                                        $save_percent = 100-round(($specialprice/$orgprice)*100);
                                        $product_label .= '
'.'-'.$save_percent.'%'.'
';
                                    } else {
                                        $product_label .= '
'.$_product_label_config['sale_label_text'].'
';
                                    }
                                }
                            }
                        }
                        if($_product_label_config['new_label']) {
                            $now = date("Y-m-d");
                            $newsFrom= substr($_product->getData('news_from_date'),0,10);
                            $newsTo=  substr($_product->getData('news_to_date'),0,10);

                            if ($newsTo != '' || $newsFrom != ''){
                                if (($newsTo != '' && $newsFrom != '' && $now>=$newsFrom && $now<=$newsTo) || ($newsTo == '' && $now >=$newsFrom) || ($newsFrom == '' && $now<=$newsTo)) {
                                    $product_label .= '
'.$_product_label_config['new_label_text'].'
';
                                }
                            }
                        }
                        if($product_label)
                            echo '
'.$product_label.'
';
                    ?>


texts:
Magento2 which table to store data like configurable product and associated related simple product and also in Magento1 which table to store data like configurable product and associated related simple product

Help will be appreciated.


texts: Get child category name from category id

texts:
I want to get the category name of Parent Category as well as Child Category. For this, I am checking if Category == Parent Category and storing Category name into an array. And If Category is a Sub or Child category I want to store its name as ParentCategoryName / ChildCategoryName.
For example: If Parent Category = Engine and Sub Category = Engine Pump so Category Name = Engine / Engine Pump
Below is my code:
foreach ($categories as $category){
        $thAttribute = $category->getThNewAttribute();

        if(($category->getParentId($category))==2){
            $categoryName[$category->getThNewAttribute()] = $category->getName();
        }else{
            $categoryName[$category->getThNewAttribute()] = $category->getParentCategory($category)->getName()."/".$category->getName();
        }
 }

I am getting the correct Category Name for Parent Category but for Sub or Child Category I am getting below error.

No such entity with id = 0

Which step I am doing wrong?


texts: Magento 2 Doesn't Support Dependency Injection in Traits?

texts:
Do traits actually work with dependency injection in Magento? Consider the following code:

Trait Class

namespace Frame\Slick\Block;
use Frame\Slider\Slick\Block\Data as Helper

trait Slick
{
   protected $_slickHelper;
   public function __construct(Helper $slickHelper)
   {
     $this->_slickHelper = $slickHelper;
   }
}

Class using the trait

namespace Frame\Slick\Block;

class Product ListProduct implements BlockInterface
{
   use Slick;
   public function testTrait()
   {
      return $this->_slickHelper->getHelloWorld();
   }
}

This seems to always return null, am very sure everything is being included properly. Can trait really support dependency injection?

EDIT:
For example if you do a di in the trait constructor and assign it to a trait variable and then called it on the class which uses the trait, it will always return null. Anything else works fine.


texts: How to set special price as final price in magento 2

texts:
I would like to setup the special price as a final price. In the current scenario, what happens, if the price columns is lesser than the special price, the price is taken as selling price.
WHY
There are instances, product price is revised on demand. In such cases, I would like to setup the special price slightly higher than the actual price.
I have been looking for a setting but, I dont find any. Is there a work around?


texts: Can't get Adwords and GTM Ecomm conversion firing on Magento 1.9

texts:
I've inserted the head and body GTM code provided by GTM, into Magento 1.9 using static blocks and widgets for arkmats.co.uk
Ideally don't want to use an extension as this is temporary until we migrate to 2.x
Wondering if I need the datalayer?
The GTM Tag Assistant shows the GA and GTM code but with the following errors:
GTM JavaScript code not found as a direct child of the  tag
GTM no-script code not found: either missing or not in
In the page view-source I can see the noscript at the top of the body. I sent the widget to Page Top.
But the  part is showing near the bottom of the body even though I told the widget to insert into the Header.
What am I doing wrong please?
Thanks
Chris


texts: How To Add Search By Category In Advanced Search in magento 2.3?

texts: How To Add Search By Category In Advanced Search in magento 2.3 ?


texts: Fallback for products which not exists in other storeview

texts:
We are running a Magento 1.9 multi store environment. Due to German regulations, we cannot offer a range of products in Germany, which brings us to an issue that we need to disable those products in the catalog of the German store view.

Now we have an issue that when a user switches from /en/product_a/ to /de/product_a/ the user gets a 404. Is there any solution to catch the identity of product_a and tell the user this product is not available in this store view but is available in other store views?


texts: How to set the value of select in admin config Magento2

texts:
I am creating multi-column config, the problem is it's only setting the value of the first select field, the second field is not being selected following is my code :

<?php
namespace Aayanshtech\Adminsection\Block\System\Config\Form\Field;

use Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray;

/**
 * Class Active
 *
 * @package Aayanshtech\Adminsection\Block\System\Config\Form\Field
 */
class Fields extends AbstractFieldArray {

    /**
     * @var bool
     */
    protected $_addAfter = TRUE;

    /**
     * @var
     */
    protected $_addButtonLabel;
    protected $_activation;
    protected $_sec_one_action;

    /**
     * Construct
     */
    protected function _construct() {
        parent::_construct();
        $this->_addButtonLabel = __('Add Option');
    }
    /**
     * Get activation options.
     *
     * @return \Magently\Tutorial\Block\Adminhtml\Form\Field\Activation
     */
    protected function _getActivationRenderer()
    {
        if (!$this->_activation) {
            $this->_activation = $this->getLayout()->createBlock(
                '\Aayanshtech\Adminsection\Block\Adminhtml\Form\Field\Activation',
                '',
                ['data' => ['is_render_to_js_template' => true]]
            );
        }

        return $this->_activation;
   }
   protected function _getActivationRenderer2()
   {
        if (!$this->_sec_one_action) {
            $this->_sec_one_action = $this->getLayout()->createBlock(
                '\Aayanshtech\Adminsection\Block\Adminhtml\Form\Field\Seconeaction',
                '',
                ['data' => ['is_render_to_js_template' => true]]
            );
        }

        return $this->_sec_one_action;
   }
    /**
     * Prepare to render the columns
     */
    protected function _prepareToRender() {
        $this->addColumn('field_1', ['label' => __('Distance')]);
        $this->addColumn('field_2', ['label' => __('Code')]);
        $this->addColumn('field_3', ['label' => __('Selection order')]);
        $this->addColumn('field_4', ['label' => __('Price')]);
        $this->addColumn(
            'field_5',
            [
                'label' => __('Type of price'),
                'renderer' => $this->_getActivationRenderer()
            ]
        );
        $this->addColumn(
            'field_6',
            [
                'label' => __('Action'),
                'renderer' => $this->_getActivationRenderer2()
            ]
        );
        $this->_addAfter       = FALSE;
        $this->_addButtonLabel = __('Add Option');
    }
    /**
     * Prepare existing row data object.
     *
     * @param \Magento\Framework\DataObject $row
     * @return void
     */
    protected function _prepareArrayRow(\Magento\Framework\DataObject $row)
    {
        $options = [];
        if($row->getData('field_5')){
            $customAttribute = $row->getData('field_5');
            $key = 'option_' . $this->_getActivationRenderer()->calcOptionHash($customAttribute);
            $options[$key] = 'selected="selected"';
            $row->setData('option_extra_attrs', $options);
        }
        if($row->getData('field_6')){
            $customAttribute = $row->getData('field_6');
            $key = 'option_' . $this->_getActivationRenderer()->calcOptionHash($customAttribute);
            $options[$key] = 'selected="selected"';
            $row->setData('option_extra_attrs', $options);
        }

    }

}

I got stuck _prepareArrayRow in this function what i want to achieve please see the screen shot.

Unable to set the value of action.


texts: I have send custom mail and set the custom variable but. When I access the variable in transaction mail template then it will not work

texts:
This is my email sending code

if (isset($_POST['send'])) {
    $templateId = 9;
    $sendername = 'Call To Order';
    $senderemail = $_POST['email'];
    $sendermobile = $_POST['mobile'];
    $sender = Array('name' => $sendername,
        'email' => $senderemail);
    //recepient
    $toEmail = 'test@gmail.com';
    $vars = Array();
    $vars = Array('email' => $senderemail, 'mobile' => $sendermobile);
    $storeId = Mage::app()->getStore()->getId();
    $translate = Mage::getSingleton('core/translate');
    Mage::getModel('core/email_template')
            ->sendTransactional($templateId, $sender, $toEmail, $vars, $storeId);
    $translate->setTranslateInline(true);
}
?>

this is my transnational email template

Email: {{var email}}

Mobile: {{var mobile}}

And I am getting this into my email


texts: M2.1.8 Category text appearing in 2nd column

texts: I am creating pages with text from Categories and have selected "2 columns with right bar" in the Design tab. However the text in the category is showing in the second column - see screenshot. I intend to add some more widgets in the right hand column so this is not the appearance I want. How do I make the text stop at the beginning of the 2nd column? I do not want to hack the core.


texts: How can i integrate Bootstrap template into magento

texts:
I need to integrate bootstrap template into magento,

Bootstrap template : http://obaju.ondrejsvestka.cz/


texts: Invoice to be sent after "Bank Transfer" transaction

texts:
I want to send invoice to customer after they place an order using the "Bank Transfer" method.

It only sends the invoice one the payment is "taken" but I want to send the invoice as soon as the order is placed. Any ideas?


texts: How to fire query in mysql? Can anyone explain addFieldToFilter?

texts:
I have tried

$get_default_metal = Mage::getModel('custompricing/metaloptionsenabled')->getCollection()
->addFieldToFilter('product_id', $product_id)
->addFieldToFilter('store_id',0)
->addFieldToFilter('status',1)
->addFieldToFilter('isdefault',1)
->addFieldToSelect('metal_id')
->addFieldToSelect('ring_sizer')
->getFirstItem();

=>

$sql = "select metal_id,ring_sizer from metal_options_enabled where store_id=0 and status=1 and isdefault=1";  Is this right?


texts: On the Product List in Admin, how can i change the text to a drop down or checkbox for easier product enabling and disabling?

texts:
Below is the view, i would like to make Enabled option as Dropdown or checkbox, that auto updates when changed.

Thanks for your help


texts: What is the use of using address in quote object while calculating total of cart(table: sales_flat_quote_address)

texts: Please explain why magento involve address while calculating grand total and other calculations while calling collectTotals() in saving cart.It involve table sales_flat_quote_address while interacting with sales_flat_quote


texts: How to change data-validate attribute of a field?

texts:
I have a following form

<form name="addForm" method="POST" enctype="multipart/form-data" action="someurl" data-hasrequired="<?php echo __('* Required Fields') ?>" data-mage-init='{"validation":{}}'>
<select id="sel1" name="sel1" data-validate="true"></select>
<select id="sel2" name="sel2" data-validate="false"></select>
<button name="btn-ex" type="submit" title="<?php echo __('Submit') ?>" class="action submit primary">
                                    <?php echo __('Submit') ?>
                                </button>
</form>

I'm filling #sel1 and #sel2 using jquery with default selected to "blank".
Now when user changes #sel1 then I want #sel2 to be required.
When I change #sel2 attribute data-validate="true" and reload the page, it works, but I need that on change of #sel1.
I wrote following jQuery on change method.

$('#sel1').change(function(){
                if($(this).val!="" || $(this).val!="0.00"){
                    jQuery('#sel2').attr('data-validate','{required:true}');
                }
                else{
                    jQuery('#sel2').attr('data-validate','{required:false}');
                }
            });

The jQuery code works and changes the attribute value of #sel2 but on click of Submit it doesn't validate.


texts:
I discover that some native route are listed in the section xml file without any section :

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="customer/account/logout"/>
    <action name="customer/account/loginPost"/>
    <action name="customer/account/createPost"/>
    <action name="customer/account/editPost"/>
    <action name="customer/ajax/login">

    </action>
</config>

In this case the SectionConfigConverter.php will add '*' to signify all sections need to be reloaded. But when one of this route are used, magento try to reload this sections and I got :

  "*" section source is not supported

It doesn't seem that the native code is able to deal with the '*' it has added itself.
Have you already encounter/resolve this bug ?

Thank you in advance


texts:
i tried  below code :

$helper = Mage::helper('catalog/product_view')->getvalofk('Mark');

i get result but when i call it dynamically like

$helper = Mage::helper('catalog/product_view')->getvalofk('.$_REQUEST["id"].');

or

$helper = Mage::helper('catalog/product_view')->getvalofk("'.$_REQUEST["id"].'");

i am doing some syntax mistake. what am i misisng here ?....

 public function getvalofk($code)
    {
        $_option = array(
            'Blush Opaque'  => array(
                'option' => array(
                    'Turquoise',
                    'Pearl',
                    'Lapis'
                ),
                'price' => 0

            )

            ,
            'Blush Vitreous'  => array(
                'option' => array(
                    'Peridot',
                    'Amethyst',
                    'Blue Topaz',
                    'Smoky Quartz',
                    'Citrine'
                ),
                'price' => 0
            ),
           );

        return $_option[$code];
    }


texts: New Magento 2 install very slow on both Windows and Ubuntu

texts:
I installed Magento 2.0.4 (composer) on Windows 10. Pages take up to 10 seconds or more to load.
I tried several solutions published here to speed up the loading process on WAMP environments but none of them worked.

Then I set up an Ubuntu virtual machine (on Windows 10 host) to check whether the issue was caused by Windows. I installed Magento 2.0.4 again on this virtual machine and the result is the same: 10 seconds to load pages.

Processes summary:

Windows - when loading a page the Apache process uses up to 50% CPU. I noticed that two apache process are running. However only one seems active (50%) when the page loads, the other one is at 0%.

Ubuntu - when loading a page the only 2 process showing activity are firefox 5% and gnome-shell up to 30%, however in the "Resources tab" the CPU usage goes to 100% and stays there until the page is fully loaded, then goes down to normal levels (15% - 20%).

I'm developing a new theme so I delete pub/static/ and var/view_preprocessed folders on a regular basis to see my changes. Just after deleting this folders, the loading time is 10 seconds or more (i think because of the recompiling process). Subsequent loading of pages takes a little less (6 - 8 seconds).

I've tested enabling/disabling cache but that makes no difference.


texts:
I would like that my menu in the navigation is totally expanded. My structure is now

Category 1

Sub cat A
Sub cat B

Category 2

Sub cat A
Sub cat B

Category 3

Sub cat A
Sub Cat B

Now, when I open the menu, I have :

Category 1
Category 2
Category 3

I can then open them one at a time and have

Category 1

Sub cat A
Sub cat B

Category 2
Category 3

How should I do to see the full tree opened when I open the menu?

Thanks


texts: Magento2: Get collectionFactory query in Single

texts:
I have below collectionFactory

  $collection = $this->collectionFactory->create()->addFieldToFilter('status', ['neq' => 'Disable']);

  $collection->getSelect()->joinLeft(
        ['ce' => 'customer_entity'], "main_table.user_id = ce.entity_id", [
    'CONCAT(ce.firstname," ", ce.lastname) as user_name',
    'ce.email'
        ]
  )->order('id DESC')->limit(5);

  echo $collection->getSelect()->__toString();
  exit;

Above is working fine.

But when i'm trying to do

  $collection = $this->collectionFactory->create()->addFieldToFilter('status', ['neq' => 'Disable'])->joinLeft(
        ['ce' => 'customer_entity'], "main_table.user_id = ce.entity_id", [
    'CONCAT(ce.firstname," ", ce.lastname) as user_name',
    'ce.email'
        ]
  )->order('id DESC')->limit(5);

It gives error

  Call to undefined method
  Custom\Module\Model\ResourceModel\Post\Collection::joinLeft()

Why there is need to use getSelect()? I think getSelect() will get previous defined collection query. So it will carry forward that on.

We can't to collectionFactory in Single?, we have to get & then proceed further?


texts: Magento 2 - Command returned non-zero exit code: when try to change to production mode

texts:
when i run php bin/magento deploy:mode:set production or

php -d memory_limit=768M bin/magento deploy:mode:set production

I received the following error, how can i fix it?

Config "dev/debug/debug_logging = 0" has been saved.
Starting compilation
Something went wrong while compiling generated code. See the error log for detai                                                                                ls.
Disabling maintenance mode
Command returned non-zero exit code:
`/opt/cpanel/ea-php71/root/usr/bin/php -f /home/xxxxxx/public_html/bin/mage                                                                                nto setup:di:compile`

[2019-05-18 06:02:04] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":["interception","CONFIG"],"mode":"matchingTag"}} []
[2019-05-18 06:02:09] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":["interception","CONFIG"],"mode":"matchingTag"}} []

[2019-05-18 06:02:19] main.ERROR: /opt/cpanel/ea-php71/root/usr/bin/php -f /home/myusername/public_html/bin/magento setup:di:compile 2>&1
Compilation was started.
%message% 0/7 [>---------------------------]   0% < 1 sec 62.0 MiB%message% 0/7 [>---------------------------]   0% < 1 sec 62.0 MiBProxies code generation... 0/7 [>---------------------------]   0% < 1 sec 62.0 MiB
Proxies code generation... 1/7 [====>-----------------------]  14% < 1 sec 64.0 MiB
Repositories code generation... 1/7 [====>-----------------------]  14% < 1 sec 64.0 MiB [] []


texts: how to Override Magento\Framework\View\Element\Html\Link\Current File in Magento 2

texts:
Problem

I want to add an attribute to current link in Magento 2 Customer Dashboard i Checked Magento\Framework\View\Element\Html\Link\Current, there in Line 119 All the Link Having an Li have a function $this->getAttributesHtml() by which all none current link can assigned an HTML attribute passed from XML

Now the current link hasn't assigned $this->getAttributesHtml()  that why the attribute passed through XML is Not assigned to current link

I tried to Override Current Class as Follows

  etc\frontend\di.xml

 <preference
    for="Magento\Framework\View\Element\Html\Link\Current"
    type="Vendor\Module\View\Element\Html\Link\Current" />

  Vendor\Module\View\Element\Html\Link\Current

Changed this Condition

    if ($this->isCurrent()) {
        $html = '
';
        $html .= ''
            . $this->escapeHtml(__($this->getLabel()))
            . '';
        $html .= '
';
    }

To

    if ($this->isCurrent()) {
        $html = '
';
        $html .= 'getAttributesHtml() .'>'
            . $this->escapeHtml(__($this->getLabel()))
            . '';
        $html .= '
';
    }

If I make a change in Core File I works Fine But in Overridden Class
Its Now Working

Need Help


texts:
I'm trying to adapt a module from prestashop to Magento. In this module my page is calling a script js with angular.js then the script himself have some function to interact from the controller who's getting a function from a class.

so i have in my phtml (the code is still for Prestashop for the moment):

                {{ descReplace.toreplace }}	  //this is the calling of angular js
                {{ descReplace.replaceby }}	  //this is the calling of angular js

then in my js script i have

$scope.getDescReplaces();

in my controller i have

public function ajaxProcessGetDescReplaces()
    {
        die(Tools::jsonEncode(array(
            'descReplaces' => getAll()
        )));
    }

and finally in my class i have

public function getAll(){
    $data = array();
    $model = $this->contactFactory->create();
    $newData = $model->getCollection();
    foreach ($newData as $d )  {
        echo $d->getToreplace();
        echo $d->getReplaceby();

    // the base code was   return Db::getInstance()->executeS('SELECT * FROM `my table');
    }

i know it's not very clear but can someone help me pls to adapt the code to link the controller to the block so he can get the getAll() function.


texts:
is anyone have an idea about how is luma theme is setup as a default theme in fresh installation of magento 2?

is there set from file or from admin setting?
In content-configuration its said that "If no value is specified, the system default is used. The system default may be modified by third party extensions."
but where this theme has defined for make them default?


texts: Create a block with a template in my own module

texts:
I am attempting to create a block with a template in my own module.  When I come to view the website (front end) I get an HTTP 500 error (admin side still loads). I have checked in the var/log folder for any debug or system messages but none are reported. Disabling the module allows the website to load again.

Below are the steps, along with file directories and file content for what I have done.

My Magento 2 main directory is StoreTest

Registering a module (I successfully did this stage but I will include it for clarity)

Created module.xml and registration.php in the following folders.

StoreTest/Code/Mymodules/Mybanner/etc/module.xml
StoreTest/Code/Mymodules/Mybanner/registration.php

Module.xml content

    <?xml version="1.0"?>

    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
        <module name="mymodules_mybanner" setup_version="1.0.0"/>
    </config>

Registration.php content

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'mymodules_mybanner',
    __DIR__
);

Registered the module (by logging into the server using PuTTy and navigating to the StoreTest/bin/ directory)

php magento module:enable mymodules_mybanner

Then I ran

php magento setup:upgrade

Create a Block, layout and template file.

To create a block I added a MyBlock.php file to the following location
StoreTest/app/code/Mymodules/Mybanner/Block/

MyBlock.php content

<?php

namespace Mymodules\Mybanner\Block;

class MyBlock extends \Magento\Framework\View\Element\Template
{
    /**
     * Return the HTML
     * @return string
     */
    public function getHtmlString()
    {
        return "Testing";
    }
}

I created a layout file called cms_index_index.xml in the following location
StoreTest/app/code/Mymodules/Mybanner/view/frontend/layout/

cms_index_index.xml content

<?xml version="1.0"?>

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">

        <referenceContainer name="main">
           <block class="Mymodules\Mybanner\Block\MyBlock" name="mybanner.example" template="banner.phtml" >
                <action method="getHtmlString" />
           </block>
        </referenceContainer>

</page>

Lastly I created a banner.phtml file in the following location
StoreTest/app/code/Mymodules/Mybanner/view/frontend/templates/

Banner.phtml content

<?php
/*
  * @var \Mymodules\Mybanner\Block\MyBlock $block
*/
?>

Howdy folks!

<?php echo $block->getHtmlString(); ?>

My folder structure looks like the following

StoreTest
|-- Mymodules
    |-- Mybanner
        |-- Block
        |    |--MyBlock.php
        |-- etc
        |    |--module.xml
        |-- view
        |    |-- frontend
        |         |-- layout
        |              |--cms_index_index.xml
        |         |-- templates
        |              |-- banner.phtml
        |-- registration.php


texts: Magento2 admin grid: SQL error when sorting by specific field

texts:
Database table columns are displayed in custom grid in adminhtml. One of the field has name 'precision' and this causes SQL error when I sort the grid by this field (as this is mysql reserved word and must be used like this: ORDER BY `precision` ASC

The question is: how to escape it or use an alias to avoid SQL error?

This field is defined in xml file like this:

    <column name="precision">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
            </item>
            <item name="config" xsi:type="array">
                <item name="editor" xsi:type="array">
                    <item name="editorType" xsi:type="string">text</item>
                    <item name="validation" xsi:type="array">
                        <item name="validate-digits-range" xsi:type="string">0-8</item>
                    </item>
                </item>
                <item name="filter" xsi:type="string">text</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Precision (0 - 8)</item>
                <item name="sortOrder" xsi:type="number">60</item>
            </item>
        </argument>
    </column>


texts: After migration can`t update product image

texts:
I migrated  Magento from 1.9.0.1 to 2.2.5.
After this migration I can't add new image for some products
Could you tell me what is wrong?


texts:
I've got a module in magento 1 - it stops certain products being listed depending upon a set of attributes.

For example if the user logs in and an customer attribute set with a value of 100, they would see all products with an attribute called "test" with the value of 100 and no others...

I'm looking at porting this functionality accross to magento 2, I was hoping for some pointers on where magento 2 does the category listing...

In magento 1 I extend the mage/catalog/model/category and add an addattributetofilter... along with a few others things...

Looking breifly at magento 2, I thought that I'd be able to duplicate the behaviour by overwriting/extending CollectionFilter in the namespace 'Magento\Catalog\Model\Layer\Category' yet anything I do here results in no results regardless of what I do.

Any tips/help would be great at the minute.


texts: Where can I find a list of features in Magento along with explanations?

texts:
For example, this link: https://info2.magento.com/rs/magentosoftware/images/magento-feature-list.pdf - has a great list of features, but without any explanation of what that feature is about.

For example, on page 2 of 10, what does "Minimum Advertised Price (MAP)" mean?  I'm looking for a resource which gives a 2-3 line description of what that feature is all about. Somethings are self-explanatory, but most could use some elaboration.


texts: Remove Css and js from new custom page_layout from header and body Magento 2

texts:
I have created a new Design Layout (named "blank") for select in page creation
in my theme i have these created.

  design/frontend/Vendor/Theme/Magento_Theme/layouts.xml

<?xml version="1.0" encoding="UTF-8"?><page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">

<layout id="blank">
    <label translate="true">Blank</label>
</layout>

  design/frontend/Vendor/Theme/Magento_Theme/page_layout/blank.xml

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<container name="root">
        <container name="main.content" htmlTag="main" htmlId="maincontent" htmlClass="page-main">
            <container name="columns" htmlTag="div" htmlClass="columns">
                <container name="main" label="Main Content Container" htmlTag="div" htmlClass="column main"/>
            </container>
        </container>
</container>

This make the option to appear on the admin select design when i add new page but when i check the source code i can see that everything is loaded in head ( css from other pages and js ) i want a clean layout and been able to add css via Layout XML update in admin.

all the selected code in the image should not be there

i am pretty new to this i would appreciate some help on what i am doing wrong.
Thank you.


texts: Get Product Options for each Product in the Catalog

texts:
I am trying to build a script that outputs all the product options for each product in the catalog into a CSV file.

I have tried using the code on this page: http://www.atwix.com/magento/configurable-product-attributes/

For this code:

$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'color');
foreach ($attribute->getSource()->getAllOptions(true) as $option) {
    echo $option['value'] . ' ' . $option['label'] . "\n";
}

I get no output, what-so-ever.

For this code:

$productAttributeOptions = $product->getTypeInstance(true)->getConfigurableAttributesAsArray($product);
$attributeOptions = array();
foreach ($productAttributeOptions as $productAttribute) {
    foreach ($productAttribute['values'] as $attribute) {
        $attributeOptions[$productAttribute['label']][$attribute['value_index']] = $attribute['store_label'];
    }
}

I get this error:

Fatal error:  Call to undefined method Mage_Catalog_Model_Product_Type_Simple::getConfigurableAttributesAsArray() in /home/tws2/public_html/getopts.php on line 71

Ive been unable to find anything else on the internet for getting at the product options of a product with PHP code.

Can someone please explain to me how to use PHP to get at all the product options data for each product in the catalog, so I can output all this data into a CSV file.

The purpose of this is to transfer the product options data over to an identical Magento server that has the same catalog, just missing the product options data. Once I have all the CSV file of product options I was going to make another script to write them into the identical Magento server. This is how Ive been advised to do this task in-house, if you have a better suggestion please let me know.


texts: Source for Magento 2.1.6 API documentation

texts:
We are using Magento 2.1.6 version for our e-commerce website, now the problem is I have to implement some new APIs for the logged in user but I am not able to find any API documentation for Magento 2.1.x versions. Every documentation on the website in either 2.2 or 2.3 version.

Please share if you have any reference to any of the API documentation for 2.1.x versions.

Thank you


texts: Show description of product in wish list phtml file

texts:
I want to get description of product in wishlist Page, I tried this code In list.phtml file but no luck .

<?php echo $_product->getDescription() ?>

EDIT

my code now look like this

<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product_id=$this->getItem()->getProduct()->getId();
$product = $objectManager->create('Magento\Catalog\Model\Product')->load($product_id);
?>
<strong class="product-item-description">
    <?php echo $block->escapeHtml($product->getDescription()) ?>
</strong>


texts: When working with Magento 2, sometimes we want to disable Payment methods on the Front page and use it only for Admin. Or, if we want to set more rules for Payment methods to check whether payment method can be used. How we can do that?


texts: Magento 2 - Get report of simple products inside bundle

texts:
In Magento 2 is there any way to get list of sold simple products that are included in bundles?
Now Magento shows bundle SKU in the exported report


texts:
I'm having an issue with some translations in Magento 2 2.3.0. My store is in french, most of the text works fine.

It seems that the problem occurs only with content that come from JS (AJAX and template).

Example:

View and Edit Cart

I have the same problem with the state/province in the shipping calculation, it's in the wrong locale.

If I check in js-translation.json, there's around 300 translations and "View and Edit Cart" is one of them. I don't know where does these translations come from, my translation CSV has +9k terms.

I tried switching between dev and prod mode to see if the generation changed, but same thing.

Also, between every attempt, I ran these commands

rm -rf var/generation/* var/di/* var/cache/* var/page_cache/*
var/view_preprocessed/* pub/static/*;
bin/magento setup:upgrade;
bin/magento setup:di:compile;
bin/magento setup:static-content:deploy --theme=[my theme] fr_CA -f;
bin/magento cache:flush;
bin/magento indexer:reindex;
Magento: Community Edition 2.3.0
PHP: 7.2.13

Thank you


texts: Magento 2 "Place order" button not working with stripe and One Step Checkout Amasty

texts:
I've integrated Stripe (its official module, latest version 2.1.4) as payment method along One Step Checkout from Amasty in Magento 2.3.5.
Something seems wrong as "Place order" button is not working. "Place order" button is clickable, but nothing happens. When I select another payment method, it works fine. But selecting "Stripe" as payment method it don't.
If I disable One Step Checkout, it also works fine (including Stripe).
So the problem is between Stripe module and One Step Checkout from Amasty. Any thoughts on this?


texts: Slow Loading product page Image with magento 2.3

texts:
After an upgrade to 2.3.1 images in the product page, are loading very slow and also checkout step got so slow too. We have tried many ways to fix it and we have read that many people has the same problem with the new Magento. We don't understand if is Magento or Porto Theme problem, can please somebody help us?

Thank you very much.


texts: Can't get ajax request post in Magento 2

texts:
In my js file i have this ajax request :

var url = $(this).closest("form").attr('action');
                jQuery.ajax({
                    type: "POST",
                    url: url,
                     data: {
                    "key": "test1",
                    "key2": "test2"
                },
                dataType: 'json'
                }).done(function (msg) {
                    //alert("success");
                });

In my controller i have this code:

 public function execute()
    {

         $response = [
            'errors' => false,
            'message' => 'Re-calculate successful.'
        ];
        $returnValue = '2';
        $result = $this->resultJsonFactory->create();
        $escaper = $this->_objectManager->get('Magento\Framework\Escaper');

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

        if ($this->getRequest()->isAjax()) {
            $returnValue = 'OK';

        }

        return $result->setData($returnValue);
    }

When i make the ajax request i receive 2 which came from here $returnValue = '2';

But if i tired to get the $id= $this->getRequest()->getPost('key2'); i receive null.

so my problem is here:

if ($this->getRequest()->isAjax()) {
   $returnValue = 'OK';
 }

My if is not accessed.

Does anyone know what i am doing wrong?


texts: Magento 2 Add multiple checkbox in admin ui form Group component

texts:
How do I add dinamically add multiple checkbox bellow the a field

This is how you add one checkbox bellow a field

<fieldset name="field_set_name" sortOrder="100">
        <settings>
            <collapsible>true</collapsible>
            Field Set Name
        </settings>
        <container name="field_set_group" component="Magento_Ui/js/form/components/group" sortOrder="110">
            <argument name="data" xsi:type="array">
                <item name="type" xsi:type="string">group</item>
                <item name="config" xsi:type="array">
                    <item name="required" xsi:type="boolean">false</item>
                </item>
            </argument>
            <field name="1_field_name" sortOrder="10" formElement="input">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="source" xsi:type="string">source</item>
                    </item>
                </argument>
                <settings>
                    1 Field Name
                </settings>
            </field>
            <field name="2_field_name" component="Magento_Catalog/js/components/url-key-handle-changes" sortOrder="15" formElement="checkbox">
                <settings>
                    <dataType>boolean</dataType>
                </settings>
                <formElements>
                    <checkbox>
                        <settings>
                            <description translate="true">2 Field name</description>
                            <valueMap>
                                <map name="false" xsi:type="number">0</map>
                                <map name="true" xsi:type="number">1</map>
                            </valueMap>
                        </settings>
                    </checkbox>
                </formElements>
            </field>
        </container>
    </fieldset>

AND I need something like this:


texts: Magento 2 checkout page getting shipping error

texts:
I have used webshop matrix rate shipping method but after change to ship address getting error in my magento 2 store if anyone know idea please reply me

Carrier with such method not found: matrixrate_44989, matrixrate


texts: How to add and Remove media gallery images store wise programmatically magento 2

texts:
I have followed few blogs to add and remove media gallery images but not able to set gallery images as per store wise programmatically.
https://www.siphor.com/adding-and-removing-media-images-programmatically-in-magento-2/
http://leftcurlybracket.com/update-product-image-programmatically/
Can anyone help me with above?


texts: Subcategories in grid but skip one level

texts:
I would like to place my subcategories in a category page and I found many examples how to do this. The only problem I have is that I use an extra category that I would like to skip.

So what I have:

Home --> Category --> Extra Category --> Subcategories

I would like to show the show the Subcategories on the Category page.

Is there a way I can do this? I'm using Magento 1.7.0.2


texts: Passing request variable to Products Grid AJAX URL (Magento 2)

texts:
When you enter /admin/catalog/product/ - products grid is fetched from /admin/mui/index/render/?namespace=product_listing&filters[placeholder]=true&filters[store_id]=1&paging[pageSize]=20&paging[current]=1&sorting[field]=entity_id&sorting[direction]=asc&isAjax=true (this URL is generated by JS).

Need method to pass the request variable to the URL responsible for loading products grid. I mean that entering: /admin/catalog/product/whatever/123/ will fetch data grid from URL /admin/mui/index/render/?namespace=product_listing&filters[placeholder]=true&filters[store_id]=1&paging[pageSize]=20&paging[current]=1&sorting[field]=entity_id&sorting[direction]=asc&whatever=123&isAjax=true

I tried to change XML config for:

<item name="imports" xsi:type="array">
<item name="exports" xsi:type="array">

But it doesn't affect the URL structure. Do you have any clear ideas for resolving the problem?


texts:
I was running now a script.
The script works on the currentStore-> 0

But now, the Store 1 is a bit different, and it need to run the script too.

How i can call both stores in the same script?

I show the code that i do.

require_once( __DIR__ . '/../app/Mage.php');

umask( 0 );

$store_id = 0;
$store_id_dutch = 1;
Mage::app()->setCurrentStore( $store_id );

// Check simple products in first place
$simple_products = $collection = Mage::getModel( 'catalog/product' )
        ->getCollection()
        ->addAttributeToFilter( 'type_id', Mage_Catalog_Model_Product_Type::TYPE_SIMPLE )
        ->getAllIds();

foreach ( $simple_products as $product_id )
{
// Script runs here, the same for both
}

Now i run it only in $store_id , but i want it too on $store_id_dutch

Any idea?


texts: Magento2, need help with ajax return data processing from controller which is string of html tags

texts:
considering below in controller:

     /**
     *
     * @return string
     */
    public function execute()
    {
        $resultJson = $this->resultJsonFactory->create();
        $layout = $this->_view->getLayout();
        $block = $layout->createBlock('Magento\Sales\Block\Adminhtml\Order\Create\Totals')->renderTotals('footer');
        $this->log->debug($block);
        return $resultJson->setData($block);
    }

I get below in logger:

[2017-10-01 10:06:45] main.DEBUG:

        Grand Total

        NOK37.20

below is my ajax call in view and I need to get the total amount 37.20, but got stuck :

$.ajax({
                        showLoader: true,
                        url: ajaxurl,
                        dataType: "html",
                        data: {
                          form_key: $('input[name=form_key').val()
                      },
                      type: "POST"
                    }).done(function (result) {
                     // how to  process result
                    });

Appreciate any hint to access the price form result.


texts:
We run a pretty big Magento store. Some stats:

31 GB in DB size
Over 700,000 orders
Over 4,000,000 quotes
Over 1,000,000 registered customers
Over 25,000 products

The store runs fine, but we've been experiencing trouble in altering table structures (principally installing new modules that create lots of database structures).
By cleaning all the log tables, we can reduce the DB size to 20GB, but we still have quite a lot of trouble installing third-party modules (even in our staging environment, installations may timeout or either run for several hours). Creating these new DB structures is really exhausting.

Sessions are stored with Memcache.
We use varnish but we're switching to FPC as son as we find a workaround for all the 6 servers. All the infrastructure is hosted in AWS.
We're running Magento CE 1.6.2.0 (updating is in our plans but running the update isn't the fastest thing on this DB and and we're afraid it won't be possible in production without a big disruption of service).

I need alternatives or ideas for optimizing this Magento DB. I've read a few things about Mongogento (magento catalog + mongodb), but our problem isn't really the catalog.

Most topics on the internet talk about cleaning log tables, which improves the usability but doesn't solve all of our problems.

Edit:
Biggest tables


texts: Magento create session when browser is closed

texts: How to create session in magento which will be destroyed when browser gets closed and gets created again


texts: top navigation menu not displaying in my magento. I refreshed cache and made reindexation. I followed many links and made all the possible options provided from the links. Still it's not showing menu.


texts: Should I use Magento 2 pre alpha already for production shops?

texts:
I know, it is alpha software, but at least there are lots of tests and bugfixes which are not in Magento 1.

If I write own modules for Magento 2, is the module structure very likely to change?
Are the core functionalities we have in Magento 1 already functional in Magento 2?


texts:
I am trying to move the product title above the image.gallery but I cannot figure out how the XML file should be set up.

I am editing in the catalog_product_view.xml file.

The main page title div is: page.main.title. The image placeholder has 2 class options: gallery-placeholder and fotorama-item or fotorama.

<move element="page.main.title" destination="product.media" before="gallery-placeholder"/>

When I place it as the above line it doesn't display the title of the product anymore:

<!--
/**
 * Copyright © 2016 SW-THEMES. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script src="Magento_Catalog::js/jquery.zoom.min.js"/>
    </head>
    <body>

        <move element="product.info.stock.sku" destination="product.info.price" after="product.price.final"/>
        <move element="product.info.review" destination="product.info.main" before="product.info.price"/>
        <move element="catalog.product.related" destination="sidebar.additional" after="product_view_custom_block"/>
        <move element="product.info.overview" destination="product.info.main" after="product.info.review"/>
        <referenceContainer name="after.body.start">
            <block class="Magento\Catalog\Block\Product\View" name="product_custom" template="Magento_Catalog::product/view/product_custom.phtml" before="-"/>
            <block class="Smartwave\Porto\Block\Template" name="product_view_config" after="-" template="Magento_Catalog::product/view/config.phtml"/>
        </referenceContainer>
        <referenceContainer name="columns.top">
            <block class="Magento\Catalog\Block\Product\View" name="prev_next_products" template="Magento_Catalog::product/view/prev_next.phtml" before="-"/>
        </referenceContainer>
        <move element="prev_next_products" destination="product.info.main" before="-"/>
        <move element="page.main.title" destination="product.media" before="gallery-placeholder"/>
        <referenceContainer name="product.info.social">
            <block class="Smartwave\Porto\Block\Template" name="product_view_addthis_links" after="-" template="Magento_Catalog::product/view/addthis.phtml"/>
        </referenceContainer>
        <referenceContainer name="content">
            <block class="Smartwave\Porto\Block\RickSnippet" name="rich_snippet" template="Magento_Catalog::product/view/rich_snippet.phtml" before="-"/>
            <block class="Smartwave\Porto\Block\Template" name="product_view_main_custom_block" before="product.info.main" template="Magento_Catalog::product/view/main_custom_block.phtml"/>
            <block class="Smartwave\Porto\Block\Template" name="product_view_main_custom_block2" after="-" template="Magento_Catalog::product/view/main_custom_block2.phtml"/>
        </referenceContainer>
        <move element="product_view_main_custom_block2" destination="product.info.main" after="product.info.overview"/>
    </body>
</page>

This is my XML page layout.

My goal is to move the product title and review part above the image gallery:


texts:
Hi I am working in my magento project. I've installed IWD store Locator recently. I can see this from admin side like this.

Now I want to create another tab associated with this Store Locator.Where should i modify my code? How can i override it with a folder which is in local pool.

What I want is like this


texts:
How do I add  a dropdown in magento header with auto fill with city names and when clicked on those city names its redirected to given links. please let me know the possible solutions . My requirement is almost similar to http://in.bookmyshow.com/

Help me in doing this I am struggling


texts: Magento 2 - How to show configurable product options in a popup

texts: I would like to show the configurable product options in a popup in the mobile version of my store


texts: Magento 2: How do I override the grid thumbnail preview copy?

texts:
Using 2.1.3 - I've added a thumbnail image in a column to my admin grid - I like the built in preview ability, but want to change the copy underneath the image in the preview window. It looks like it's hardcoded into the vendor/magento/module-ui/view/base/web/js/grid/columns/thumbnail.js file:

....
preview: function (row) {
        var modalHtml = mageTemplate(
            thumbnailPreviewTemplate,
            {
                src: this.getOrigSrc(row), alt: this.getAlt(row), link: this.getLink(row),
                linkText: $.mage.__('Go to Details Page')
            }
        );
....

I've tried creating a copy of the thumbnail.js file in my own Namespace_Module directory (app/code/Namespace/Module/view/base/web/js/grid/columns/thumbnail.js)and pointed the grid element config to that directory, but don't see any changes:

<item name="config" xsi:type="array">
                <item name="indexField" xsi:type="string">file_path</item>
                <item name="component" xsi:type="string">Namespace_Module/js/grid/columns/thumbnail</item>
                <item name="sortable" xsi:type="boolean">false</item>
                <item name="has_preview" xsi:type="string">0</item>
                <item name="label" xsi:type="string" translate="true">Photo</item>
            </item>

How can I override the hard coded copy in the thumbnail preview window?


texts:
I've used DI preferences to set an interface to use a class in my own module e.g.

<?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\CatalogInventory\Api\StockManagementInterface" type="MySpace\MyModule\Model\StockManagement"/>
</config>

However, there is also a DI preference for this interface in the original core module.

In some cases this works, and others (such as in this case for Magento\CatalogInventory\Api\StockManagementInterface), it does not - it still uses the original.

What determines which class wins out? If it cannot be determined, how is this a reliable way to do a full class rewrite in the many many cases where Magento 2 has made it impractical to use a plugin or observer?

[Note that I "solved" the above issue by setting a preference for the class Magento\CatalogInventory\Model\StockManagement instead, but this does not allow for direct use of that class such as for composition]


texts: How to update existing cms page through install script

texts:
I have this script

<?php
$cmsPage = Array (

                    'title' => 'Test Page 1',
                    'root_template' => 'one_column',
                    'identifier' => 'testpage1',
                    'content' => "
Testowa sprawa czy działa update ? oooooooooooo
",
                    'is_active' => 1,
                    'stores' => array(1),
                    'sort_order' => 0
    );

Mage::getModel('cms/page')->setData($cmsPage)->save();

If cms page with identifier "testpage1" exist , the script create another with the same identifier.

Is there a way to check if cmspage exist - and if that is true - do update ?


texts: Can retrieve product category ID but category name is always null

texts:
I need to be able to get the Category name and ID from a product and I am able to retrieve the ID doing the following:

$categoryID = $product->getCategoryCollection()->getFirstItem()->getId();

However If I try to get the name, It always returns null.

$categoryName = $product->getCategoryCollection()->getFirstItem()->getName();

How do I get the name?

I have tried loading the Category by ID but that seems to be returning null as well, I have checked in the admin screen the correct ID for the category is returned.


texts: Show free shipping text instead of $ 0.00

texts:
Is there a way to show free shipping text instead of $ 0.00?

I tried with couple of answers already posted on magento stackexchange but non of them are working. Tried to change shipping.js to return free price instead of 0. Tried to manually change that span element but i can not access it with dom.

Thanks in advance! :)


texts: Loading small image from product gallery every x seconds when mouse hover on image in product list

texts:
I need help regarding getting all the small images from Magento product gallery for a certain product in the correct order that was set in admin, append them to a hidden div, then show them one after the other.  When the user hovers the mouse over the image in product list (category page) the images should start showing one after the other in the correct order every x seconds.

Any idea how to do that in AJAX?

EDIT: I have modified the above request to fit my needs better in the least possible cost on the server/client side. Here are the changes to my request:
1. Replace HOVER with PLAY button because HOVER is not a good option for mobile and tablet devices.
2. On each HOVER (on purpose or accidentally), AJAX calls the server, HOVER is not a good idea after all.

I solved the problem above but still have one issue that I will discuss it later on. The way I solved my problem is like I said adding PLAY button below each image to see the remaining images in the product gallery upon user request through AJAX. AJAX was very fast getting the URLs for the images, no problem with that but my issue is the following:
I setInterval of 2000ms to assign image src then load the image, but the problem is that on slow devices, the load is taking more time than 2000ms, which is resulting in showing images randomly because the rest where taking more than 2000ms to load.

So my main issue now is to find a way to get all images loaded upon clicking PLAY before starting to show the first image, even if first image is loaded. Any idea how to do that?

PS: the carousel is not an option because it loads all the images for each product, and the images are very large in size (above 300k each, and I might have up to 5 images for each product) in addition to infinite scrolling, it's a huge traffic load for the server.

Another EDIT: I just managed to get the images inside a div like that:

All what I need so far is to show each every x seconds.


texts: Shipping costs remove in cart grand total in magento 2.2.0?

texts:
How to remove Shipping costs in cart grand total in magento2.1.7. I just need to remove the shipping price value from summary in cart. After returning from checkout to cart page the shipping price value shows in cart page(Summary).
It will be very confusing for the user when returning back to cart page.
I referred this link Shipping costs remove in cart grand total in magento 1.9

But the above link is in Magento1.9. I want in Magento2.1.7

The above screenshot is in cart page without shipping price calculation.

The above screenshot is after returning from checkout page it shows with shipping calculation in cart page.
I need to remove the shipping calculation.
Any help would be appreciated.


texts: How To move Quick View Before Add to Cart in Magento 2?

texts:
I used the bss quick view and fist i want to need to remove th hover for quick view button and
second one i need to add quick view button before add to cart
here see


texts: Magento 2 I want to flush only homepage cache from admin

texts: I Want to flush only homepage cache from the admin side no other pages affected. how to achieve this.


texts: Can attribute value be stored in different table than returned by $attr->getBackendTable()?

texts:
I have weird bug in my Magento code. Basically one attribute - multiselect, with backend type varchar - returns from $attr->getBackendTable()  'catalog_product_entity_varchar' but it seems that its values are stored in 'catalog_product_entity_text' instead. Something tells me it might be a bug in custom import script but I'm not sure.

Are there any special cases (besides default attribute value) when attribute value may be stored in table different than returned by getBackendTable()?


texts:
i need resources, manuals about module development, and etc... give me please links, i want develop modules in magento, but magento tutorial very small, let me know about this info

Thanks


texts: How to create a event observer which trigger after a customer placed an order

texts:
Magento ver. 1.9.3.2

C:\xampp\htdocs\magento1\app\code\local\Maddy\Checkout\etc\config.xml

 <?xml version="1.0"?>
<config>
    <modules>
        <Maddy_Checkout>
            <version>0.0.1</version>
        </Maddy_Checkout>
    </modules>
    <global>
         <models>
            <maddy>
                <class>Maddy_Checkout_Model</class>
            </maddy>
        <events>
        <sales_order_place_after>
                <observers>
                    <maddy_sendsms>
                        <class>Maddy_Checkout_Model_Observer</class>
                        <method>orderSms</method>
                        <type>singleton</type>
                    </maddy_sendsms>
                </observers>
        </sales_order_place_after>
        </events>
    </global>
</config>

C:\xampp\htdocs\magento1\app\code\local\Maddy\Checkout\Model\Observer.php

  <?php
class Maddy_Checkout_Model_Observer
{
    public function orderSms(Varien_Event_Observer $observer)
    {
        $incrementId = $observer->getEvent()->getOrder()->getIncrementId();
        $custName    = $observer->getEvent()->getOrder()->getCustomerFirstname();
        $orderPrice  = $observer->getEvent()->getOrder()->getGrandTotal();
        $orderId     = $observer->getEvent()->getOrder()->getId();
        $order       = $observer->getEvent()->getOrder()
        $mobile      = trim($order->getShippingAddress()->getData('telephone'));
        echo "I am here";
        die;
        /* I will write sms api here  */
        echo "Mobile" . $mobile;
        echo "<script>alert('Just to check')</script>";

    }
}

C:\xampp\htdocs\magento1\app\etc\modules\Maddy_Checkout.xml

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

When  order is placed no alert is shown.

UPDATE:
if I use event based trigger I am not able to do add to cart. If I delete this module g then add cart is working.There is no log for this.

UPDATE:1.1

After creating some observers i am came to know that never echo any thing directly in observers , even dump in log to see the output. It will not break the functionality than.


texts: Magento 2 A technical problem while saving some product from backend

texts:
I am getting below error while saving some configurable product not all products.

A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later.

https://prnt.sc/pc0pu4


texts: Magento2.3.1 getting issue when update qty

texts:
How to solve below error when trying to update qty in cart?

"Something went wrong while saving the page. Please refresh the page and try again."


texts: Create a new section on the grid (new form)

texts:
I have a basic grid with edit and save:

Module
├── Block
│   ├── Adminhtml
│   │   ├── Stores
            ├── Edit
                ├── Form.php
            ├── Grid.php
            ├── Edit.php
        ├── Stores.php
├── controllers
    ├── Adminhtml
        ├── StoresController.php

I want to add a button that will load another form. So insider Store.php I added the button:

$this->_addButton('import_store',
            array(
                'label'     => 'Import CSV',
                'onclick'   => "setLocation('{$this->getUrl('*/stores/importfile')}')",
                'class'     => 'add',
            )
        );

and inside StoresController.php I started a new method for Module_Adminhtml_StoresController:

public function importfileAction()
    {
       ...
    }

But I am stuck now and don't know how to proceed.

When clicking on the Import CSV button you should go to a new form where you can upload a file. How should I proceed with the grid?

Thank you!


texts: Migration issue related server Timezone, change Timezone by Sql Query

texts:
Migration from Magento 1 to Magento 2 by UB Migration tool, All Date is changed from M1 because of date column is used CURRENT_TIMESTAMP, and server timezone is CST on Magento 2, and Magento1 is used UTC Timezone. so Its 5hour difference on the date when a date is displayed on magento2 admin customer/order view or frontend.

So I want to change server MySQL timezone by database SQL query because I have no access any etc/my.cnf or any other files.

So Any Idea about to change the Timezone server from CST to UTC by SQL Query?


texts: Is there a way to not old urls back to the homepage utilizing the admin panel?

texts:
Or do you have to use the htaccess.

The reason i ask is because i just changed our URL structure from www to http and for legacy URL's that might be out there existing on other websites, i do not want them to end up on the homepage.. rather i'd like them to just end up on the old page.. even if it's not the right page any longer.

I've looked through the panel configurations and i believe i set it up originally to send all 404's or old pages to the homepage. I understand i could use catalog > URL redirects but i don't want to possibly have to go through a hundred URL's.. That would be a tedious way of doing that.

Thanks in advance.

update to be a bit more clear:

That sounds good but i just want you to be clear on what the problem is.. here's a better senario... we send out and email that has a link like so:  http://www.goodstuff.com/buy/whateverproduct  <   when i change the base and secure url to http://goodstuff.com/buy/whateverproduct < the link above with www no longer works and directs to the home page. I would like to still preserve that link as well. Is that possible?


texts: Magento 1.9.2.4, HTTP to HTTPS, all pages are ok, except home page

texts:
I'm trying to set up HTTPS. SSL certificate is installed.
I can access any page of my store using HTTPS, even the home page.
I would like to set up the home page so when a customer opens http
he or she redirects to https.

Unsecure and Secure fields in the config are set to: https://timeleader.ru/

I get too many redirects when I'm trying to rewrite http to https in .htaccess.

I use standard magento .htaccess, but I had to add: "SetEnv HTTPS On", otherwise it will not work at all.

Thank you in advance.


texts: Magento2.1.7 generating wrong thumbnail image cache

texts:
I have imported products in bulk via CSV in magento2, and all products imported successfully.

But for some products only thumbnail image generating wrong (it is showing other product's image where product's image name is same, but it should be created with different image name) /pub/media/catalog/product/cache/thumbnail/75x75/beff4985b56e3afdbeabfc89641a4582/1/1/1145.jpg, all others images cache are same to product original image.

I tried to clean image cache but every time magento generating 75X75 cache image wrong for some products.

How to resolve it?


texts: Magento\Framework\Exception\LocalizedException: Invalid XML file 0.1.0 Payeezy Magento 2

texts:
Facing below error:

>Magento\Framework\Exception\LocalizedException: Invalid XML in file 0.1.0 Payeezy_PayeezyCheckout_Model payeezycheckout_mysql4 Payeezy_PayeezyCheckout_Model_Mysql4 payeezycheckout_api_debug
Payeezy_PayeezyCheckout_Helper Payeezy_PayeezyCheckout Payeezy_PayeezyCheckout_Model_Mysql4_Setup core_setup core_write core_read Payeezy_PayeezyCheckout_Block /payeezycheckout/shared standard Payeezy_PayeezyCheckout payeezycheckout Payeezy_PayeezyCheckout.csv payeezycheckout.xml Payeezy_PayeezyCheckout.csv USD payeezycheckout/shared PUT SECRET WORD HERE 1 redirect 0 processing holded pending canceled canceled canceled 0 : Element 'modules': This element is not expected. Expected is one of ( default, stores, websites ). Line: 3 in /home/dukaania/public_html/testing2/app/code/MageBig/MbFrame/Framework/App/Config/Initial/Reader.php:129 Stack trace: #0 /home/dukaania/public_html/testing2/generated/code/MageBig/MbFrame/Framework/App/Config/Initial/Reader/Proxy.php(95): MageBig\MbFrame\Framework\App\Config\Initial\Reader->read() #1 /home/dukaania/public_html/testing2/app/code/MageBig/MbFrame/Framework/App/Config/Initial.php(58): MageBig\MbFrame\Framework\App\Config\Initial\Reader\Proxy->read() #2 /home/dukaania/public_html/testing2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): MageBig\MbFrame\Framework\App\Config\Initial->__construct(Object(MageBig\MbFrame\Framework\App\Config\ThemeId), Object(MageBig\MbFrame\Framework\App\Config\Initial\Reader\Proxy), Object(Magento\Framework\App\Cache\Type\Config), NULL) #3 /home/dukaania/public_html/testing2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('MageBig\\MbFrame...', Array) #4

Here's my xml code:

                <?xml version="1.0"?>
            <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
                   <modules>
                      <Payeezy_PayeezyCheckout>
                    <active>true</active>
                   <codePool>local</codePool>
                <depends>
                       <Mage_Payment/>
                   </depends>
            </Payeezy_PayeezyCheckout>
       </modules>
    </config>


texts: custom brand filter issue duplicate layered navigation magento 2.4.0

texts:
I have create custom filter by brand but issue duplicate layered navigation Magento 2.4.0
This xml code comment layered navigation work perfectly Anyone advance thanks for help.

catalog_category_view.xml

Magento_Catalog/templates/category/brands.phtml

<?php
$filters = $block->getFilters();
$brandHelper = $this->helper(Amasty\ShopbyBrand\Helper\Data::class);
$optionHelper = $this->helper(Amasty\ShopbyBase\Helper\OptionSetting::class);
$attrHelper = $this->helper(Vendorname\AttributeIsFeatured\Helper\Data::class);
$brandAttributeCode = $brandHelper->getBrandAttributeCode();
?>

Filter by
Brand

    <?php foreach ($filters as $key => $filter) : ?>
    <?php if($filter->getRequestVar() == $brandAttributeCode): ?>
        <div class="row justify-content-center items" attribute-code="<?= /** @noEscape */ __($filter->getRequestVar()) ?>">
            <?php $i = 1; ?>
            <?php foreach ($filter->getItems() as $item) : ?>
                <?php if($i < 5): ?>

                        <?php $img = $optionHelper->getSettingByValue($item->getValue(), 'attr_'.$filter->getRequestVar(), $attrHelper->getStore()->getId())->getImage() ?>
                            <a class="brand-bg-image" href="<?= /** @noEscape */ $block->escapeUrl($item->getUrl()) ?>" title="<?= /** @noEscape */ $item->getLabel() ?>"   <?php echo $img ? 'style="background-image:url('.$attrHelper->getBrandImage($img).')"' : 'style=""' ?> >

                <?php endif; ?>
                <?php $i++ ?>
            <?php endforeach; ?>

    <?php endif; ?>
<?php endforeach; ?>

        <a class="all-brands-link btn custom btn-block" href="<?= $brandHelper->getAllBrandsUrl() ?>">View All brands >


texts:
The problem is well known: lib classes are loaded exclusively through the autoloader, and we cannot change them other than:

Copying them entirely to a codePool that is checked earlier than lib.
Installing the PSR-0 autoloader, specifying an autoload classmap, and then copying the file entirely into that folder structure instead. [ my current solution ]

I'm in a tough spot because I want to potentially touch many of these files - but for the sake of my sanity and stability/upgradeability of the store don't want to copy entire library classes.

Now obviously there are potential solutions to this problem, but they all come with their own set of problems:

Go the AOP route and use a PHP-based library like Go! AOP: Last I checked this will require Magento classes to be loaded by the composer autoloader, not just one being available. Flyingmana has done some work in this area but it's definitely not ready for production usage and my needs are more immediate. I also want to ship as an extension, and that would require more composer setup.
Go the AOP route and use a native PHP extension: Probably the most favorable at this point, but it would require installing a separate extension, not to mention that it would not work with HHVM.
Use PHP's classkit and/or runkit: It's another native PHP extension so it has the same problem as above.
Patch call sites to use my own namespaced (\Danslo\Varien_X) version, then extend from the original (\Varien_X): There are just way too many callsites to patch and it would require a silly amount of rewrites. Not an option.
Roll my own: It should be possible to:

Write my own autoloader.
Copy the original class to a separate folder ({root_dir}/var/tmp), wrap it in namespace \Magento { < original contents > }.
Include that file.
Include my modified class OriginalClass extends Magento\OriginalClass {}

The downside of this is obvious: dynamic code generation, regex, a little overhead for loading rewritten classes. But I'm almost sure that at this point it would beat copying ~5000 lines of code when I just want to touch/add ~100 lines.

I know I'm asking a lot, but is there something modern and relatively clean out there that helps solve this problem?


texts:
I want to show some related product in magento theme.
For that I updated catalog.xml file with following code.

<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="catalog/product_list_related" name="catalog.product.related" as="related" template="catalog/product/list/related.phtml"/>
</block>
</reference>

And added below code in catalog/product/view.phtml file.

<?php echo $this->getChildHtml('related'); ?>

After this few changes I got this error

 Fatal error: Call to a member function addToChildGroup() on a non-object in magento/app/code/core/Mage/Core/Block/Abstract.php on line 815

Please suggest what could be the issue of this error.


texts:
SOLVED :: 15.9.17 (the following code works on a fresh Magento 2.1.7 installation; tested on Luma theme)

I am struggling with the override of this particular core block

Magento\Catalog\Block\Product\View\Options\Type\Select

Here is my module structure:

├── <VendorName>
|   ├── <ModuleName>
|   |   ├── Block/
|   |   |   ├── Product/
|   |   |   |   ├── View/
|   |   |   |   |   ├── Options/
|   |   |   |   |   |   ├── Type/
|   |   |   |   |   |   |   └── Select.php
|   |   ├── etc/
|   |   |   └── di.xml
|   |   |   └── module.xml
|   |   ├── view/
|   |   |   ├── frontend/
|   |   |   |   ├── templates/
|   |   |   |   |   ├── product/
|   |   |   |   |   |   ├── view/
|   |   |   |   |   |   |   ├── options/
|   |   |   |   |   |   |   |   ├── type/
|   |   |   |   |   |   |   |   |   └── select.phtml
|   |   └── registration.php

The registration.php

    <?php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'VendorName_ModuleName',
    __DIR__
);

The module.xml

    <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
        <module name="VendorName_ModuleName" setup_version="1.0.0">
            <sequence>
                <module name="Magento_Catalog"/>
            </sequence>
        </module>
</config>

The 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\View\Options\Type\Select" type="VendorName\ModuleName\Block\Product\View\Options\Type\Select" />
</config>

The select.phtml (copied as it is from vendor/magento folder)

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

?>

<?php /* @var $block \Magento\Catalog\Block\Product\View\Options\Type\Select */ ?>
<?php
$_option = $block->getOption();
$class = ($_option->getIsRequire()) ? ' required' : '';
?>
<div class="field<?php /* @escapeNotVerified */ echo $class; ?>">
    <label class="label" for="select_<?php /* @escapeNotVerified */ echo $_option->getId() ?>">
        <?php echo  $block->escapeHtml($_option->getTitle()) ?>

        <?php echo $block->getValuesHtml() ?>
        <?php if ($_option->getIsRequire()): ?>
            <?php if ($_option->getType() == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_RADIO || $_option->getType() == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_CHECKBOX): ?>
                <span id="options-<?php /* @escapeNotVerified */ echo $_option->getId() ?>-container">
            <?php endif; ?>
        <?php endif;?>

The Select.php (I removed the custom logic here, as I think not relevant in this context)

<?php
namespace VendorName\ModuleName\Block\Product\View\Options\Type;

class Select extends \Magento\Catalog\Block\Product\View\Options\AbstractOptions

{

   public function getValuesHtml()
    {
    // My Custom Code
    }
}

According to https://magento.stackexchange.com/a/112847/51071 I was expecting to succesfully override the block after having activated the module and run setup:di:compile, but nothing happened.

Does anyone has a clue what am I missing here in order to make the module working properly? Any help is much appreciated.


texts: Can we turn the checkout success page into a checkout step in Magento 2?

texts:
How can we make the checkout success page part of the regular Magento2 checkout steps?

I like the idea of having a simplified layout with minimal content during the checkout steps. But the confirmation/success page has that same, main layout used by most of the website.

I know that we can build additional checkout steps, i.e: http://devdocs.magento.com/guides/v2.2/howdoi/checkout/checkout_new_step.html but I don't think it is really what should be done in our case.

At the end, we just want the checkout success page to look like a final checkout step, not to work like one of them.


texts: Magento2.3.0 In which file attribute sort order set for layer navigation left side on product list page?

texts:
I am using Magneto2.3.0 in which the file attribute sort order set for  layered navigation, left side on product list page/category page ?
If any one idea how it is working in Magento default please share it. and please define path.


texts: Stocks sources of other website's showing on applying store switcher in admin

texts:
Ours is the multi website store(UAE and Oman), and each website is assigned its own stock source under Stores > Stocks

But when I Go to product edit, and switch store to Oman website, user is able to see the Inventory source of other websites also

Our client wants that user should only be able to see the stock sources which are assigned to that website (Oman in this case if I select one of the Oman Stores in store switcher. But it is also showing UAE stock sources also)
I checked few 3rd party extensions but none of them provides such a feature. Any suggestion on how this can be achieved?


texts: Custom contact form variables not being shown in email template if input marked as disabled

texts:
I have a custom contact form on the product view, so a customer can ask a question for a specific product. In the form I have a hidden text field with the current URL, so we know which product the question is for.

I've given the field the name producturl ...

$currentUrl     = Mage::helper('core/url')->getCurrentUrl();

<input name="producturl" id="producturl" title="<?php echo $this->__('Product URL') ?>" value="<?php echo $currentUrl; ?>" class="input-text disabled" type="text" disabled />

I would expect the Email Template to output this field using

{{var data.producturl}}

since all other fields seem to work this way. Here is the Email Template:

Name: {{var data.name}} E-Mail-Adresse: {{var data.email}} Telefon: {{var data.telephone}} Bemerkungen: {{var data.comment}}  Produkt: {{var data.producturl}}

Everything seems to be working, the email is sent and all the info is given out in the template apart from the producturl field. Can anyone give me a reason as to why this is?

Thanks in advance.


texts: Override CatalogSearch Result not working

texts:
Hi I'm trying to change my current search result page title. So I find the best way is override the file app/code/core/Mage/CatalogSearch/Block/Result.php method protected function _prepareLayout().

So I created a module in app/code/local with the following structure. Please note that this module does other things like post a message to our ERP on a new order or invoice.

app/code/local/Agvalue/Skambau/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Agvalue_Skambau>
            <version>1.0</version>
        </Agvalue_Skambau>
    </modules>
    <global>
        <models>
            <agvalue_skambau>
                <class>Agvalue_Skambau_Model</class>
            </agvalue_skambau>
        </models>
        <events>
            <sales_order_place_after>
                <observers>
                    <agvalue_skambau_order_observer>
                        <type>model</type>
                        <class>agvalue_skambau/observer</class>
                        <method>skambauCreateOrder</method>
                    </agvalue_skambau_order_observer>
                </observers>
            </sales_order_place_after>
            <sales_order_invoice_save_after>
                <observers>
                    <agvalue_skambau_invoice_observer>
                        <class>agvalue_skambau/observer</class>
                        <method>skambauCreateInvoice</method>
                    </agvalue_skambau_invoice_observer>
                </observers>
            </sales_order_invoice_save_after>
        </events>
        <blocks>
            <catalogsearch>
                <rewrite>
                    <result>Agvalue_Skambau_Block_Result</result>
                </rewrite>
            </catalogsearch>
        </blocks>
    </global>
</config>

app/code/local/Agvalue/Skambau/Block/Result.php

<?php
class Agvalue_Skambau_Block_Result extends Mage_CatalogSearch_Block_Result
{

    protected function _prepareLayout()
    {
        // add Home breadcrumb
        $breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
        if ($breadcrumbs) {
            $title = $this->__("Search results for: '%s'", $this->helper('catalogsearch')->getQueryText());
            $breadcrumbs->addCrumb('home', array(
                'label' => $this->__('Home'),
                'title' => $this->__('Go to Home Page'),
                'link'  => Mage::getBaseUrl()
            ))->addCrumb('search', array(
                'label' => $title,
                'title' => $title
            ));
        }
        // modify page title
        $title = $this->helper('catalogsearch')->getEscapedQueryText();
        $this->getLayout()->getBlock('head')->setTitle($title);

        return parent::_prepareLayout();
    }
}

app/etc/modules/Agvalue_Skambau.xml

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


texts: How to remove sidebar in Shipping Address step Magento 2

texts:
I want to hide the sidebar in this Shipping Address Page on Checkout.

Note: I only want to hide the sidebar in Shipping Address step, not in other steps.

I did some research on it But found Solution for custom Step LINK.

Please guide me to achieve a solution for this.

Thanks in advance.


texts: M2: Using LayoutProcessor, block taking up entire block instead of being a child

texts:
I am trying to use LayoutProcessor to include a block within the section before-place-order on the M2 Checkout.

Currently, I already have two blocks within there (a comments block and an order attachment block), both of those use the standard layout.xml inclusion so no issues with additional blocks and sorting.

However being new to using the LayoutProcessor, whenever I try to include the new block, it ends up taking the entire block over, removing the other two blocks.

The setup I am using:

$jsLayout['components']['checkout']['children']['steps']['children']['billing-step']
['children']['payment']['children']['payments-list']['children']['before-place-order'] =
        [
            'component' => 'uiComponent',
            'displayArea' => 'before-place-order',
            'children' =>
            [
               ...
            ]
        ]

I believe it looks obvious to me that I am declaring it to essentially take up the before-place-order spot instead of telling it to be a child of it, but any method I've tried to change that to being a child, doesn't work.

Any ideas?


texts: Magento 2: Create the dynamic excel file

texts:
How can I create the excel file in Magento root directory with my dynamic data in the controller file.

Thanks In Advance.


texts: Security Patch SUPEE-7405 or next version?

texts:
With the new Security Patch SUPEE-7405 and all its linked impacts (Security Patch SUPEE-7405 - possible problems?) do you think it is better to apply it on current version or waiting for a new Magento release including it and make an upgrade ?
I know that depends on the current version, the different rewrites, the themes, but I ask it in a general way.


texts:
I need to add payment gateway in my Magento2 store,

I need to add three options credit card, debit card, and paypal.

I can see lots of options in Magento configuration, but I am not able to understand, from where should I start?

It is really urgent. it will be great if anyone can help.

Regards


texts: How to add product in Magento using REST API?

texts:
I want to add a product using the REST API in Magento 2.

How can I achieve this?


texts: Get "as low as" price on product list for grouped products with tier prices

texts:
Situation: a grouped product with 2 associated simple products:

  Product 1: normal price 10 euro. Buy 10 for 8 euro.
  Product 2: normal price 15 euro. Buy 10 for 12 euro.

Current behavior: product listing with price: 10 euro.

Expected result: product listing with price 10 euro and "as low as" 8 euro.

How do I implement the "as low as" tier price for grouped products?


texts: Magento 2 wysiwyg editor hide/show button not showing with custom category attribute?

texts:
I have create custom category attribute as wysiwyg editor under content fieldset.

Attribute is showing and working fine but I want to add Hide/Show Editor button with atribute.

How can I do this?

I am using below code in adminhtml/ui_component/category_form.xml

   <fieldset name="content">
        <field name="category_information">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="class" xsi:type="string">Magento\Catalog\Ui\Component\Category\Form\Element\Wysiwyg</item>
                    <item name="formElement" xsi:type="string">wysiwyg</item>
                    <item name="wysiwygConfigData" xsi:type="array">
                        <item name="settings" xsi:type="array">
                            <item name="theme_advanced_buttons1" xsi:type="string">bold,italic,|,justifyleft,justifycenter,justifyright,|,fontselect,fontsizeselect,|,forecolor,backcolor,|,link,unlink,image,|,bullist,numlist,|,code</item>
                            <item name="theme_advanced_buttons2" xsi:type="boolean">false</item>
                            <item name="theme_advanced_buttons3" xsi:type="boolean">false</item>
                            <item name="theme_advanced_buttons4" xsi:type="boolean">false</item>
                            <item name="theme_advanced_statusbar_location" xsi:type="boolean">false</item>
                        </item>
                        <item name="files_browser_window_url" xsi:type="boolean">false</item>
                        <item name="height" xsi:type="string">100px</item>
                        <item name="toggle_button" xsi:type="boolean">false</item>
                        <item name="add_variables" xsi:type="boolean">false</item>
                        <item name="add_widgets" xsi:type="boolean">false</item>
                        <item name="add_images" xsi:type="boolean">false</item>
                    </item>
                    <item name="template" xsi:type="string">ui/form/field</item>
                    <item name="source" xsi:type="string">category</item>
                    <item name="wysiwyg" xsi:type="boolean">true</item>
                    <item name="dataScope" xsi:type="string">category_information</item>
                    <item name="sortOrder" xsi:type="number">110</item>
                    <item name="rows" xsi:type="number">8</item>
                    <item name="label" xsi:type="string" translate="true">Category Information</item>
                    <item name="notice" xsi:type="string" translate="true"></item>
                    <item name="additionalClasses" xsi:type="string">category-desc</item>

                </item>
            </argument>
        </field>

    </fieldset>


texts: Unable to select category when editing products

texts:
In my magento I have a problem. Categories tab of product when you edit is looking like this. I can't select subcategories from shop. I have  no idea why. What could be the problem?

Store categories are:

Update 1

This is only when editing saved products. When adding all is ok. Also when reindexing, Category Flat Data is not reindexed.

Update 2

Reverted my code to a previous version, when this problem wasn't present. Still the same problem. This means that the problem is in BD.


texts: Product not visible in list product and search

texts:
I have a strange problem.

  http://lady-wine.com/en/brunello-di-montalcino-castelgiocondo-marchesi-de.html

This product is currently visible if I insert link directly but it's not visible with search and in products lists. Why?

Thanks
Ale


texts: Magento 2 - How to override frontend javascript file

texts:
I need to overwrite a javascript file from a custom module at:
vendor\amasty\module-single-step-checkout\view\frontend\web\js\model\one-step-layout.js
because I need to replace a code line in it to replace a template with my own module:
// Checkout layout options model
define([
    'ko',
    'uiRegistry',
    'Amasty_Checkout/js/view/utils'
], function (ko, registry, viewUtils) {
    'use strict';

    const MAPPING_BLOCK_NAME = {
            ...
        },
        CLASS_NAMES = {
            classic: {
                ...
            },
            modern: {
                ...
            }
        },
        BLOCK_ATTRS = {
            ...
        };

    return {
        containerClassNames: ko.observable(''),
        selectedLayout: [],
        checkoutDesign: '',
        checkoutLayout: '',
        checkoutBlocks: {},
        mainAdditionalClasses: '',

        /**
         * Getting checkout block by name
         * @param {String} blockName
         * @returns {observable}
         */
        getCheckoutBlock: function (blockName) {
            var requestComponent = this.checkoutBlocks[blockName]
                || this.requestComponent(MAPPING_BLOCK_NAME[blockName]);

            switch (blockName) {
                case 'shipping_address':
                    if (requestComponent()) {
                        requestComponent().template = 'Amasty_Checkout/onepage/shipping/address';
                    }

                    break;

                case 'shipping_method':
                    if (requestComponent()) {

                        // ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼
                        // I need to replace this line with `Company_Shipping/onepage/shipping/methods`
                        requestComponent().template = 'Amasty_Checkout/onepage/shipping/methods';

                    }

                    break;

                default: break;
            }

            return requestComponent;
        },

     ...

How can I override that line from my own template?
I created this file app/code/Company/Shipping/view/frontend/requirejs-config.js file:
var config = {
    config: {
        mixins: {
            'Amasty_Checkout/js/model/one-step-layout': {
                'Company_Shipping/js/model/one-step-layout': true
            }
        }
    }
};

Then I copied the file one-step-layout.js to app\code\Company\Shipping\view\frontend\web\js\model\one-step-layout.js.
This should mixin my script to the original script.
What code is required in my one-step-layout.js file to replace the template to load my own template?


texts: PayPal Payflow Link Show Unable to place Order, Please Try Again

texts:
I use magento v2.1.0, I input Partner, vendor, user and password.
but When I buy product and checkout
I go to Review & Payment step It's show Contiune Button , I click continue it show "Unable to place Order, Please Try Again"

I don't know why. and I search  about problem on google but not successful.
Now customers can not buy on my site. Help me Please.

Thank very much.


texts: Accordion not working Magento 2 after minify JS

texts:
I have minified JS and HTML and CSS in Magento 2.

After that Accordion is not working.

<?php
$collectionTitle = $this->getCollectionFaqcat();
?>

        <?php $j = 1; ?>
        <?php foreach ($collectionTitle as $item): ?>
            <div id ="<?= $j ?>" data-role="collapsible" class="faqs-role">

                        <?php echo $block->filterOutputHtml($item->getCategoryName()); ?>

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

            <?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('support-right-sidebar')->toHtml(); ?>

        <?php $j = 1; ?>
        <?php foreach ($collectionTitle as $item): ?>
            <?php $collection = $this->getCollectionFaq($item->getId()); ?>

                <?php $i = 1; ?>
                <?php foreach ($collection as $items): ?>

                        <div class="faqs-question" data-role="#faq-row-<?php echo $j . $i; ?>">
                            <?php echo $block->filterOutputHtml($items->getQuestion()); ?>

                        <div class="faqs-answer" id="faq-row-<?php echo $j . $i; ?>" style="display:none">
                            <?php echo $block->filterOutputHtml($items->getAnswer()); ?>

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

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

Trying to open the question and answer, but it needs double-click to open that.

How to fix the problem in Magento 2?


texts: Magento 1 session cookie empty (frontend=) only on some instances

texts:
I have issues on only one ISP (Internet Service Provider) where any request will always redirect to homepage.
I reiterate - I only see this behaviour with one specific ISP, and very consistent - 95% of the time.
REQUEST 1
Request to https://www.example.com
Cookie: frontend=abcdef

RESPONSE 1 (before redirect)
Result is : `frontend=; expires=Sat, 30 Jan 2021 11:02:11 GMT; path=/; domain=www.example.com; Secure; SameSite=None`
Location: https://www.example.com/

REQUEST 2 (after auto redirecting)
Cookie: frontend=

RESPONSE 2 (this is the final response)
frontend=fedcba; expires=Sat, 30-Jan-2021 11:02:12 GMT; Max-Age=86400; path=/; domain=www.example.com; secure; httponly

See that Request 1 has a cookie abcdef, but response is frontend= (empty). with location set
Request 2 then has cookie frontend= (empty) and a response with a new cookie frontend=fedbca is created.
Refreshing this page again immediately after this response 2 then creates a new redirect/new cookie.  These cookies never persist.
The only difference that I see between a working request (ie. other other internet connection ISP) is that the response received (RESPONSE 2) has Max-Age set and a working request does not have it set.
Working request (one request - no redirects / cookie persists between refreshes etc)
frontend=persistentcookie; expires=Sat, 30-Jan-2021 11:02:12 GMT; path=/; domain=www.example.com; secure; httponly

Question
Which code validates and recreates the Cookies?  app/code/core/Mage/Model/Cookie.php just sets the data but I don't know where the session gets verified and cookie recreated.
Where does Max-Age come from (as I compare it to working ones which do not have it set).
This is an extremely confusing issue.
I would appreciate some advice!


texts: How to auto fill (add default value) the shipping address in Magento 2.3

texts:
I want to auto fill the field (such as First Name, Street Address, State/Province..) in Shipping address (checkout page).

like this :

I have reference some solution such as :
How to auto fill the shipping address field or How to auto fill the shipping address field in Checkout in Magento 2.2

But I can match the file path of the above solution . I think it is not match the Magento 2.3 version.I want to know the detail step to set the default value in the field in Shipping address page.

Please help me.......


texts: How to add prefix in order code in magento by payment methods

texts:
I need to add prefix in order number in magento.
Like If Order is Cash On Delivery Based then order no should to be like...
cod12332434343....
if order is prepaid..then it should be
pre12323233223 .... like this

if order is check/moneyorder then it should be....
cmo12121212121.....
For this i want to know that....how to add prefix in magento order number....before order create ....and saved in database.....


texts: Magento Multiple Store not showing products on 1 out of 3 storefronts - tried the checklist.

texts:
I have a multiple magento store with 3 x storefronts. 2 are working fine, the other is not showing any products in categories.

I have done all the checklists, made sure they are in stock, allocated to the website, reindexed, to no avail. They show in the other storefronts correctly.

I have tried changing theme to a RWD but they still dont show. Imported currency as above.

disabled / re enabled product
out of stock / in stock
even checked database to make sure the product has the correct website id.

They show in the category admin page as being in that category.

Any advise would be greatly appreciated? 2 days now of clicking around and i'm going berserk.


texts:
I'm getting constant errors as the below message but I'm not sure where to start by fixing this issue:

  [2016-12-15 02:35:01] setup-cron.ERROR: Could not locate
  magento/magento2-base/composer.json file.


texts: Memory leak when using OrderItemCollection

texts:
I'm trying to execute some backend logic via ajax that requires using the Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory collection factory.
When I use ->getColumnValues('<some column>'), I run out of memory if I don't set the php memory limit at 2GB. Most importantly, the memory doesn't clean itself out after code execution.
Before execution:

During execution:

After execution:

The controller in question:
<?php

namespace ...

use Magento\Sales\Model\ResourceModel\Order\Item\CollectionFactory as OrderItemCollectionFactory;

class Statistics extends Action
{

    public function __construct(
        ...
        OrderItemCollectionFactory $orderItemCollectionFactory,
        ...
    )
    {
        parent::__construct($context);
        ...
        $this->_orderItemCollectionFactory = $orderItemCollectionFactory;
        ...
    }

    public function execute()
    {
        $product_ids = $this->getBrandProductIds();
        $json = $this->_jsonFactory->create();
        return $json->setData([
            'test' => $this->_orderItemCollectionFactory->create()
                ->addFieldToFilter('product_id', ['in' => $product_ids])
                ->getColumnValues('order_id')
        ]);
    }
}