texts: Use Custom HTML in Edit form Adminhtml magento 2

texts:
I have Custom Edit page in Adminpanel as below:

Above Reply textbox, I want to show other records from my custom table in custom HTML format. but not sure how can i use custom html format there!!

My edit page code:

<?php

namespace Vendor\Module\Block\Adminhtml\Items\Edit\Tab;

use Magento\Backend\Block\Widget\Form\Generic;
use Magento\Backend\Block\Widget\Tab\TabInterface;

class Reply extends Generic implements TabInterface
{
    protected $_wysiwygConfig;
    protected $layoutFactory;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\Data\FormFactory $formFactory,
        \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig,
        \Magento\Framework\View\LayoutFactory $layoutFactory,
        array $data = []
    )
    {
        $this->_wysiwygConfig = $wysiwygConfig;
        $this->layoutFactory = $layoutFactory;
        parent::__construct($context, $registry, $formFactory, $data);
    }

    /**
     * {@inheritdoc}
     */
    public function getTabLabel()
    {
        return __('Replies');
    }

    /**
     * {@inheritdoc}
     */
    public function getTabTitle()
    {
        return __('Replies');
    }

    /**
     * {@inheritdoc}
     */
    public function canShowTab()
    {
        return true;
    }

    /**
     * {@inheritdoc}
     */
    public function isHidden()
    {
        return false;
    }

    /**
     * Prepare form before rendering HTML
     *
     * @return $this
     * @SuppressWarnings(PHPMD.NPathComplexity)
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    protected function _prepareForm()
    {

        $model = $this->_coreRegistry->registry('current_custom_items');

        $updates = $this->_coreRegistry->registry('current_custom_updates');

   /**** In $updates i get Collection of records which i want to show above Reply textbox ***/

        /** @var \Magento\Framework\Data\Form $form */
        $form = $this->_formFactory->create();
        $form->setHtmlIdPrefix('item_');
        $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Replies ')]);

        if ($model->getId()) {
            $fieldset->addField('id', 'hidden', ['name' => 'id']);
        }

        $fieldset->addField(
            'Reply',
            'textarea',
            [
                'name' => 'comment',
                'label' => __('Reply'),
                'title' => __('Reply'),
                'required'  => true
            ]
        );

        $form->setValues($model->getData());
        $this->setForm($form);
        return parent::_prepareForm();
    }
}


texts: Magento 2.3.0 product urls end with .html.html

texts:
I noticed some of my products had an extra .html at the end.
SQL query:
UPDATE url_rewrite SET request_path = REPLACE(request_path, '.html.html', '.html');
MySQL said: Documentation
1062 - Duplicate entry 'master-sets.html-1' for key 'URL_REWRITE_REQUEST_PATH_STORE_ID'
Any help?


texts: uploaded sample data after the magento-1.9 installation, godaddy VPS

texts:
There has been an error processing your request
SQLSTATE[HY000] [1045] Access denied for user 'dev_bechnus'@'localhost' (using password: YES)

Trace:

0 /home/dev/public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php(109): Zend_Db_Adapter_Pdo_Abstract->_connect()
1 /home/dev/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(320): Zend_Db_Adapter_Pdo_Mysql->_connect()
2 /home/dev/public_html/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
3 /home/dev/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
4 /home/dev/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
5 /home/dev/public_html/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
6 /home/dev/public_html/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
7 /home/dev/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
8 /home/dev/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
9 /home/dev/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
10 /home/dev/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
11 /home/dev/public_html/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
12 /home/dev/public_html/app/code/core/Mage/Core/Model/Config.php(1348): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
13 /home/dev/public_html/app/code/core/Mage/Core/Model/Config.php(1380): Mage_Core_Model_Config->getModelInstance('core_resource/w...', Object(Mage_Core_Model_Resource_Website))
14 /home/dev/public_html/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
15 /home/dev/public_html/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
16 /home/dev/public_html/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
17 /home/dev/public_html/app/code/core/Mage/Core/Model/App.php(608): Mage_Core_Model_Abstract->getCollection()
18 /home/dev/public_html/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
19 /home/dev/public_html/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
20 /home/dev/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
21 /home/dev/public_html/index.php(87): Mage::run('', 'store')
22 {main}


texts: How to get product parent category id and category id separatly in magento 2.2.6 using product ID?

texts:
Problem definition:

I have product under below category:

Beauty --> Sun --> my-some-product-name.

where 'Beauty' is root category and 'Sun' is the subcategory of 'Beauty'.

Currently, I am trying to get root category id and subcategory id of product separately.

How to get above data in Magento 2.2.6 product ID?


texts: Checkout page is not loading in Magento 2.2.4

texts:
When customer login in checkout page not loading and getting below error,
Uncaught Error: Mismatched anonymous define() module: function(t){"use strict";var e,n,i=function(){return"".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}

but after refresh 2 times getting checkout page properly.
any solution on this


texts:
I am using Magento 2.2.2 with the theme. Initially, everything worked fine. Suddenly it shows the error.

Fatal error: Uncaught Error: Call to a member function unserialize() on null in /var/www/html/4061/vendor/magento/module-swatches/Helper/Data.php:160 Stack trace: #0
/var/www/html/4061/vendor/magento/module-swatches/Helper/Data.php(543): Magento\Swatches\Helper\Data->populateAdditionalDataEavAttribute(Object(Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor)) #1
/var/www/html/4061/vendor/magento/module-swatches/Model/Plugin/Configurable.php(53): Magento\Swatches\Helper\Data->isVisualSwatch(Object(Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor)) #2
/var/www/html/4061/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Swatches\Model\Plugin\Configurable->afterGetUsedProductCollection(Object(Magento\ConfigurableProduct\Model\Product\Type\Configurable\Interceptor), Object(Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product\Collection\Interceptor), Object(Magento\Catalog\Model\Product\Interceptor)) #3
/var/www/html/4061/vendor/magento/framework/Intercepti in /var/www/html/4061/vendor/magento/module-swatches/Helper/Data.php on line 160


texts:
I  upload the data local to server . I changed env.php file and also change core_config_data table but when I run url on server it gives me 500 server error. while on local its run perfectly. can any one help me?

Error Like Below:

Fatal error: Uncaught Magento\Framework\Exception\LocalizedException: Can't create directory /var/www/html/magento2/var/generation/Magento/Framework/App/ResourceConnection/. in /var/www/html/magento2/vendor/magento/framework/Code/Generator.php:103 Stack trace: #0 /var/www/html/magento2/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\\Framewo...') #1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\\Framewo...') #2 [internal function]: spl_autoload_call('Magento\\Framewo...') #3 /var/www/html/magento2/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\\Framewo...') #4 /var/www/html/magento2/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Framewo...') #5 /var/www/html/magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(71): Magento\Framework\ObjectManager\Definition\Runt in /var/www/html/magento2/vendor/magento/framework/Code/Generator.php on line 103

I am using magento version: 2.0.2


texts: Blank div is taking &nbsp in magento 1.9

texts:
I've created a custom page in magento 1.9 and there I am using a blank div

when I'm refreshing my page it's taking &nbsp like

&nbsp;

Someone would tell me why is this happening.


texts:
I have two store views with store codes en and mx.  Store ids 1 & 2. This exception only happens if I save or update a product in english or spanish store  views. Saving in default store view gives no exception.  It seems to be coming from Magento core according the this stack trace.  How can I debug this of fix it?

Mage_Core_Model_Store_Exception in /home/xxxx/public_html/app/code/core/Mage/Core/Model/App.php:977
Stack trace:
#0 /home/xxxx/public_html/app/code/core/Mage/Core/Model/App.php(582): Mage_Core_Model_App->throwStoreException()
#1 /home/xxxx/public_html/app/code/core/Mage/Catalog/Model/Abstract.php(124): Mage_Core_Model_App->getStore('modules')
#2 /home/xxxx/public_html/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php(112): Mage_Catalog_Model_Abstract->getStore()
#3 /home/xxxx/public_html/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php(137): Mage_CatalogInventory_Model_Stock_Status->assignProduct(Object(Mage_Catalog_Model_Product), 1, NULL)
#4 /home/xxxx/public_html/app/code/core/Mage/CatalogInventory/Model/Observer.php(29): Mage_CatalogInventory_Model_Stock_Item->assignProduct(Object(Mage_Catalog_Model_Product))
#5 /home/xxxx/public_html/app/code/core/Mage/Core/Model/App.php(958): Mage_CatalogInventory_Model_Observer->addInventoryData(Object(Varien_Event_Observer))
#6 /home/xxxx/public_html/app/code/core/Mage/Core/Model/App.php(945): Mage_Core_Model_App->_callObserverMethod(Object(Mage_CatalogInventory_Model_Observer), 'addInventoryDat...', Object(Varien_Event_Observer))
#7 /home/xxxx/public_html/app/Mage.php(259): Mage_Core_Model_App->dispatchEvent('catalog_product...', Array)
#8 /home/xxxx/public_html/app/code/core/Mage/Core/Model/Abstract.php(145): Mage::dispatchEvent('catalog_product...', Array)
#9 /home/xxxx/public_html/app/code/core/Mage/Catalog/Model/Product.php(381): Mage_Core_Model_Abstract->_afterLoad()
#10 /home/xxxx/public_html/app/code/core/Mage/Core/Model/Abstract.php(116): Mage_Catalog_Model_Product->_afterLoad()
#11 /home/xxxx/public_html/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(41): Mage_Core_Model_Abstract->load(39)
#12 /home/xxxx/public_html/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php(171): Mage_Adminhtml_Catalog_ProductController->_initProduct()
#13 /home/xxxx/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(278): Mage_Adminhtml_Catalog_ProductController->editAction()
#14 /home/xxxx/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(200): Mage_Core_Controller_Varien_Action->dispatch('edit')
#15 /home/xxxx/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(116): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#16 /home/xxxx/public_html/app/code/core/Mage/Core/Model/App.php(189): Mage_Core_Controller_Varien_Front->dispatch()
#17 /home/xxxx/public_html/app/Mage.php(414): Mage_Core_Model_App->run(Array)
#18 /home/xxxx/public_html/index.php(83): Mage::run('', 'store')
#19 {main}

Here's  App.php:977

public function getAnyStoreView()
{
    $store = $this->getDefaultStoreView();
    if ($store) {             <-------line 977
        return $store;
    }
    foreach ($this->getStores() as $store) {
        return $store;
    }
}

Here's lines 581, 582 , 583 in App.php:

    if (!$store->getCode()) {
        $this->throwStoreException();
    }

Here's 122, 123,124, 125 in Abstract.php:

public function getStore()
{
    return Mage::app()->getStore($this->getStoreId());
}


texts: Magento 2 , How to avaid load() in loop?

texts:
I have created the custom module with an inline edit in the grid, all working fine. once I have running phpsniffer with the EcgM2 standard, I get this warning:

Model LSD method load() detected in loop


texts: Catalog Price Rule will not activate after 1.8.1.0 upgrade

texts:
After upgrading Magento from 1.7.1.0 to 1.8.1.0 I have created a new catalog category price rule > save & apply > flushed cache = No Change to the category?

I see that this has already been raised here but this doesn't not work for me.


texts: How to add Datatie input and color picker to dynamic form in configuration

texts:
I want to add a dynamic form. I defined it in system.xml
<group id="config_first_default_dynamic_form" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
  Quantity Ranges
  <field id="config_default" translate="label" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="1">
    Ranges
    <frontend_model>Vendor\Module\Model\Config\FirstLabel</frontend_model>
    <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
  </field>
</group>

In FirstLabel.Php
/**
 * @return void
 */
public function _prepareToRender()
{
    $this->addColumn(
        'enabled_from',
        [
            'label' => __('Select date from'),
            'class' => 'required-entry',
            'renderer' => $this->getDateFromColumnRenderer(),
        ]
    );
    $this->addColumn(
        'background_color',
        [
            'label' => __('Select background color'),
            'class' => 'required-entry',
            'renderer' => $this->getColorBackgroundColumnRenderer(),
        ]
    );
    $this->addColumn('logo', ['label' => __('Logo'), 'size' => '100%', 'class' => 'required-entry']);
    $this->addColumn(
        'flag_show_selector',
        [
            'label' => __('Selected categories'),
            'class' => 'required-entry',
            'renderer' => $this->getCategoryColumnRenderer(),
        ]
    );

    $this->_addAfter = false;
    $this->_addButtonLabel = __('Add');
}

I have no problem with defining a selector or a multselect with categories:
protected function getCategoryColumnRenderer(): BlockInterface
{
    if (!$this->categoryRenderer) {
        $this->categoryRenderer = $this->getLayout()->createBlock(
            CategoryTable::class,
            ''
        );
    }
    return $this->categoryRenderer;
}

The problem appears when I want to add a color picker or datatime as a field or a field with an uploaded image. Anyone know how to add these fields to a dynamic form like in the picture below?


texts: How can I expose Magento2.2.4 on static ip address with Apache2 and Centos 6?

texts:
Actually when I digit my static ip adress remotely ( http://11.11.11.11:80 ) Magento rewrite it in htttp://localhost:80.
Is there a configuration to unchange the static ip address like http://11.11.11.11:80/products....

Thanks


texts: Shopping cart rule: first product 50% off (only first product) - How do I?

texts:
we are trying to set-up the following rule

50% discount on your first (any) T-shirt

So when you buy 1 or 2 T-shirts you get 50% discount on the first product only. Can this be done?

I managed setting up the rule as below. This works for 1 SKU. When I add 1 or 2 the discount is always (only) 50% on the first product.

But now when I add another SKU: then the rule is fired all over again. And now the 50% discount is also applied to the second SKU

It needs to be applied only to the first (or any first) SKU, then stop ...

Many thanks!


texts: How to fix gross prices with Magento CE 1.8.1

texts:
we have the problem that with the new EU guideline for salestaxes, the product gross prices have to be fixed!

We have 3 different tax rates, but every customer should pay the same gross price!

Magento only needs to show the tax rate in the order overview and invoice, but should not calculate a new price based on the 3 different tax rates.(Like it is when I choose the backend option "Tax calculation based on" = "billing address")

Just found out that there is an extention for Magento 1.7 and older and that there is a backend option in Magento 1.9 called "Cross-Border Price Consistency"to handle the problem.

But I need a solution for Magento 1.8.1

Any idea?


texts:
I need to create a query with searchCriteriaBuilder with this condition:

WHERE visibility = [value] AND status = [value] AND ((category_id = [value] AND designer = [value]) OR (category_id = [value]))

How can create this type of query using: FilterBuilder, FilterGroupBuilder and SearchCriteriaBuilder?


texts: Remove qty_invoice Programmatically from product on order

texts:
I'm trying to remove the qty_invoice amount for the products on the order

$incrementId = 300085393;

$order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);

foreach ($order->getAllItems() as $item) {
    $item->setData('qty_invoiced', 0);
}


texts: Magento 1.9 REST API getting problem when trying to get data

texts: I am using Magento 1.9, REST API getting problem when trying to get data using API. Here is the screenshot . If any one here to help. it's ok on guest user and customer user but problem on admin .


texts: Export Products screen is not showing all attributes

texts:
We have a site running Magento ver. 1.7.0.2.  On the Export admin screen, it used to show all the available product attributes on the screen like in the screenshot below however now it only shows up until the Depth option.

Additionally to not showing all the attributes, when you click Continue it loads a white screen where it seems to die and not export anything!

I'm at a loss as to how to fix or debug the source of this problem even.  Any help or ideas?

How the screen looks now, cuts off after Depth attribute...

How the screen used to look, showing 3x more attributes


texts: Change Welcome Message Full Name to First Name

texts:
I'm trying to change the welcome message from full name to first name here is my code.

The code uses angular but I don't know how to find the custom().firstName or whatever? any idea's here?


texts: How to create two store views with different designs?

texts: I would like to create two store views. One store view that has no header and footer (I want to use this one for my mobile apps). Another store view that has header and footer (I want to use this store view for my existing e-commerce website).


texts: How do I add a new text box in magento 2 credit card payment form?

texts: I have got a customization request for Magento 2 credit card payment method. need to add a text box, the information will be passed to the payment gateway.


texts: How to remove an extension that is blocking manage categories

texts:
After clicking manage categories in the back end of magento
I have received this:

  There has been an error processing your request
  Source model "mageplaza_seo/source_robots" not found for attribute "meta_robots"

  Trace:
  #0 /home/tapisdor/public_html/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php(387): Mage::exception('Mage_Eav', 'Source model "m...')

  Error log record number: 1450270382448

I understand it has to do with an extension that I have removed. But if I removed it on magento connect manager, why is this showing up?


texts: Magento 2: How to add some data into checkout session?

texts:
I have successfully added new checkout form, following the instructions are given on:

http://devdocs.magento.com/guides/v2.1/howdoi/checkout/checkout_form.html

When I submit the form i get the data in,

/*global define*/
define([
    'Magento_Ui/js/form/form'
], function(Component) {
    'use strict';
    return Component.extend({
        initialize: function () {
            this._super();
            // component initialization logic
            return this;
        },

        /**
         * Form submit handler
         *
         * This method can have any name.
         */
        onSubmit: function() {
            // trigger form validation
            this.source.set('params.invalid', false);
            this.source.trigger('customCheckoutForm.data.validate');

            // verify that form data is valid
            if (!this.source.get('params.invalid')) {
                // data is retrieved from data provider by value of the customScope property
                var formData = this.source.get('customCheckoutForm');
                // do something with form data
                console.dir(formData);
            }
        }
    });
});

Now I want to add this formData in checkout session so that I can insert my custom fields in DB when the user places the order. Where and How should I make the HTTP call?


texts: Call a parent's parent method without calling the parent's method. parent::parent::method()?

texts:
I have an extension that has a block class that extends

Mage_Catalog_Block_Product_List_Toolbar

The extension has its own getPagerHtml(), which calls parent::getPagerHtml() at the end.

I need to make some modifications to this method in my extension, so I did a rewrite of the class in my own module, extended the class, and adding my own getPagerHtml() to it. The problem is in my class rewrite here, I need to call Mage_Catalog_Block_Product_List_Toolbar::getPagerHtml() without calling the extension's getPagerHtml(). I basically need to do something like parent::parent::getPagerHtml()

Obviously I can't modify the files in the extension. What would be the best approach to accomplish this?


texts: How to get product id in product detail page

texts:
How to get product ID in Magento_Catalog/template/view/my_custom_template.phtml file?

Trying this one:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');

But not working!


texts: Retrieve comparable attributes for a product using product_id

texts:
I want to get the comparable attributes for a product but without the help of the compare session.

I have product id and I need the list of comparable attributes that are associated with the product


texts: cart rule condition based on price including tax

texts:
I want to create a rule that gives people a discount of 10% if the subtotal of the cart is over $100.

I have this rule working but with one problem, to check weather the cart is over $100 it is using the subtotal without tax were I want it to use the subtotal with tax.

The condition I am using is pictured below.

I have looked into changing Configuration -> Sales -> Tax settings but most of these settings are already set how I need them for the rest of the site. There are also some products with and without tax so I cannot try and cheat my way by using a lower number.


texts: Magento 2 Add extension attributes in Quote Item

texts:
I want to add custom attribute in quote items Magento\Quote\Api\Data\CartItemExtensionInterface

<extension_attributes for="Magento\Quote\Api\Data\CartItemExtensionInterface">
    <attribute code="cust_price" type="float" />
</extension_attributes>

I did this doesn't know how to proceed further.
Dont know which plugin i have to use to accept and set attribute data
I have run API for add item

POST : rest/V1/carts/mine/items?cart_id=27333

{
"cartItem":
    {
        "sku": "SCC010010000",
        "qty": 1,
        "price": 15,
        "quote_id": "27333",
        "extension_attributes": {
            "cust_price" : 25
        }
    }
}

And error is Property \"CustPrice\" does not have corresponding setter in class \"Magento\\Quote\\Api\\Data\\CartItemExtensionInterface\".


texts: How to implement Plugin concept in magento2

texts:
I want to implement plugin after, before and around concept in my Magento 2 website.

di.xml :

<type name="Magento\Webapi\Model\Soap\Server">
    <plugin name="soap_log" type="training\learning\Model\Webapi\Soap\Server" />
</type>

Magento\Webapi\Model\Soap\Server has a method _checkRequest and it has a string type parameter.

Now i want to get that string type parameter in my _aftercheckrRequest in training\learning\Model\Webapi\Soap\Server class. How can I achieve this ?


texts: Magento 2 Set Default Zip/Postal Code in cart page

texts:
I have overridden the vendor/magento/module-checkout/Block/Cart/LayoutProcessor.php in my module and added below code to set the default value of postcode

 class LayoutProcessorPlugin
 {
    public function afterProcess(LayoutProcessor $subject, array $jsLayout)
    {
       $jsLayout['components']['block-summary']['children']['block-shipping']['children']['address-fieldsets']['children']['postcode']['value'] = '90091';
      return $jsLayout;
    }
 }

But somehow when visiting the cart page it is not filling the default value in the 'Zip/Postal' field. Can someone tell me how to achieve this? I guess some knockout js code overrides this value. I don't know where I need to set this.


texts: "The requested quantity is not available" Back Order Products

texts:
My store has backorders enabled, everything works as expected when dealing with a quantity of 1 for each product that is available for backorder.

The problem is that when a customer tries to enter a value greater than 1 on the product page or the cart page the error:

  The requested quantity is not available

There are no errors logged, products that are In Stock allow for the quantities to be updated (provided that there are enough).

Has anyone had this issue and what can I do to resolve it?


texts: No such entity with customerId = when placing order from admin panel in amgento2

texts: This is the error I am facing .Please help


texts: Custom development of product configurator

texts:
I am looking to develop an extension to be applied on Magento website and Mobile App (IOS and Android) as the following :

Client must choose the character that will appear wearing the shirt (he must choose the character like Arabic, European, African, .....)  so let me know if you consider this in the tasks

Admin will create custom options (fabric, fit, collar, cuff, initials) for each product.
Admin will be able to upload images for above each custom option.
We will display the images for each custom options on front-end.
The product would be configurable so the customer will select from all alternatives available for each custom option
Customer can zoom in/zoom out the designed image and can rotate on 360 degree view.
Once customer is done with design part then he/she can review the complete design in pop-up.
After that customer can proceed to checkout.
Once order is placed then admin can view the design attached with order and download the PDF/JPG/PNG.

Note 1 : How will the admin  upload the images for shirts to use in 360 degree view.

how many images for each product should the admin upload to have 360 degree view ??
should the admin upload only images to one model and then can apply changes in the fabric, collar, cuff, initials on this model ??  Or should he upload images for each shirt as a stand alone shirt ??
What about having 2 images for the model ; one for the front and other for the back and make some kind of switching ??
If the admin will upload images for one model to be applied on other choices, how can we show extra features on this model, when he changes the collar as example, how can we show this change on the model . Does that mean that we have to upload two images here ??

Note 2 : There would be two images for each custom options (one for display the custom option and other for shirt to display how product will look like).

Finally, will this module be used as extension to be applied on Magento E-Commerce website and also Mobile App (IOS and android) ? will you support us in this ?


texts:
I set the customer cookie to 1 year (525600) under stores/config/customer/customer config for both Online Minutes Interval and Customer Data Lifetime.
Magento still logs my customers out after 15 minutes.
I tried changing session.gc_maxlifetime from it's default 1440 to 525600 and it didn't do anything.
I then tried changing session.cookie_lifetime to 525600, and that throws up errors, and breaks the application.
I tried changing my app/etc/env.php "session" to
   'session' => [
        'save' => 'files'
        'save_path' => /var/session
    ],

I use /pub as doc root, so I created a var/seccion directory in /pub, but that didn't change anything.
How can I keep my customers logged in for a long time without breaking my site?
Thank you


texts: Assign credit to particular customer type

texts:
I have requirement like this.

there are two types of customer groups (retailer,distributor).
If retailer want to buy any products he need to pay.

Where as distributor contain some credit for example $100.

So he can place the order with in that limit.

My thinking for this :
Step1:create custom attribute credit_limit to customer account.

step2:create custom payment method called distributor credit payment.

step3:Validate the credit limit  through override following method in Mage_Payment_Model_Method_Abstract class

public function canOrder()
    {
        return $this->_canOrder;
    }

or

 public function isAvailable($quote = null)
    {
        $checkResult = new StdClass;
        $isActive = (bool)(int)$this->getConfigData('active', $quote ? $quote->getStoreId() : null);
        $checkResult->isAvailable = $isActive;
        $checkResult->isDeniedInConfig = !$isActive; // for future use in observers
        Mage::dispatchEvent('payment_method_is_active', array(
            'result'          => $checkResult,
            'method_instance' => $this,
            'quote'           => $quote,
        ));

        if ($checkResult->isAvailable && $quote) {
            $checkResult->isAvailable = $this->isApplicableToQuote($quote, self::CHECK_RECURRING_PROFILES);
        }
        return $checkResult->isAvailable;
    }

step4:after placing the order update credit_limit for customer by observer.

Is it right direction? step3 which method i need to override?
any simple way is there?
Thanks in advance.


texts: Magento 2 How to stop particular group cron?

texts: I runned cron command, now all cron group are running. But I wanted to stop my custom group cron. Please tell me how to stop it?


texts: Magento 2 Get Helper Of Default Magento Shipping

texts: I suppose I need to find Helper/Data method to get Magento Shipping->Ship To Specific Countries selected countries list. Where do I find it?


texts: How to create custom module with inhertit the Customer registration fields to my module page - Magento 2?

texts:
i want to copy the customer registration fields to my custom module page

can i copy

vendor/module/customer

to my module

or else
how i can inherit to my page

Note:
All the attributes are value stored customer account


texts: Are we able to remove tax when editing order

texts: I would like to be able to remove country-based tax from specific orders for customers if they show proof that the orders are for export. However, it seems like I am unable to remove the tax when editing orders.


texts: Magento 2 - Get a level descending category collection for path to product for breadcrumbs

texts:
I want to have the breadcrumbs show on product pages even when searched or accessed directly.

As my pages cache are all warmed up via sitemap this basically removes breadcrumbs in my case as they seem to be part of the full page cache.

My main issue is getting a collection of categories related to a product ordered by level. This also needs to only show one path to the product (probably just the first that magento finds and limit to 1).

e.g.

//Problem 1 this pulls categories from all the stores
$categoryIds = $product->getCustomAttribute('category_ids');
//These is probably a better way to do this but had to build the array for collection to work
foreach ($categoryIds->getValue() as $categoryId) {
    $catIdArray[] = $categoryId;
}

//get the category collection based on categories that product is listed in
$categories = $this->categoryFactory->create()
                        ->addAttributeToFilter('entity_id', $catIdArray)
                        ->setStore($this->_storeManager->getStore());
//filter to just the top level category (deepest)
$categories = $categories->getSelect()->order('level DESC')->limit(1);
//get the top level category and get all parents get first item not working
$categorieslist = $category->getFirstItem()->getParentCategories();
//then i will use this collection to loop through and create breadcrumbs

This does not seem to be filtering by store as $categoryIds = $product->getCustomAttribute('category_ids'); pulls all categories for each store.
$categories = $categories->getSelect()->order('level DESC'); gives an empty collection.
GetFirstItem() does not work here.

Not sure how to get the above code to work as above was a bit of a guess.


texts:
I was working with PHP Core and custom MVCs by 1 and half years until when moved to magento desk.

I find it very difficult first, but later got grip in Theme integration and maintenance of previously done modules. Now I got in to Module creation and really confused with the architecture.

In frank, Everytime when I write a new code, It works well, but later edited out wasting so much time of seniors since It does not met completely with Magento's coding style.

For an example, when I need to check something and update a database, I writes,

<?php
$resource = Mage::getSingleton('core/resource');
$readConnection = $resource->getConnection('core_read');
$query = "SELECT ststus FROM table WHERE Id='".$id."'";
$select_query = $readConnection->fetchOne($query);
$update_value= $select_query[0];
if($update_value=='2')
{
$writeConnection = $resource->getConnection('core_write');
$query = "UPDATE table SET field_name='C' WHERE Id='".$id."'";
$writeConnection->query($query);
}
?>

This is later changed to simply this,

foreach ($dealroomIds as $dealroomId) {
                $manufacturers = Mage::getSingleton('module/module')
                    ->load($dealroomId)
                    ->setStatus($this->getRequest()->getParam('status')); //getting status
                    if($this->getRequest()->getParam('status')=='2'){
                    $manufacturers->setRunningStatus('C'); // setting new status
                    }
                $manufacturers->setIsMassupdate(true)
                    ->save();
                Mage::getSingleton('dealroom/deals')->UpdateDealProducts($dealroomId); // Update
                    }

The above given is just an example and nothing more than that.

To know more about the coding style and standard, I think is neccessory to know more about

Block
controllers
Model
Helper
Data

I searched but whatever I read and understand is just far away from the basic. If anyone point out the connections and functions of these, it will be helpful to me.


texts:
Can I use Regex in the URL Redirect section in Magentos backend? Or any wildcards?

Thanks


texts:
Notice: Undefined offset: 90 in
  /opt/lampp/htdocs/magento2/vendor/magento/module-eav/Model/ResourceModel/ReadHandler.php
  on line 167

Above error I'm getting. What should I do?


texts:
I need to calculate the total price of my bundle and if the required option of this bundle have promo I need to print the price before the promo and after on catalog/view.

For that I have : (helper)

public function bundleItemsPromo($product) {
    $productId = $product->getId();
    $bundled_product = Mage::getModel('catalog/product')->load($productId);

    $selectionCollection = $bundled_product->getTypeInstance(true)->getSelectionsCollection(
        $bundled_product->getTypeInstance(true)->getOptionsIds($bundled_product), $bundled_product
    );

    $bundled_items_reduct = 0;
    $price = 0;
        foreach($selectionCollection as $option)
        {
            if($price < $option->getPrice()) {
                $price = $option->getPrice();
                if ($option->getSpecialPrice()){
                    $bundled_items_reduct += $price - $option->getSpecialPrice();
                }
            }
        }

    return $bundled_items_reduct;
}

In my foreach I just need calculate the promo only if the product is required
I tried:

$bundled_product->getTypeInstance(true)->getSelectionsCollection(
        $bundled_product->getTypeInstance(true)->getOptionsIds($bundled_product), $bundled_product
    )->hasRequiredOptions()

but...

If you have an idea?


texts: Random products added to order after checkout

texts:
As stated in the title, after completing checkout on a test order and checking the order within the admin panel, the test order has random products added to it. What really confuses me is that the added items aren't in the product catalog, so I'm not entirely sure where they're coming from. They only show in the order after checking out.

Additionally, the customer inputted address isn't showing and is replaced by a default Magentech address. Obviously I would like orders to reflect what the customer has inputted so that I can ship their items to them.

I'm new to magento and taking over the work of another developer, any information that helps lead to a solution would be greatly appreciated. Thank you!


texts: Magento 2 : product is adding twice when disable add to cart ajax

texts:
When I disable the add to cart through ajax

  Stores > Configuration > Sales > Checkout > After Adding a Product Redirect to Shopping Cart

the user can click multiple times on the add to cart button on products pages (before to be redirected to cart) and it's adding the product multiple times to its cart.

Is there any way to fix this ?

Thanks !


texts: Magento 2 - what full page caching software should I use if I plan to use HTTPS?

texts:
I have been reading the documentation for using Varnish on my magento website but I plan to use HTTPS both on front-end and on the back-end.
According to the documentation pages, Varnish cannot be used with HTTPS, probably because the pages get encrypted before being passed to varnish for caching, and I'd like to know if there's anything I use to perform full-page caching with HTTPS on the front end.


texts:
I need to include search by product tags in the default catalog search in magento,
I thought of hooking the catalog search with any event related to it, but could not find any event where i can detect if the search keyword is a tag or not,Is there any event for that? or do i need to rewrite the classes?
System Configurations -> Catalog->Catalog Search, i have selected fulltext as Search type.


texts: Any category created does not show the title Correctly

texts:
i have a problem, any category created in my store not show the correct page titles, for example:
Page title in category: "Smartphone Sony"
What appears in the title of the page ....: "sign in now by clicking here"

What can be? I'm using the default theme, and the files are unchanged. researching I realized I could be the file catalog/category/view.phtml on line 43:

    <?php if($this->IsRssCatalogEnable() && $this->IsTopCategory()): ?>
        <a href="<?php echo $this->getRssLink() ?>" class="link-rss"><?php echo $this->__('Subscribe to RSS Feed') ?>
    <?php endif; ?>

<?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?>

But it is typical .... what can it be? thank you


texts: What Triggers the Generation of a Proxy in Magento 2

texts:
From This link
Proxy are something like lazy loading, but how Magento 2 knows it needs to generate a proxy class
and which class has a proxy ?


texts:
I created a wholesale registration form some time ago which when paired with Vinai_CustomerActivation module allowed anyone interested in a wholesale account to register and wait for their account to be activated... it worked perfectly for quite some time but all of a sudden whenever you fill in the wholesale registration form it is creating a general account..

I've got the following inside the  tag on the wholesale registration form

<input type="hidden" name="group_id" id="group_id" value="2"/>

Is there anything that could of caused that to be ignored? I tested it on multiple occasions and it worked but now for the last couple of days it doesn't work

I've also got this in the _getCustomer function in AccountController.php

  if($this->getRequest()->getPost('group_id'))
     { $customer->setGroupId($this->getRequest()->getPost('group_id'));
     } else {
    $customer->getGroupId(); }

            return $customer;
        }

Any help would be appreciated


texts: How to Implement Tax Rules based on presence of VAT

texts:
My store's tax rules should be very easy to set up, but I'm having extreme difficulty finding a way to implement the logic I need.

We are based in Florida, so none of our customers will be charged tax unless they are shipping to the state of Florida. Some of our Florida customers are re-sellers and are exempt from tax.

How can I set up my tax logic like this:

IF (customer is in Florida) {
    THEN IF (customer has VAT) {
        No tax charged
    } ELSE (customer does not have VAT) {
        7% tax is charged
} ELSE (not in Florida) {
    No tax charged
}


texts: Magento 2: How to add edit cart option on order summary on checkout page?

texts:
I want to add custom link in order summary on checkout page in magento. I have tried several options but doesn't work.

Is there any solution for this.

Like the following image:


texts: When and where is a plugin called / fired / triggered?

texts:
If I have a plugin for after a customer is saved eg

<type name="Magento\Customer\Model\ResourceModel\CustomerRepository">
    <plugin name="Module_CustomerAfterSave" type="Vendor\Module\Plugin\CustomerAfterSave" sortOrder="10" disabled="false"/>
</type>

Is it possible to know when and where the save came from? Eg did it come from when the customer registered? Did it come from the customer updating their name or did it come from the admin updating the customer


texts: Magento2: Gift Option form is not coming for Virtual and Downloadable product on cart page

texts: I am having issue that Gift Option form is not coming for Virtual and Downloadable products on cart page while its coming for the simple products.


texts: Magento2 How to get login, Register and whishlist links

texts:
I need to modify Magento2 form.mini.phtml to have Login, Register and Wishlist links. And after wishlist link, I need to display product count which are in the wishlist after login.

I know how to do this on Magento 1x but I'm confused how to get them on Magento 2.


texts: Adding Grouped Product in Bundle Products in magento 2.1

texts: Can I add a grouped product into a bundled product in Magento 2.1? Is it possible?


texts: How to display stock information to logged in customer only in Magento 2?

texts: I want to display stock only to logged in customers. can you guide me how can I do?


texts: Why is Less_Parser::getCss() still happening in production mode Magento 2?

texts:
When looking at a profile on why Magento 2 is super slow, I see that Less_Parser::getCss() takes 47 seconds.

Why is the server parsing LESS in production mode?

I am using magento 2.1.3.

I am also using an aftermarket theme called Porto


texts: Submenus is not adding in Report parent menu in magento admin

texts:
In am trying to add a custom submenu in Reports->Products->Stock Status as shown in below image--

Here is my adminhtml.xml file--

<?xml version="1.0"?>
<config>
    <menu>
      <report>
         <children>
            <products>
                <children>
                   <stockstatus translate="title" module="stockstatus">
                     <title>Stock Status</title>
                     <action</action>
                     <sort_order>10</sort_order>
                   </stockstatus>
                </children>
            </products>
         </children>
      </report>
    </menu>

    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
              <children>
                    <report>
                        <children>
                           <products>
                              <children>
                                <stockstatus>
                                   <title>Stock Status</title>
                                </stockstatus>
                              </children>
                           </products>
                        </children>
                    </report>
               </children>
            </admin>
        </resources>
    </acl>
</config>

What is wrong there ? I am not getting submenus there.


texts: Adding to Cart programmatically is adding to the wrong Store?

texts:
I'm trying to add to cart programmatically from store 2, but it's adding products to store 1. How can I force it to add to the correct store?

This is the code I've got in my CMS page.

include_once "app/Mage.php";
umask(0);
Mage::app();
Mage::getSingleton('core/session');

$product_id = '1658';
$qty = '1';
$product = Mage::getModel('catalog/product')->load($product_id);
$cart = Mage::getSingleton('checkout/session')->getQuote();
$cart->addProduct($product, $qty);
$cart->save();
Mage::getSingleton('core/session')->addSuccess('Art Hanging System added to cart successfully. Enjoy!');

I've tried using Mage::app()->setCurrentStore(2), but this ends up adding the success message to the 1st store still and not adding the product to either site's cart.

I've tried every way I can find or think of, but as soon as I try to specify the 2nd store, then nothing happens.

How can I specify which site's cart I'm trying to work with?


texts: Getting "The configuration file has changed. Run the "app:config:import" ...." during integration tests, after most of them ran already

texts:
We are getting the below message just after lots of integration tests already ran properly.
How can this be caused?
Configuration: /var/www/dev/tests/integration/phpunit.xml
II.........................EE.EE.                                 33 / 33 (100%)
Time: 2.45 minutes, Memory: 881.91MB
There were 4 errors:
1) Example\Foo\Test\Integration\CustomerDeactivationTest::testBar
Magento\Framework\Exception\LocalizedException: The configuration file has changed. Run the "app:config:import" or the "setup:upgrade" command to synchronize the configuration.

Edit
It seems to happen because we use
$this->login();
$this->getRequest()->setMethod(Http::METHOD_POST);
$this->dispatch('customer/account/deactivate');

In the integration test...


texts: how to show and hide field in magento admin form on change function

texts:
i need to hide form field on on change in magento admin.
I need to know that how can i show hide field with his labels in magento admin form
my form

$fieldset->addField('style_content', 'select', array(
            'label' => Mage::helper('magazine')->__('Select available Slider Styles'),
            'name' => 'style_content',
            'values' => array(
                array(
                    'value' => 'Yes',
                    'label' => Mage::helper('magazine')->__('Yes'),
                ),
                array(
                    'value' => 'No',
                    'label' => Mage::helper('magazine')->__('No'),
                ),
            ),
            'onchange'  => 'onchangeStyleShow()',
        ));


texts:
How to override collectTotals function inside

  Magento\Quote\Model\Cart\CartTotalManagement

Using plugin in Magento 2?


texts: Magento 2: How to set default items for dynamicRows component

texts:
I have a good question ;)

We have ui form component "dynamicRows". How to set dynamicaly default values? (without grid template)

On example "Custom Options" where we have custom listing but in our case we havn't external collection and use product attribute to save data by json or serialize methods, needs to get on some step data, convert, and apply to dynamicRows. I tried to do that with providers and ko binds but did not work out. Maybe somebody knows how to do this?


texts: How to show the Company Name in Header.phtml?

texts: I want to show the Company Name in Header.phtml but its working as expected. Can anyone please guide me how to display the company name in header section?


texts: How to change telephone number, check if shipping country is "India" i want to add +91 before place order only

texts:
How to change telephone number, check if shipping country is India i want to add +91 before place order only.

what i have tryed:

/skin/frontend/base/default/js/opcheckout.js

review.save() is calling when place order.

document.getElementById('billing:telephone').value="9123456";
document.getElementById('shipping:telephone').value="91234567";
billingnewsletter();  shipping.save();

using sales_order_save_before events:

$quote = Mage::getSingleton('checkout/session')->getQuote();
$billingaddress = $quote->getBillingAddress();
$billingtelephone = $billingaddress->getTelephone();
$billingaddress->setTelephone("31313131");
$billingaddress->save();

but it is not setTelephone


texts: M2: Wrong totals, if I change item customPrice after quote->collectTotals()

texts:
For example. There is 1 product in the cart with base price 35.
Working code:

foreach ($this->cart->getQuote()->getAllVisibleItems() as $item) {
    $item->setCustomPrice(11.11)
        ->setOriginalCustomPrice(11.11)
        ->getProduct()->setIsSuperMode(true);
}
// product rowTotal: 11.11
// cart subtotal/grandtotal: 11.11

NOT working code:

$this->cart->getQuote()->collectTotals(); // Attention to this line
foreach ($this->cart->getQuote()->getAllVisibleItems() as $item) {
    $item->setCustomPrice(11.11)
        ->setOriginalCustomPrice(11.11)
        ->getProduct()->setIsSuperMode(true);
}
// product rowTotal: 35.00
// product displayed price (customPrice): 11.11
// cart subtotal/grandtotal: 35.00

what I was trying to do:

$this->cart->getQuote()->collectTotals();
foreach ($this->cart->getQuote()->getAllVisibleItems() as $item) {
    $item->setCustomPrice(11.11)
        ->setOriginalCustomPrice(11.11)
        ->getProduct()->setIsSuperMode(true);
    $item->calcRowTotal();
}
 $this->cart->getQuote()->setTotalsCollectedFlag(false);
/** @var \Magento\Quote\Model\Quote\Address $address */
foreach ($this->cart->getQuote()->getAllAddresses() as $address) {
    $address->setCollectShippingRates(true);
}

Unfortunately, it doesn't work.

Also it fixes if I reload cart page, but how to do it correctly without reload? What things should I re-set like $quote->setTotalsCollectedFlag(false) and $address->setCollectShippingRates(true)

And there is a question: What am I doing wrong? :)

UPDATE:

Magento version 2.2.2

It happens if quote already exists in the database (even if we have an empty cart). If I clear cookies / delete quotes from quote table, first product add doesn't proceed the trouble.


texts:
I've placed a products widget on the home page but the products aren't appearing by the set positions. For some reason, it is working on the shop page itself, but not in any widget.

Can anyone help?


texts: title mis missing in acl.xml in COZYVISION_Smsalert extension

texts:
here is my acl.xml

 <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Adminhtml::admin" >
                <resource id="COZYVISION_Smsalert::sms" title="SMS Alert" sortOrder="100">
                    <resource id="COZYVISION_Smsalert::config" title="Config" sortOrder="10" />
                </resource>
                <resource id="Magento_Adminhtml::stores">
                    <resource id="Magento_Adminhtml::stores_settings">
                        <resource id="Magento_Adminhtml::config">
                            <resource id="COZYVISION_Smsalert::sms_config" title="Configuration" />
                        </resource>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>


texts: Magento2 How To Add Multiple System Notification Using Single File

texts:
I have use below code to add admin system notification and it is working fine but it add's only single notification ,
and i want to add multiple notification's using single file

does anyone know how can i do that ?

  app\code\Vendor\Module\etc\di.xml

<?xml version="1.0" encoding="utf-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\Notification\MessageList">
        <arguments>
            <argument name="messages" xsi:type="array">
                <item name="custom_message" xsi:type="string">Vendor\Module\Model\Admin\Quote\Messages</item>
            </argument>
        </arguments>
    </type>
</config>

  app\code\Vendor\Module\Model\Admin\Quote\Messages.php

<?php

namespace Vendor\Module\Model\Admin\Quote;

use Magento\Security\Model\ResourceModel\AdminSessionInfo\Collection;
use Magento\Backend\Model\UrlInterface;
use Magento\Backend\Model\Auth\Session;
use Magento\Framework\Notification\MessageInterface;

class Messages implements MessageInterface
{

    protected $backendUrl;
    private $adminSessionInfoCollection;
    protected $authSession;

    public function __construct(
        Collection $adminSessionInfoCollection,
        UrlInterface $backendUrl,
        Session $authSession
    ) {
        $this->authSession = $authSession;
        $this->backendUrl = $backendUrl;
        $this->adminSessionInfoCollection = $adminSessionInfoCollection;
    }

    public function getText()
    {
        $message = __('Test Message 1 ');
        return $message;
    }
    public function getIdentity()
    {
        return md5('Test Message 1 ' . $this->authSession->getUser()->getLogdate());
    }
    public function isDisplayed()
    {
        return true;
    }
    public function getSeverity()
    {
      \Magento\Framework\Notification\MessageInterface::SEVERITY_CRITICAL;
    }
}


texts:
I am developing a new module which will provide access to a custom grid using left sided admin menu. The problem is that I cannot create a custom element in this admin menu.

The module is located under vendor folder, vendor/test/test-extension, with the following composer.json under module root:

{
  "name": "test/test-extension",
  "description": "test extension magento2",
  "type": "magento2-module",
  "version": "dev-master",
  "autoload": {
    "files": [
      "registration.php"
    ],
    "psr-4": {
      "Test\\TestExtension\\": ""
    }
  }
}

The module is included in autoload_psr4.php, being able to run install schema and getting models.

But, I'm not able to create a custom element in admin menu, simply it doesn't appear.

etc/acl.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Test_TestExtension::testextension" title="New Extension" sortOrder="52">
                    <resource id="Test_TestExtension::testentity" title="Entity" sortOrder="11"/>
                </resource>
                <resource id="Magento_Backend::stores">
                    <resource id="Magento_Backend::stores_settings">
                        <resource id="Magento_Config::config">
                            <resource id="Test_TestExtension::testextension_config" title="Test Extension"/>
                        </resource>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>

etc/adminhtml/menu.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Test_TestExtension::testextension" title="Test extension" module="Test_TestExtension" sortOrder="61" resource="Test_TestExtension::testextension"/>
        <add id="Test_TestExtension::testentity" title="Test entity" module="Test_TestExtension" sortOrder="11" action="test_testextension/testentity" resource="Test_TestExtension::testentity" parent="Test_TestExtension::testextension"/>
    </menu>
</config>

Any ideas ?


texts: Magento 2 - sales_order_place_after not returning Order ID

texts:
I have created an event for sales_order_place_after event.

This doesn't return Order Id. However, it returns Increment ID

public function execute(Observer $observer)
    {
        $order = $observer->getEvent()->getOrder();
        $order->getIncrementId();
        $order->getId();
    }


texts: Shopping Cart Price Rule Magento ver. 1.9.2.0

texts:
I'm adding Shopping Cart Price Rule from magento backend, and specified specific products sku which if added to cart it will be a free shipping. I'm using FedEx as the default shipping method. My problem is the Free Shipping option is not visible on checkout process.

I'm using Magento ver. 1.9.2.0 .

Please help.

Thank you,
JM


texts:
I'm looking for a way to get the product URL Key with the product ID.

Actually, I can get the product URL with this code :

$product_id = $_GET["pro"];
$_product = Mage::getModel('catalog/product')->load($product_id);
$my_product_url = $_product->getProductUrl();

But I just want the URL Key, not the complete URL.

Thanks.


texts: how to check code duplication in magento 2 Extension?

texts:
I have created a module in Magento 2 and now I am trying to submit it on Magento Marketplace.
My extension has passed from business review and Technical review but I am facing issues with QA review.

I recieved a mail from Magento marketplace stating that I had code duplication in my extension.
Below is the sample of the mail.

  Code quality issues: CPD: This extension contains duplicated code.

When I went to my product on Marketplace account, and checked the technical report, I found below.

Code Duplicates Detected

This extension contains code that is directly copied from the Magento codebase. This is in direct violation of Sections 3.1 and 9.1b of the Magento Developer Agreement.

File: vendor/module/vendor-module-1.0.0.0/Block/Adminhtml/Module/Edit/Tab/Stores.php
Line: 58
File: magento/module-checkout-agreements/magento-module-checkout-agreements-100.0.6.0/Block/Adminhtml/Agreement/Edit/Form.php
Line: 122

File: magento/module-cms/magento-module-cms-100.0.7.0/Block/Adminhtml/Block/Edit/Form.php
Line: 100
File: vendor/module/vendor-module-1.0.0.0/Block/Adminhtml/Module/Renderer/Files.php
Line: 49

File: magento/framework/magento-framework-100.0.16.0/Data/Form/Element/Image.php
Line: 86
File: vendor/module/vendor-module-1.0.0.0/Model/ResourceModel/AbstractCollection.php
Line: 2
File: magento/module-cms/magento-module-cms-100.0.7.0/Model/ResourceModel/AbstractCollection.php
Line: 6

Is there any way I can check for code duplication on my setup to avoid this issue for my other extensions?


texts: Display list of attributes from specific category?

texts:
I'm working on navigation menu in custom theme Magento web site. I would like to display a list of the specified attribute name (brand) from the specific category. The mentioned navigation menu is on the index/home page.

For example, I have a category name: "Laptops for everyday use", and I have a custom attribute name "brand_name". I would like to be able to display this as:

Laptops for everyday use:
- Asus
- Acer
- Apple
etc...


texts: Add more columns and add to basket to the grid in grouped products Magento 2

texts:
I'm trying to add more columns, with custom attributes into the frontend product grid in Magento 2.2.4

I've overridden

vendor/magento/module-grouped-product/Block/Product/View/Type/grouped.phtml

into my local module and I can get text to appear in the grid but not custom attributes.

I'm obviously missing something obvious but not sure what.

My custom product attributes consist of 3 types:
text, dropdown and multiselect
but I can't even get the text one to show up

I've also tried adding in individual row "Add To Basket" buttons and they appear but don't do anything when clicked.

I've spent days searching and can only find answers for M1.

This is an example from a website that does it quite well, not sure what engine they use

Would appreciate your help everyone


texts: Error while creating Custom Shipping Method

texts:
I am creating Custom Shipping Method in Magento.i had refered Inchoo, Excellence blog and even other blogs but everytime i get this error

Fatal error: Call to a member function setStore() on a non-object in /app/code/core/Mage/Shipping/Model/Shipping.php on line 424

Please Help Me.


texts: php bin/magento setup:static-content:deploy production site

texts:
Currently in Stores > All Stores I have one store view (Dutch).

When I do command php bin/magento setup:static-content:deploy it generates files for en_US. I know with the command php bin/magento setup:static-content:deploy nl_NL it's generating files for nl_NL.

But what is the advantage or purpose of this? Why do I have to do this exactly?


texts: Is there any extension related to tracking website URLs? URL can be shared via Whatsapp to customers, which can further be tracked how many opened the link and how many opened via WhatsApp or some other source.


texts: Display Multiple Images In Admin Edit Form Magento 2

texts:
Display Multiple Images from  database in custom admin edit form
This Is My Form.php file

  <?php

namespace Magneto\AppNotification\Block\Adminhtml\Form\Edit\Tab;

  use Magento\Backend\Block\Widget\Form\Generic;
  use Magento\Backend\Block\Widget\Tab\TabInterface;
  use Magento\Backend\Block\Template\Context;
  use Magento\Framework\Registry;
  use Magento\Framework\Data\FormFactory;
  use Magento\Cms\Model\Wysiwyg\Config;

 class Info extends Generic implements TabInterface
 {

 protected $_customerFactory;
 public function __construct(
      \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory $customerFactory,

    Context $context,
    Registry $registry,
    FormFactory $formFactory,
    array $data = []
) {
      $this->_customerFactory = $customerFactory;

    parent::__construct($context, $registry, $formFactory, $data);

}

public function getCustomerCollection()
 {
return $this->_customerFactory->create();
 }

/**
 * Prepare form fields
 *
 * @return \Magento\Backend\Block\Widget\Form
 */
 public function getCustomerdata()
  {
  $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
   $customersdata = $objectManager-
       >create('Magento\Customer\Model\Customer')
  ->getCollection()->getData();
   return $customersdata;
   }

protected function _prepareForm()
{
     $customerCollection2 = $this->getCustomerdata();

            $jp = array();
        foreach ($customerCollection2 as $customer) {
            $pp =  $customer['firstname'];
            array_push($jp, $pp);
        }
         // print_r($jp);
         //  die();

    $model = $this->_coreRegistry->registry('appnotification_appnotification');

    // die($model->getImage());
    // /** @var \Magento\Framework\Data\Form $form */
    $form = $this->_formFactory->create();

    // $form->setHtmlIdPrefix('notification_');
    // $form->setFieldNameSuffix('notification');
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
     $groupOptions = $objectManager->get('\Magneto\AppNotification\Model\Source\Customers')->toOptionArray();

    $fieldset = $form->addFieldset(
        'base_fieldset',
        ['legend' => __('AppNotification')]
    );

    if ($model->getId()) {
        $fieldset->addField(
            'id',
            'hidden',
            ['name' => 'id']
        );
    }
    $fieldset->addField(
        'title',
        'text',
        [
            'name'        => 'title',
            'label'    => __('Title'),
            'required'     => true
        ]
    );
    $fieldset->addField(
        'subtitle',
        'text',
        [
            'name'        => 'subtitle',
            'label'    => __('Sub Title'),
            'required'     => true
        ]
    );
  $fieldset->addField(
'image', 'image', [
'name' => 'image',
'note'=>"Allowed Types('jpg','jpeg','gif','png')",
'label' => __('Upload Image'),
'title' => __('Upload Image'),

    ]

);

 $fieldset->addField(
'customer_id',
'multiselect',
[
    'name' => 'customer_id[]',
    'label' => __('Customer Name'),
    'title' => __('Customer Name'),
    'values'=>$groupOptions
]
);

    $data = $model->getData();
    // print_r($data);die();
    $form->setValues($data);
    $this->setForm($form);

    return parent::_prepareForm();
}

/**
 * Prepare label for tab
 *
 * @return string
 */
public function getTabLabel()
{
    return __('AppNotification Info');
}

/**
 * Prepare title for tab
 *
 * @return string
 */
public function getTabTitle()
{
    return __('AppNotification Info');
}

/**
 * {@inheritdoc}
 */
public function canShowTab()
{
    return true;
}

/**
 * {@inheritdoc}
 */
public function isHidden()
{
    return false;
}

 }


texts: Add page number to canonical url for categories on 1.9.0.1

texts:
When I go to pages like www.my-shop.de/my-cat/page/2/ canonical url meta-tag is www.my-shop.de/my-cat/.

I would like to have the meta-tag www.my-shop.de/my-cat/page/2/.

Wasnt able to find the right place to override so this would be a great help for me if anybody can provide a file where to look first or even a complete solution.

TY


texts: Magento 2 - How can I add custom template file into ?

texts:
In magento 1.x, I can add the css files into the head using helper like below code.

<reference name="head">
    <action method="addCss"><stylesheet helper="module/helperclass/helperfunction"/></action>
</reference>

But cannot do this on Magento 2.

So now, I added this code <link rel="stylesheet" type="text/css" media="all" href="<?php echo $_helper->getCSSFile()?>"> into "after.body.start" container.

Anyone know how can I add custom template file into <head>?


texts: Magento 2.1.8 Deploy static content error

texts:
I get this error in my console when trying to deploy static files:

Compilation from source:
adminhtml/Magento/backend/en_US/css/styles.less
Unable to get content for 'adminhtml/Magento/backend/en_US/Magento_Checkout/css/source/module/_checkout.less'

I ran: rm -rf var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ but still experiencing this issue.

The Magento admin has no style.

How can I debug that? Anyone can help?

Update:

Permissions of pub/ and var/ directories:

drwxrwxrwx  8 www-data www-data   4096 Jan  8 12:55 pub
drwxrwxrwx 15 www-data www-data   4096 Jan  8 13:20 var


texts: Magento 1.9 - How to set PLP Page Sort By Ascending order in back-end?

texts: How to set sort by position Ascending order by default in the backend.


texts: How to Implement Multibuy discount in Magento 1.9?

texts:
One of the categories I'm selling are Greeting Cards. I want to offer a Buy 4 for £10 promotion, applicable multiple times within a single shop (i.e. if someone buys multiples of 4)...

But all I see is the ability to discount 4 of the same card design. I have also considered setting a price tier, but again, this only applies to the same design.

Any ideas?

Thanks for any help I get from you guys on this: I'm losing my mind..!

MisterGee


texts: Magento 2 : Editor designer background color

texts:
where can I change the colour of the editor "Designer"? I think the color is #F3F4F6, but where can I change the color or where is the file where I can change it?
I need help, thank you guys
Im using Magento Ver.-2.3.2


texts:
I need to get the breadcrumb in the controller action because I am using the cache modules(FPC and another system externally). It cached the breadcrumb in the frontend page. With that, I would use ajax to get breadcrumb dynamically for better user experience.

The ajax is ready, there's only the breadcrumb part in my controller. Here are the codes made so far:

Ajax code:

<script type="text/javascript">
    $j(document).ready(function(){
        $j.ajax({
            url: '/fol_carousel/ajax/breadcrumb',
            type: "POST",
            dataType: "json",
            success: function(retorno){
                alert(retorno);
                console.log(retorno);
            }, error: function(x,y,z){
                console.log(x,y,z);
            }
        });
    });
</script>

Controller code:

public function breadcrumbAction(){
    echo json_encode("test");
}


texts: Is it possible to refresh the varnish cache programmatically in Magento 2?

texts: I am looking for code that can clear varnish cache in Magento2. Need in the PHP script. It should not be manual.


texts: Magento 2 module file permissions and php file creation functions?

texts:
What permissions(rights) should Magento 2 module files/dir have in production environment? Can I use php functions that creates a file inside a module directory (fwrite)? I am considering writing db information to js file so the module won't make too much db requests. But I am concerned if that might cause any security threats or be against Magento development best practices?

Background:

I am creating a autocomplete search form and association with that i am considering two options from three (the third that i have sorted out is xml file generation by php):

Ajax call from database using like when customer types to input
field.
When data has changed in db Cron runs php script that replaces or generates js file from new db information. The file would be located in module directory.

I have asked similar question before, but unfortunately I could not understand the answer what i got. Also i couldn't generate a question to ask that would have made the answer more clearer for me.


texts: Magento 2 accordion in onestepcheckout does not works

texts:
I have add accordion widget to Onestep Checkout following this guide http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/widgets/widget_accordion.html but it does not works

             Indirizzo di Spedizione

        <button type="button"
                data-bind="click: showFormPopUp, visible: !isNewAddressAdded()"
                class="action action-show-popup">
            </button>


texts: Extends Dashboard customer for telephone number

texts:
I'm trying to extend Magento\Customer\Block\Account\Dashboard\Info.php file. I created a module, where I have my custom block, Info.php. I want to display the telephone number of the customer after.

<?php

namespace Portail\Customer\Block\Account\Dashboard;

class Info extends Magento\Customer\Block\Account\Dashboard\Info
{
    public function testTxt(){
        return 'bonjour';
    }
}

I have added a di.xml in etc/

<?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\Customer\Block\Account\Dashboard\Info" type="Portail\Customer\Block\Account\Dashboard\Info" />
</config>

But I have this error : Method invalid Magento\Customer\Block\Account\Dashboard\Info::testTxt


texts:
I am using magento 1.9.

I want to retrieve data from sales_flat_quote_address table in onepagecheckout, after saved the shipping method. I have used the following codes. But no result.

Code 1:

  $quote_address = Mage::getModel('sales/quote_address')->getCollection();

  $quote_address->addFieldToFilter("address_type", array("eq" =>
  "shipping"));

  $quote_address->addFieldToFilter("quote_id", array("eq" =>
  $quote_c->getId()));

Code 2:

  $resource  = Mage::getSingleton('core/resource');

  $connRead  = $resource->getConnection('core_read');

  $sqlCdnImageName = "SELECT shipping_method FROM
  sales_flat_quote_address WHERE  address_type = 'shipping'  AND
  quote_id = " .$quote_c->getId() . ";";

  $results = $connRead->fetchAll($sqlCdnImageName);

Code 2 generates this query:

  SELECT shipping_method FROM sales_flat_quote_address WHERE  address_type = 'shipping'  AND quote_id = 123

But the data is not coming.
please help to solve this.

Update: This quote data comes out when user doing checkout by logged in. But the data returns empty when guest checkout at the first time. After refresh the page(i mean 2nd time) the data comes out.

I found the updated time changes in the data printed and the data comes in the phpMyAdmin by executing the query. Is this affect the result in any way?

Data comes from the Model and query in the Phtml file:

  [created_at] => 2017-03-09 09:50:06

  [updated_at] => 2017-03-09 09:51:04

Data from PhpMyAdmin SqlQuery:

  [created_at] => 2017-03-09 09:50:06

  [updated_at] => 2017-03-09 09:51:51


texts:
I set a product's price to £9.95 for Website A's store view.

I then set the Configuration > Catalog > Price > Catalog Price Scope to be  Website.

I go into the product, change the scope top left to Website B's website and set the price to £10.00 and save.

Frontend on Website B I still see £9.95. If I go onto the product grid and set Website B Store View as the scope it still shows £9.95. But if I then click the product it shows £10.00.

Am I doing something wrong? I just need the price to be different frontend on Website B!

If there is a possible plugin causing this functionality to be overwritten, how can I troubleshoot that?

Thanks!


texts: Set custom discount price to existing cart/quote in controller

texts:
I know I asked the question once before, but i got no answer, so I try it again and hope for an answer this time. I also saw some other guys that tried to get an answer for this question, but none of them got one, so i need your help.

I would like to set a custom discount price to an existing cart/quote in my controller.

To give you an example, if the customer clicks a button in the cart he will get a random discount price. But now how can I achieve to add this specific disount price to the cart and quote in the controller?

I would appreciate if you could help me with this question.


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

texts:
this is my code

$URL='';(url of third party api)
$simple  = simplexml_load_file($URL);

 foreach($simple->FEEDBACK as $result){

  $service_score=$result->SERVICESTARRATING;
  $service_feedback=$result->CUSTOMERCOMMENT;
  $vendor_reply=$result->VENDORCOMMENT;

  $orderId =Mage::getModel('sales/order')->
           loadByIncrementId($order_ref)->getEntityId();

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

 $order->setData('score',$service_score);
 $order->setData('service_feedback',$service_feedback);
 $order->setData('response',$vendor_reply);

upto this code is working properly,when i try to use..

$order->save();

its give error as written in title,please help..


texts:
I set up a local host to install Magento, but ... after I installed Magento, I logged on to the dashboard. I don't know for certain what the problem is but I'm having problems with some objects which are not loading. I tried to re-install the Magento, but it didn't work?

Also the dropdown menu isn't working.


texts:
Check my site with Magento 1.7.x detected that would solve several problems patching the project. I did, clean the cache of my project but it has not worked yet.

bash PATCH_SUPEE-5345_CE_1.7.0.2_v1-2015-02-10-08-11-22.sh
Checking if patch can be applied/reverted successfully...
Patch was applied/reverted successfully.

magereport

My site was abandoned a while and we find that suffered hacking. Solve all problems and now everything works fine. Now I want my application patching to avoid me problems and I have not been able to get. I get a good response but by checking with that application is still not installed.


texts: Help with Shopping Cart Rule: Buy $200 worth of product use coupon code and get a product free

texts:
I need help making a shopping cart rule.

If a customer buys $200+ worth of product and enters a Coupon Code they will get a free Mug. I only have a certain amount of Mugs to give away. I was hoping the customer wouldn't even have to put the Mug in their cart. Just use the code and then when we see the order on the back-end if they have used the Coupon Code we will add a Mug to their order.


texts: CustomerData Messages Section is not showing up

texts:
What I am trying to do: Normally you have to click "Update Shopping Cart" button to update cart when you change the quantity. With this following code, you do not need to reload cart but it will automatically reload card when you change item qty using AJAX.
define([
'jquery',
'Magento_Checkout/js/action/get-totals',
'Magento_Customer/js/customer-data',
'Magento_Ui/js/model/messageList', // added component
'mage/translate', // for support translation
'jquery/jquery-storageapi',
'domReady!'
], function ($, getTotalsAction, customerData, messageList, $t) {

$(document).on('change', 'input[name$="[qty]"]', function(){
    var form = $('form#form-validate');
    $.ajax({
        url: form.attr('action'),
        data: form.serialize(),
        showLoader: true,
        success: function (res) {
            var parsedResponse = $.parseHTML(res);
            var result = $(parsedResponse).find("#form-validate");

            $("#form-validate").replaceWith(result);

            //reload minicart
            var sections = ['cart'];
            console.log("invalidate");
            customerData.invalidate(sections);
            console.log("reload");
            customerData.reload(sections, true);
            console.log("tot sum");
            //reload total summary
            var deferred = $.Deferred();
            getTotalsAction([], deferred);
            console.log("done");

            //for testing purpose - it returns null
            //var customerMessages = customerData.get('messages');
            var messages_section = ['messages'];
            //customerData.invalidate(messages_sections);
            customerData.reload(messages_section);

            //Display error if found after jquery
            var messages = $.cookieStorage.get('mage-messages');
            if (!_.isEmpty(messages)) {
                customerData.set('messages', {messages: messages});
                $.cookieStorage.set('mage-messages', '');
            }
            console.log(messages);
            //location.reload();

        },
        error: function (xhr, status, error) {
            console.log("test");
            var err = eval("(" + xhr.responseText + ")");
            console.log(err.Message);
        }
    });
  });

});

Right now, I am trying to show error message. My error message only shows up after page reload.
//Display error if found after jquery
            var messages = $.cookieStorage.get('mage-messages');
            if (!_.isEmpty(messages)) {
                customerData.set('messages', {messages: messages});
                $.cookieStorage.set('mage-messages', '');
            }

I was able to see the error in the messages variable, but how does customerData message section show up in frontend? It is still now showing up in frontend. Should it show up in /vagrant/www/vendor/magento/module-theme/view/frontend/templates/messages.phtml section?
Am I missing something here? Shouldn't the message section shows up?


texts:
Can anyone tell me one-to-one , one-to-many and many-to-many  Relationship in magento2 tables.
Which tables has one-to-one Relationships ? Which tables has one-to-many with which tables ? i just neend 1 or 2 table examples not need too detail
I want to learn this am beginner in Magento.

Thanks in Advances


texts:
In Magento 2, I'm working on this Knockout JS template:
app/code/Magento/Checkout/view/frontend/web/template/shipping-address/shipping-method-item.html

        <input type="radio"
               class="radio"
               ifnot="method.error_message"
               ko-checked="element.isSelected"
               ko-value="method.carrier_code + '_' + method.method_code"
               attr="'aria-labelledby': 'label_method_' + method.method_code + '_' + method.carrier_code + ' ' + 'label_carrier_' + method.method_code + '_' + method.carrier_code,
                    'checked': element.rates().length == 1 || element.isSelected" />

        <each args="element.getRegion('price')" render="" />

            <input type="radio"
                   attr="'value' : method.method_code, 'id': 's_method_' + method.method_code" />

I've overridden this template in my custom theme and would like to add a class a selected CSS to the first
 element if the element.isSelected

So far I've tried

But this just adds the selected every
 from the loop when one is clicked.


texts: How to prevent going to order view in order grid view (list view)?

texts:
In the magento Sales > Orders view where it lists all orders.
I am trying to prevent the redirection when clicking on the order row  (admin/sales_order/view/order_id/{orderID})
I would like to keep the action when the "view" link is clicked but prevent it if clicked anywhere else.

I process orders from the list view and copying information is a pain requiring me to hit escape every time I try (and sometimes redirects anyway)


texts:
I recently installed a new Magento 2.2.6 website on a VPS server. Everything seamed to install correctly. The issue I have now is the logs in the var folder are not being populated (update.cron.log, setup.cron.log, magento.cron.log) and the MySQL Database cron_schedule has almost all of the scheduled tasks marked as missed. These are the settings in Magento admin under store>configuration>advanced>system>cron:

Schedule:15
Schedule ahead:20
missed: 45
history 10
success lifetime: 60
failure Lifetime: 600
Use separate process: No

I had an old Magento 2.1 site on a shared host which I had to cancel due to lack of SSL Renewal. The Cron Jobs all worked proper the cron_schedule table populated with all success and the log files are populated. I can not figure out what is wrong. The file and folder permissions are correct as far as I know (var folder 777, var/log 777, all cron.log files 644) Please help this is driving me crazy.


texts:
This is how my add to cart functionality works :

I have a quick link for each products on home page. When I click on the link, I get a popup by ajax with add to cart functionality.

On submit, it adds product to cart and redirects to the ajax url through which the popup was generated which is wrong. Basically the popup is on home page and I want it to redirect to home page.

Now the problem is that Checkout module takes referral url which is ajax url and redirects to it.

The Cart controller has all the functions as protected so I am not even able to use interceptors.

So basically I could not find a way to do this.


texts: mamgento 2 addfield multiselect highlite selectd values

texts:
Hi created multiselect field in my custom module
in that selected only two values database having basics[product_type_category] =>Basics,Compact
when i click on edit particular id need to highlight which is stored in database
 if ($model->getId()) {
        $fieldset->addField(
        'product_type_category',
        'multiselect',
        array(
        'name' => 'product_type_category',
        'label' => __('Product Type Category'),
        'title' => __('product_type_category'),
        'values' => $this->_dataHelper->getProductTypeCategory(),
        'class' => '',
        'required' => true,
        )
        );

this is code for field $this->_dataHelper->getProductTypeCategory(), this functions getting all values that is fine but i need to highlight stored values
can any one tell me process


texts: Error filtering template: Invalid template file in module

texts:
I have this issue and I don't know how to solve it.

My phtml file is under:

app/design/frontend/rwd/josefsteiner/template/home.phtml

and i tried to include this phtml file into my CMS site like this:

{{block class="Magento\Framework\View\Element\Template" name="test_block" template="rwd_josefsteiner::home.phtml"}}

But i get always this error:

  Error filtering template: Invalid template file: 'rwd_josefsteiner::home.phtml' in module: '' block's name: 'magento\framework\view\element\template_0'

how to fix this issue?


texts: Magento2.4 show associated size options on details page even when all product are out of stock

texts:
Magento2.4 I need to show associated size options on the details page even when all product is out of stock
Can someone suggest me module or way to achieve this?
I tried below solution but not working
If you remove the condition $_product->isSaleable() you will get all the swatches visible in form.phtml


texts: Magento 2 - Limit reviews shown on product page

texts:
I'm looking for some help with limiting the review list on the product page to 5 reviews at a time.
I'm using Magento 2.0.7 and Porto 2.2.1

I found some suggestions on here but they were for Magento 1.x and didn't help me. What I tried so far:

{theme}\Magento_Review\templates\product\view\list.phtml

changed:

$_items = $block->getReviewsCollection()->getItems();

to

$_items = $block->getReviewsCollection()->getItems()->setPageSize(5);

Result: No reviews shown at all. Payed around but got either no reviews or 10 as usual.

{theme}\Magento_Review\layout\review_product_lists.xml

changed:

<block class="Magento\Theme\Block\Html\Pager" name="product_review_list.toolbar"/>

to

<block class="Magento\Theme\Block\Html\Pager" name="product_review_list.toolbar">
    <argument name="setLimit" xsi:type="number">5</argument>
</block>

I also played around in the pager.phtml and even pager.php with similar changes but got no results. What did I miss?

edit: Thanks, so far. Tried both changes, unfortunately I still get 10 reviews. Any chance that I need to change something somewhere else that I haven't noticed yet?
Yes, cache was flushed, other changes were visible immediately.

edit: I experimented with application\magento\vendor\magento\module-theme\Block\Html\Pager.php and found out that changing $_availableLimit or $_limit brings the desired results BUT that's not the clean way to work on this. Is there anything I missed? Is the class correct? Is the argument correct at all?


texts: How to setup AWS Cloudfront for Magento 2

texts:
I have been looking everywhere for a solution, and I was following the following documents to achieve this task.

https://absolutecommerce.co.uk/magento2-aws-cloudfront-cdn

Here they mention something about, Access-Control-Allow-Origin: http://your.magento.website.com. I am assuming my issue is something to do with this.

Since I am new to this configuration stuff, its has become a trial and error war so far. This is what I have so far,

Have a Magento installation, on AWS ec2 with a ELB with a SSL certificate associated with it (example.com, *.example.com),
Have cloud formation set up with the same certificate used for the ELB. This is only HTTPS. DNS set up to cdn.example.com.

My Apache configuration is as below,

VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.

        ServerName example.com

        ServerAdmin webmaster@example.com
        DocumentRoot /var/www/html

        Header set Access-Control-Allow-Origin "https://www.example.com"

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog /var/log/apache2/error.log
        CustomLog /var/log/apache2/access.log combined

        <Directory /var/www/html/>
                RewriteEngine on
                RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
                RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
        </Directory>

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

when I request a object,

https://cdn.example.com/static/version1485641847/frontend/Venustheme/superstore/en_US/owl.carousel/assets/owl.carousel.css

it gives a 404. I am not sure where I am making a mistake.


texts: Magento 2 - minifying javascript - min.js files not generated

texts:
My environment:

Magento 2.0.4
Production mode enabled
Cache enabled.

I wanted to speed up my Magento 2 store by minifying all Javascript codes. I enabled the JS Minifying option in admin panel and left the rest options (merging and budnling) set to 'no'.

After that all JS scripts stopped working: menus, cart, checkout etc.

There are many errors in console listed. However, they are mainly about missing min.js files. They were simply didn't generated somehow.

Please let me know how to fix it.


texts: Magento 2: toolbar url problems in custom module with custom router

texts:
I have the custom module with product collection and custom router.

for example i want to have link https://domain.com/gaires/something

Router code:

namespace UseApp\Gaires\Controller;
class Router implements \Magento\Framework\App\RouterInterface
{
    protected $actionFactory;
    protected $_response;

    public function __construct(
        \Magento\Framework\App\ActionFactory $actionFactory,
        \Magento\Framework\App\ResponseInterface $response
    ) {
        $this->actionFactory = $actionFactory;
        $this->_response = $response;
    }

    public function match(\Magento\Framework\App\RequestInterface $request)
    {
        $exlpoded = array_filter(explode('/', trim($request->getPathInfo()) ) );
        if($exlpoded && $exlpoded[1]=='gaires' && count($exlpoded)>=2){
            $request->setModuleName('gaires')
                ->setControllerName('index')
                ->setActionName('gaire')
                ->setParam('q', urldecode($exlpoded[2]));
        }
    }
}

Router working fine.

In the page (controller) gaires/index/gaire I have product collection with toolbar (sorter, limeter, pagger )

The problem is that the bad url address in the pager, sorter and limiter links.

For example: http://domain.com/gaires/index/gaire/q/something/?p=2

address must be: http://domain.com/gaires/something?p=2

If I change the adres in browser url field manually (http://domain.com/gaires/something?p=2) Router and collection working fine, but toolbar links also no

How can this be fixed?


texts: Magento 2.3 Saleable stock qty does not equal Global Attribute Qty

texts:
I have a simple product,(one of many), that is linked to a configurable product.

I'm trying to get the salable quantity and attribute quantity to match.

The site is in a dev env, so I don't think any items would be in cart. But the database is from a live copy a few hours ago.

Toggling stock status, manage stock, changing data, re-indexing doesn't seem to help.


texts: Dropdown swatch has to display the concerned text

texts:
This image has the dropdown swatch with the color like blue, red ,etc inside it.
If its a text swatch then it displays as 16mp or 48mp based on the values clicked but here in drop down swatch I couldn't make it possible to display the color on place where i have the text "topp".
I have made few changes in configurable.js , configurable.php, wrapper.phtml and renderer.phtml but I couldn't get the desired output.
Note :
The color either as blue, red which is clicked on the drop down swatch has to be reflected in the place where I wrote the text as "topp".


texts:
$sale_products = Mage::getModel('catalog/product')->getCollection();
$sale_products->addAttributeToSelect(array(
                               'image',
                               'name',
                               'short_description',
               ))
               ->addFieldToFilter('visibility', array(
                           Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
                               Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG
               ))
               ->addFieldToFilter('feature', array('eq' => 1))
               ->addAttributeToSort('position', 'ASC')
               ->addFinalPrice()
               ->getSelect()
               ->where('price_index.final_price < price_index.price')

Right now I only know how to sort by position. and I believe the position is sorted by the date item become sale.

If I sort by ->addAttributeToSort('category_id', 'ASC') I am not sure if it have any effect.  b/c product have many category ids.  and I can't find a pattern that match.

How to sort Product by it's parent category position?


texts: Configurable product use random, in stock, simple product image for category

texts:
I have an issue with configurable product images. I have configurable products with colour and size attributes and images for each different colour. These images for each colour are uploaded to their respected simple products. When I set up the configurable products I chose one of the simple product's images (so the product in one colour) as the configurable product images, which also means the main image that displays on the category page.

On the product page I use a module that changes the main image and gallery images when the corresponding colour attribute is selected.

This all works well until the colour that is used as the configurable product images and the main category image is out of stock. Now I have an out of stock colour showing as the product image on the category page, so customers will click on a product, expecting to be able to buy it in the displayed colour, but it is not in stock. Obviously not a good customer experience.

The nature of my business means that I may never again get that colour back in stock also, making the scenario even worse.

The only option currently is to manually monitor when a simple product (colour) goes out of stock and ensure that that image is not the one currently being used for the configurable product image, and if it is, upload the images of an in stock colour choice to the configurable product, which is obviously time consuming.

My question is this: is there any way to make Magento pull the product images from the currently in stock simple products (colours) and use these as the images for the configurable product? And when the current images associated simple product goes out of stock, change the images to another random, in stock colour?

I have searched for similar posts and found how to do this the other way round (use configurable images for simple products) but can't find any solution for this.

Thanks in advance and sorry for the lengthy description!


texts: I tried to import a csv file  to magento using system->import/export->Dataflow Profiles. But when importing that file getting an error like  Could not load file: /Applications/XAMPP/xamppfiles/htdocs/intow/var/import/pcpitems.csv


texts: empty space displaying once we click on button

texts:
we have review tab in product page here , please search using CTRL + F for "review"

once we click on "Be the first to review this product", it displaying like this , means complete design is spoiled

<?php echo $this->__('Write Your Own Review') ?>

    <?php if ($this->getAllowWriteReviewFlag()): ?>
    <form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
        <?php echo $this->getBlockHtml('formkey'); ?>
        <?php echo $this->getChildHtml('form_fields_before')?>

<?php echo $this->__("You're reviewing:"); ?>
            <?php echo $this->escapeHtml($this->getProductInfo()->getName()) ?>

            <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>

<?php echo $this->__('How do you rate this product?') ?> *


texts: 301 Redirect links from old categories to the new categories

texts:
I moved my website from Opencart to Magento and also renamed all categories.

So now I do have a lot of broken links that I would like to redirect to their new categories.

For example I have :
https://www.umweltfreunde.com/Wertstoffsammler-Abfalltrennsysteme/stahlblech-trenn-systeme

and now all links in the Wertstoffsammler-Abfalltrennsysteme/* should go to the new category :
https://www.umweltfreunde.com/abfall-und-entsorgung/wertstoffsammler-und-abfalltrennsysteme

So I have about 5 old categories and hundreds of links under them that needs to redirect to the new category.

The older products are no longer in use, so I want to redirect the products to their category so the customer will see the category instead.