texts:
I have developed a website in magento version 1.9.2, i have lot of products in excel, so I want to upload this file in magento admin, for that how to create menu and upload file in magento back end, I have just googled and founded some solutions but none of them working.

I am new in magento.


texts: Custom first shipment in recurring order

texts:
I have task to create a custom shipment for recurring order.  We sell strips that customer will use every month so we set a recurring product for this.  For the first month we want to deliver strips and device and for all other months we want to send strips only.

Also we want for user to go through checkout process only once.  So he is buying recurring product and nothing else. and as a result first month he has strips with device and only strips for all other months.

One more, We use fulfilment company for our shipment needs.  This company uses Magento API to get information about orders.  Through the API for the first month we need to send this company request to send SKUStripsAndDevice product to customer 1 and next months we want to send SKUStrips product.

Any ideas how to implement it?

https://stackoverflow.com/questions/7033788/can-i-detect-if-a-magento-function-is-being-run-as-an-api-call
has a code how to find if magento runs on API call.  I was thinking I will change SKU for the first month in recurring order details if request is in API mode.

Any ideas, suggestions?


texts: Create Order programmatically with tablerates

texts:
I'm trying to place an order programmatically with tablerates.
Here is my code

 $quote->getShippingAddress()->addData($postData['shipping_address']);
        $quote->getBillingAddress()->addData($postData['billing_address']);

        /** @var \Magento\Quote\Model\Quote\Address $shippingAddress */
        $shippingAddress= $quote->getShippingAddress();
        $shippingAddress
            ->removeAllShippingRates()
            ->setCollectShippingRates(true)
            ->collectShippingRates()
            ->setShippingMethod('tablerate_bestway') //shipping method
            ->setShippingDescription('Table Rate - Best Way');

        $this->handlePayment('banktransfer');
        $quote->setPayment($this->payment);
        $quote->setCheckoutMethod(QuoteManagement::METHOD_GUEST);
        $quote->save();

        $quote->collectTotals();
        $orderId = $this->cartManagement->placeOrder($quote->getId());
        $order = $this->orderResource->load($this->order, $orderId);

I'm constantly getting Please specify a shipping method. Regardless what I try. In QuoteValidator it tries to get the rate $rate = $quote->getShippingAddress()->getShippingRateByCode($method);  which always returns false. tablerates is setup

how can I place this order with tablerates?


texts: How to handle deprecated "Mysql4" classes when rewriting resource models

texts:
I have to rewrite Mage_Catalog_Model_Resource_Category_Flat.

The old resource class Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Flat is still there in Magento 1.7 for backwards compatibility and extends the new one.

A search in the codebase for the full model alias resource_eav_mysql4_category_flat did not yield any result. But the config.xml of Mage_Catalog contains this line:

<deprecatedNode>catalog_resource_eav_mysql4</deprecatedNode>

And I don't know where and how deprecatedNode is used.

What difficulties are there to expect when rewriting such a resource model? Should I rewrite both classes? Or can I safely ignore the mysql4 class?


texts: Rename CSS classes in Luma theme for Magento2

texts:
I am customizing the Luma theme for a project and notice that the homepage blocks of Luma have very particular names for their CSS classes, for example home-erin, home-t-shirts etc.

I would like to rename the classes but always seem to miss some classes, which causes the frontpage images/blocks to break. So, all this manual labor to update classnames like home-pants to home-mid, home-eco to home-sale so our client knows what is what seems to be a hell of a job.

My actual questions:
1. Does anybody every tried the same thing as I do right now? If so, how?
2. Is there anybody who can think of a way of doing this quick, easy and with the best change of renaming all of the classes (so you don't forget anything)
3. Should I stop trying and just rewrite the whole thing?

Thanks in advance!


texts: Error: category.product.addto.wishlist is not a child of catalogsearch.product.addto

texts:
Magento 2.2.6

### Steps to reproduce (*)
<!---
Important: Provide a set of clear steps to reproduce this bug. We can not provide support without clear instructions on how to reproduce.
-->

  Opening web-shop (Landing page or somewhere else) and using the search bar.
  Tipping any word and pressing enter

  Getting error instead of products refering to your search: 1 exception(s):
  Exception #0 (Magento\Framework\Exception\LocalizedException): category.product.addto.wishlist ist kein Kind von catalogsearch.product.addto

### Expected result (*)
1. List of products which fit my search

### Actual result (*)

  Exception #0 (Magento\Framework\Exception\LocalizedException): category.product.addto.wishlist ist kein Kind von catalogsearch.product.addto

  Link: https://www.dev.feelcomfort.de/catalogsearch/result/?q=Test

Does anyone know how to fix this bug?

Best regards,
Feelcomfort


texts: After upgrade magento 2.1.0 to 2.2.1 product export not working

texts:
After upgrade magento 2.1.0 to 2.2.1 product export redirect to dashboard.

Click on System > Export then choose entity type Product and then scroll and click on continue.

Its redirect to dashboard.


texts: getAllVisibleItems() not working in magento 2

texts:
$order = $this->_orderFactory->create()->load($orderId);

i have order id, now i want to access all the visible ordered items from db using
getAllVisibleItems().anyone help me


texts: Magento 2.3.5: How to get csv from the WEB directory of Module?

texts:
I want to get csv file from web folder of custom module in magento 2 so how can i do this.
please help me.
Thanks In Advance.


texts: Session_regenerate_id in Magento 2 with PHP 7

texts:
I've got an install of Magento 2.0 running on Centos 6.7 with PHP 7.  I'm using Redis for cache and Memcached for session data.  Everything so far on the frontend works great, but I'm getting the following error when I try to log into the backend.

Recoverable Error: session_regenerate_id(): Failed to create(read) session ID: user (path: 127.0.0.1:11211)

I did some research on Google and found posts on Github from both Inchoo and colinmollenhour that say that the issue is that the session data that's being returned can sometimes be the boolean false instead of a string.  From what I can gather PHP 5 was fine with getting the boolean false whereas PHP 7 must have a string returned.  So their solution was to cast the session data variable as a string.  The problem for me is that their solution is for Magento 1.x and I'm working with Magento 2.

So I did some more research/code diving and the closest thing I could find was in vendor/magento/framework/Session/SaveHandler/DbTable.php where in the read() function I cast the returned $data variable as a string.  Didn't work although I don't think that's the right spot.  So does anyone know where the read() function for reading session data when using Memcached is at and/or how to fix this particular issue in Magento 2?


texts: Why there is white space in products category as I have disabled some unused categories. I don't want these white spaces

texts: I have installed Porto theme and using magento version 2.3.3


texts: Add new field in Add new customer form in backend

texts:
I studied regarding how to add new field in registration form for new customer. Got to know that need to add attribute for it. I created a module for it. But now, admin add new customer page shows me this error.

There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 168844915537

My module code is as follows:
app/etc/modules/Addattribute_Customer.xml

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

app/code/local/Addattribute/Customer/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Addattribute_Customer>
            <version>1.0.0</version>
        </Addattribute_Customer>
    </modules>

    <global>
        <helpers>
            <addattribute_customer>
                <class>Addattribute_Customer_Helper</class>
            </addattribute_customer>
        </helpers>

        <resources>
            <addattribute_customer_setup>
                <setup>
                    <module>Addattribute_Customer</module>
                    <class>Mage_Customer_Model_Resource_Setup</class>
                </setup>
            </addattribute_customer_setup>
        </resources>
    </global>
    <frontend>
        <layout>
            <updates>
                <addattribute_customer>
                    <file>addattribute_customer.xml</file>
                </addattribute_customer>
            </updates>
        </layout>
        <translate>
            <modules>
                <Addattribute_Customer>
                    <files>
                        <default>Addattribute_Customer.csv</default>
                    </files>
                </Addattribute_Customer>
            </modules>
        </translate>
    </frontend>
</config>

app/code/local/Addattribute/Customer/sql/addattribute_customer_setup/install-1.0.0.php

<?php
$installer = $this;
$installer->startSetup();
$setup = Mage::getModel('customer/entity_setup', 'core_setup');
$setup->addAttribute('customer', 'sales_executive', array(
    'type'      => 'varchar',
    'label'     => 'Sales_Executive',
    'input'     => 'select',
    'position'  => 120,
    'required'  => true,//or true
    //'is_system' => 0,
));
$attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'sales_executive');
$attribute->setData('used_in_forms', array(
    'adminhtml_customer',
    'checkout_register',
    'customer_account_create',
    'customer_account_edit',
));
$attribute->setData('is_user_defined', 0);
$attribute->save();

$installer->endSetup();
?>

app/code/local/Addattribute/Customer/Helper/Data.php

<?php
class Addattribute_Customer_Helper_Data extends Mage_Core_Helper_Abstract
{

}

Please give your suggestion or mark my mistake.


texts: Adding custom product attributes to layered navigation but not shown

texts:
I want to show the following attribute in the layered navigation

$eavSetup->addAttribute(
    \Magento\Catalog\Model\Product::ENTITY,
    'test',
    [
                'type' => 'varchar',
                'label' => 'Test',
                'input' => 'select',
                'required' => false,
                'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
                'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
                'visible' => true,
                'user_defined' => true,
                'searchable' => false,
                'filterable' => true,
                'filterable_in_search' => true,
                'comparable' => false,
                'visible_on_front' => true,
                'unique' => false,
                'group' => 'General',
                'is_used_in_grid' => true,
                'is_visible_in_grid' => false,
                'is_filterable_in_grid' => true,
                'source' => 'XXX\CustomProductsAttributes\Model\Config\Source\BrandOptions',
                'apply_to'=>'simple,configurable,bundle,grouped'
    ]
);

The attribute is created with the same values that the one I've created through the m2 admin area, with the difference, the one created through the admin area is shown in the layered navigation. I've tested with a new product which has these two attributes, but only appears this one instead of both in the layered navigation.


texts: ACL for custom config group - section disppeared?

texts:
I'v tried to add a new section to Store -> Config -> Catalog Section -> Catalog with custom ACL settings.

I changed (default) adminrole permissions from "All" to "Custom" and left only the new option unchecked.

Expected:

new group does not appear

Result:

whole Catalog Section disappears

system.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
  <system>

      <resource>StackExchange_LockAttributes::configuration</resource>
      <group id="backend" translate="label" sortOrder="9999" showInDefault="1" showInWebsite="1" showInStore="1">
        Product Attribute Settings
        <field id="lock_attributes" translate="label tooltip comment" sortOrder="10" type="multiselect" showInDefault="1" showInWebsite="1" showInStore="1">
          Locked Attributes
          <comment>Product attributes that can't be edited.</comment>
          <source_model>StackExchange\LockAttributes\Model\System\Config\Source\Product\Attributes\Frontend</source_model>
          <can_be_empty>1</can_be_empty>
        </field>
      </group>

  </system>
</config>

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="Magento_Backend::stores">
        <resource id="Magento_Backend::stores_settings">
          <resource id="Magento_Config::config">
            <resource id="Magento_Catalog::config_catalog">
              <resource id="StackExchange_LockAttributes::configuration" title="Edit Locked Attributes Section" translate="title" sortOrder="100"/>
            </resource>
          </resource>
        </resource>
      </resource>
    </resource>
  </resources>
</acl>
</config>

helper ...

public function isAllowed()
{
    return $this->authorization->isAllowed('StackExchange_LockAttributes::configuration');
}

Extension works ... only config section makes trouble.

What's wrong with my code?

Btw ... i've played arround with CatalogSearch ACL role and it seems it has no effect at all. If I uncheck ACL role, system config for CatalogSearch should not be visiable, but it's still there,


texts: How do I override layouts.xml - Magento 2

texts:
I am trying to override the file app/code/Magento/Theme/view/frontend/layouts.xml

I do not want to extend this file, I want to override it so that some of the base design layouts are not available in the admin.


texts: Custom section data not rendering on page load

texts:
I have created one module for the custom section. Here is the code.

di.xml

  <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
   <type name="Magento\Customer\CustomerData\SectionPoolInterface">
    <arguments>
        <argument name="sectionSourceMap" xsi:type="array">
            <item name="customsection" xsi:type="string">Demo\Section\CustomerData\CustomSection</item>
        </argument>
    </arguments>
   </type>
  </config>

CustomerData/Customsection.php

<?php
namespace Demo\Section\CustomerData;
use Magento\Customer\CustomerData\SectionSourceInterface;

class CustomSection implements SectionSourceInterface
{

protected $_checkoutSession;

public function __construct(\Magento\Checkout\Model\Session $checkoutSession)
{
    $this->_checkoutSession = $checkoutSession;

}

/**
 * {@inheritdoc}
 */
public function getSectionData()
{

  $total = $this->_checkoutSession->getQuote()->getSubtotal();
   return [
        'msg' =>'total is'.$total,
    ];
 }
}

In the front side, I'm displaying this message on the product page.

catalog_product_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

    <referenceContainer name="content">
        <block class="Magento\Framework\View\Element\Template"  name="custom_section" template="Demo_Section::customsection.phtml">
        </block>
    </referenceContainer>

</page>

customsection.phtml

frontend/web/js/section.js

define([
'uiComponent',
'Magento_Customer/js/customer-data'
],
function (Component, customerData) {
'use strict';

return Component.extend({
    /** @inheritdoc */
    initialize: function () {
        this._super();
        this.customsection = customerData.get('customsection'); //pass your custom section name
    }
});
});

sections.xml

      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
       <action name="checkout/cart/add">

       </action>
       <action name="checkout/sidebar/removeItem">

       </action>
     </config>

Using this code I'm getting section message with the total in frontend while adding the item to cart or remove from cart. But Initially when someone open url for the first time when there is no item in the cart at that time section message is not displaying.

I know the section is only updated by post request but I need it initially when someone visits the page.


texts: How do I get a report of all products that are Out of Stock on Magento 1.7.0.2?  Currently our Quickbooks and Magento do not communicate so I rely on our sales team to inform me when products are out of stock.  Downfall is they fail to communicate when products are back in stock.  It would be great if I can generate a report from Magento weekly showing the products that are currently marked Out of Stock on our Magento website.


texts: I am trying to add Category tree to custom extention, the category tree which is in one of the tab of edit product page


texts:
We have installed 2 extensions on Magento 1.9.3 one is a one page checkout extension found here:
https://www.magentocommerce.com/magento-connect/onestep-checkout.html
and the other is a delivery time scheduler found here:
https://store.biztechconsultancy.com/magento-delivery-date-scheduler.htm

The delivery date scheduler works on the default OPC on Magento and posts the correct data to Sales Flat Order table.

If I enable the onestep-checkout it doesn’t post the data to the table?

Can someone let me know what part of the code in the ecosystem of Magento I need to look at so I can get it to post the data when this extension is enabled?

Regards


texts: Magento : How to add onchange function in country in Cart page?

texts:
I want to add onchange function in select of country in cart page. But country are coming from :

Mage::getBlockSingleton('directory/data')->getCountryHtmlSelect($this->getEstimateCountryId())

So , How to add onchange function to country on Cart page.

When customer select country then page will reload and display delivery method in dropdown and calculate estimate shipping cost and add in grand total in cart page.


texts: how to Remove the decimal number from price in Magento 2.3

texts:
We want to Remove the decimal number from price in Magento 2.3  ex. 100.00$ to be 100$.

Anyone know how to do it? Thanks in advance.


texts:
It says here that Redis is superior to Memcached, but I plan to update to upgrade my store to the latest Magento 2.3

Will Redis still work? Can't risk slowing the shop down


texts:
In my magento store I have the recently viewed products block and newsletter signup block inside my footer as shown with the below code all working ok:

footer.phtml

<?php echo $this->getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->toHtml(); ?>

<?php echo $this->getChildHtml('footer.newsletter') ?>

On one of my CMS pages i want to hide these 2 blocks. In the design admin tab for my CMS page i have already hidden the breadcrumbs with the below in the Custom Layout Update XML section, again working fine:

<reference name="root">
    <remove name="breadcrumbs" />
</reference>

I cannot seem to come up with the correct code to remove these blocks. I have tried several lines of code for each block:

<reference name="footer">
    <remove name="reports.product.viewed" />
</reference>

<reference name="root">
    <remove name="footer.reports.product.viewed" />
</reference>

<reference name="footer">
    <action method="unsetChild"><alias>reports.product.viewed</alias></action>
</reference>


texts: how to Override view folder currently is in vendor

texts:
I have to override magento2/vendor/magento/module-catalog/view/base/templates/product/price/amount/default.phtml file and create it in my theme.

How to override this file?


texts: How to add extra fields in checkout page and save them into sales_order table?

texts:
Can someone please explain the correct procedure to add custom fields in checkout page and save it into database in sales_order table. I have found various tutorials and blogs but none of them work properly.

I have tried it using observers and all but this process doesn't seem right.


texts:
We need to manage and sell tickets' reservation for more museums.
Basically we need these features:

1) Reservation of tickets according to daily time-slot, showing availability for every time-slot (as example, one or more time-slots in one day could be inhibited because they result full).
Reservation has to be done with provision of a QR code.

2) Handling of reports towards every museum, where we need to clearly indicate how much museum earned, including commissions taken by us.

Could you indicate the most trustable plugin to be used to get these features?

Using Magento 2.0


texts: Same product added to cart - different line items

texts:
Is it possible to add the same product to the shopping cart, but have it appear as different line items?

In my specific case I am adding a product to the cart programatically based on some conditions of the cart, specifically its subtotal.

When i add the product, I want to add it as a unique line item, regardless of whether that product already appears in the cart now or in future: added by a customer normally.

For example, say the cart look like this:

Product A - qty 1
Product B - qty 1

and I wanted to add Product B in my code, I would like it to appear like:

Product A - qty 1
Product B - qty 1
Product B (custom) - qty 1


texts: Multiple stores - home page ok, but category and cms pages 404

texts:
I am adding another store to an existing Magento install: main-store.com works fine and I am adding main-store.com/nested-store. (There is currently a holding page at nested-store.com, which I will redirect to main-store.com/nested-store when it is ready to go live.)

I have created a new website, store and store view in Magento for nested-store. I have created a new root category and sub categories for nested-store. I have updated the base url for the new store to be main-store.com/nested-store. All other urls use {{unsecure_base_url}}, {{unsecure_base_url}}/skin etc.

The problem I have is that the homepage of main-store.com/nested-store looks fine, but when I click on any links, e.g. main-store.com.nested-store/shop (which is my root category for this store) or main-store.com.nested-store/about, I see the 404 page for main-store.com.

I have created the category hierarchy and added lots of cms pages, all of which I cannot access at the moment. When I try to preview the about page (main-store.com/nested-store/about/?___store=nested-store), I also see the 404.

Why is the nested store linking to only pages in the main store?


texts: Magento 2. When does the cart become inactive?

texts:
I'm looking at Magento\Quote\Api\Data\CartInterface::getIsActive

I see there is a setter on this as well so the value can be changed by hand.
By default when does this value change? What event/scenario triggers the cart to become not active anymore?


texts: Cant get product MSRP price in custom module

texts:
I need to show MSRP price in a custom module template, but I cant get it.

I have Magento\Catalog\Model\Product model and $product->getMsrp() or $product->getData('msrp') does not return value (NULL).

The product exists and other basic data (like id, name etc) too.

Where might be a problem?


texts: Can I disable tooltip when the browser is at a certain screensize?

texts:
Can I wrap the code at the bottom in bootstrap hidden classes or is it only with something like the snippet immediately below?

if ( $(window).width() < 960 ){
 //function
}

<script>
    (function ($) {
        $(document).on('ready', function () {
            $('body').tooltip({
                selector: '.with-tooltip',
                placement: 'left',
                html: 'true'
            });
        });
    })(jQuery);
</script>


texts:
I need to understand what the code below actually does? I found this in Mage.php

 public static function getSingleton($modelClass='', array $arguments=array())
{
    $registryKey = '_singleton/'.$modelClass;
    if (!self::registry($registryKey)) {
        self::register($registryKey, self::getModel($modelClass, $arguments));
    }
    return self::registry($registryKey);
}


texts: Using the same observer class multiple times

texts:
I have a piece of custom code that should be executed on different events but the code does not depend on anything the events send to the observer.
It's basically a dumb code like:

class MyObserver implements \Magento\Framework\Event\ObserverInterface
{
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        do something here that does not depend $observer
    }
}

Is there a downside in using this for multiple events like this (events.xml)?

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="event_one">
        <observer name="my_observer" instance="MyObserver" />
    </event>
    <event name="event_two">
        <observer name="my_observer" instance="MyObserver" />
    </event>
    <event name="event_three">
        <observer name="my_observer" instance="MyObserver" />
    </event>
</config>

I can also create an abstract class that contains that code and create empty classes for each event, but I'm trying to avoid abstract classes and empty child classes.


texts: How to redirect to specific category if product url is 404 due to product disabled in magento 2.3?

texts:
If I have disabled any product then it will redirect to 404. But I want to redirect that product url from 404 not found page to the category url in which this product is assigned.
That means I want to redirect to the related category of that 404 not found(Product url).
How can I achieve this in magento 2.3?


texts:
I have made a comparison between 1.9.3.1 and 1.9.3.2 in file systems and databases. There is only one notable change in sendmail.php file. All the other files have minor changes in one line, 2016 year is now 2017 and 33 file names have been changed to 1.9.3.2.

A question is rising up, what is really 1.9.3.2 release? It is promoted with a lot of security patches but is not different than 1.9.3.1 except one file sendmail.php. I expected improvements or bug fixes but nothing was found so far. Very disappointed how Magento team is managing the new versions.


texts: Alternative way for test system for magento shop with large media folder?

texts:
I want test my first self-employed magento modules on a magento shop. I created a ubuntu server, configured local.xml and base_url but now I need a solution for the big media folder from livesystem.

At the moment I don't want to change product images or something else - already want to test an extension with a few layout updates in a realistic situation.

Routing media urls to live system host name don't work. I think magento check also if the file exists local and CDN typical get established via simple virtual host generally.

So setting CDN to external host doesn't work, I tried to configure a placeholder image via admin backend but when I delete cache and reload the function:

template/catalog/product/list.phtml

<img class="img-responsive" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->constrainOnly(false)->keepAspectRatio(true)->keepFrame(true)->resize($_image_resize_width,$_image_resize_height); ?>"

Seems to doesn't work. If I show in quellcode it ends on the first product image with

<img class="img-responsive" src="

without footer etc.

Anybody have an idea whats the simplest solution in this case? My preffered solution would be, that magento simple use the external url from livesystem for media images. But when I show in the Image Model/Helper the local filesystem path for images seems deeply anchored in system.

Thanks!


texts: Magento 2 EE - fetch products with sales data on split database solution

texts:
I have an M2 custom extension which fetches products with its sales data from the database.

Current code:

/** @var $products \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection */
$products = $this->objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection');

// ... adding some filters to $collection

// Enrich collection with sales data
/** @var \Magento\Framework\App\ResourceConnection $resource */
$resource = $objectManager->create('\Magento\Framework\App\ResourceConnection');
$ordersTableName = $resource->getTableName('sales_order_item');
$superTableName = $resource->getTableName('catalog_product_super_link');

if ($this->productHelper->isAttributeEnabled($additionalAttributes, 'ordered_qty')) {
    $collection->getSelect()->columns('(SELECT SUM(qty_ordered) FROM ' . $ordersTableName . ' AS o LEFT JOIN ' . $superTableName . ' AS l ON l.product_id = o.product_id WHERE o.product_id = e.entity_id OR l.parent_id = e.entity_id) as ordered_qty');
}

// Process products
/** @var Product $product */
foreach ($collection as $product) {
    // do something
}

It works pretty well on both CE and EE. However, when I turn on "split database" feature of M2 EE it breaks as sales data are located in a different database than products.

Error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento21ee.sales_order_item' doesn't exist, query was: ...

The questions are - what is the best practice to handle that? Should I remove the sales data from the collection and perform a separate query to fetch sales data for each product? It seems to be really not effective.

Should I fetch all products, all sales data and then pair it which processing? It'll add additional complexity to the code, but will be much more effective than querying DB for each product.

Or is there any hidden Magento feature how to fetch products with sales data?

Thank a bunch for any help!


texts: What is the correct way to change an indice's stemmer on Elasticsearch when using magento

texts:
I have a Magento 2 site with product titles and descriptions in Portuguese, that uses  Elasticsearch as the catalog search engine. When I search for terms with accents the search results quality is very poor. Taking a stab at the issue I found out that magento creates the indices with an english stemmer, which is not appropriate for my case, as seen in the following image:

I know I can change the stemmer to be in portuguese, via direct manipulation on elasticsearch, but upon each magento indexer:reindex the old indice is deleted and a new one is created again with english, so that would not be a feasible solution.

Further digging into the issue I found that there's an esconfig.xml in the Magento_Elasticsearch module which is base to Magento_Elasticsearch6, with the following structure

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Elasticsearch:etc/esconfig.xsd">
    <stemmer>
        <type>stemmer</type>
        <default>english</default>
        <de_DE>german</de_DE>
        <en_US>english</en_US>
        <es_ES>spanish</es_ES>
        <fr_FR>french</fr_FR>
        <nl_NL>dutch</nl_NL>
        <pt_BR>portuguese</pt_BR>
    </stemmer>
    <stopwords_file>
        <default>stopwords.csv</default>
        <de_DE>stopwords_de_DE.csv</de_DE>
        <en_US>stopwords_en_US.csv</en_US>
        <es_ES>stopwords_es_ES.csv</es_ES>
        <fr_FR>stopwords_fr_FR.csv</fr_FR>
        <nl_NL>stopwords_nl_NL.csv</nl_NL>
        <pt_BR>stopwords_pt_BR.csv</pt_BR>
    </stopwords_file>
</config>

I wonder what is the proper way to override this file as to make Magento use a portuguese stemmer  by default?

Thanks


texts: Magento 2 - How to fix "Incompatible argument type: ... Actual type: array; File:"

texts:
I'm using Magento 2.3.3.

I created a plugin that can edit product at the frontend. The plugin works fine. But it error when running setup:di:compile.

  Incompatible argument type: Required type: \Magento\Framework\Escaper. Actual type: array; File:.../app/code/.../xxx.php

Here is my code,

class Edit extends \Magento\Catalog\Block\Adminhtml\Product\Edit
{
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Framework\Json\EncoderInterface $jsonEncoder,
        \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory,
        \Magento\Framework\Registry $registry,
        \Magento\Catalog\Helper\Product $productHelper,
        array $data = []
    ) {
        $this->_productHelper = $productHelper;
        $this->_attributeSetFactory = $attributeSetFactory;
        $this->_coreRegistry = $registry;
        $this->jsonEncoder = $jsonEncoder;

        parent::__construct($context,
        $jsonEncoder,$attributeSetFactory,$registry,$productHelper,$data);
        $this->setData('area','adminhtml');
    }
    protected function _construct()
    {
        parent::_construct();
        $this->setId('product_edit');
        $this->setUseContainer(true);
    }

    public function getProduct()
    {
     ...................

Please help.
Thank you


texts: Magento 2: layered navigation filter query (code)

texts:
I want to get the layered navigation filter query which applies on products according to the attribute value. I want to change that query. How can I get that piece of code where query is appling?

The url is http://127.0.0.1/ncsmokehouse/shop/bacon.html?product_or_type=64.

I would like to change product_or_type=64 for my own query.


texts:
how can i hide errors from main site ?

my developer mode is off

php bin/magento maintinance:disable

what can i do my site is not working.

By mistake i run the command

php bin/magento deploy:mode:set developer

now it is showing error and overall site is not working .


texts:
magento controller indexaction method is working only other action method not working. when i change any method name to indexaction its other action is working.
it irritate me.

http://localhost/magento/test/index {.....this url is working}
http://localhost/magento/test/mamethode{.....this url is not working}

when i replace both method name with each other. In that case also indexaction is only working.

<?php
class Pfay_Test_IndexController extends Mage_Core_Controller_Front_Action
{
   public function indexAction()
   {
     echo 'test index';
   }
   public function mamethodeAction()
   {
     echo 'test mymethod';
    }
}
?>


texts: In checkout when i get to the payment information i get this error. Attention [XML2Array] Error parsing the XML string

texts:
This would be the last step in the checkout process. I hit checkout and it would take me to a success page. Right when i hit the button it throws this error.

I did a search on the server for what would display that error message and this is what i found. two modules.

./app/code/ParadoxLabs/TokenBase/Model/Gateway/Xml.php:154:                    __('[XML2Array] Error parsing the XML string.')
./app/code/IWD/AddressValidation/Model/XML/XML2Array.php:56:                throw new LocalizedException(__('[XML2Array] Error parsing the XML string.'));

Has anyone encountered this problem with paradox labs or the IWD module? Is it possible that there could just be some rogue spaces in the xml files?

Any help would be greatly appreciated. Thank you.


texts: How to get product Quantity in Magento 2

texts:
I need to retrieve product quantity, I found that, the interfaces we used before to get product quantity are deprecated, these are:
\Magento\CatalogInventory\Api\StockStateInterface $stockItem

And,
\Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry

Below link says StockStateInterface is replaced with Multi Source Inventory but I cannot see a function returning product quantity in it.
https://www.magentoextensions.org/documentation/interface_magento_1_1_catalog_inventory_1_1_api_1_1_stock_state_interface.html
Is there some other way to get product quantity? I don't want to use deprecated code.


texts: Solved: Help required with Owebia Shipping configuration file

texts:
I am converting a Magento 1 site to Magento 2 and need to upgrade an Owebia Advanced Shipping configuration file. I'm ok with most of the file but need to help on what this line should be replaced with
"fees": "{cart.weight} > 30010 ? 262.56 + (ceil(({cart.weight} - 30010) / 1000) * 2.4) : {table {cart.weight} in 2510:50.40, 3010:55.20, 3510:61.20}"


texts: Can't create custom attribute for order_address

texts:
I need to create a custom attribute on the order address to stock my ERP id of the address for a syncing purpose.

I've tried to create a Eav in Maru3l/SyncOrchestra/Setup/InstallData.php. I don't see the input appeared in the admin panel but the file in the log folder is created.

<?php

namespace Maru3l\SyncOrchestra\Setup;

use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{
    /**
     * Attribute Code of the Orchestra ID attribute
     */
    const ORECHESTRA_ID_ATTRIBUTE_CODE = 'orchestra_id';

    /**
     * @var EavSetupFactory
     */
    protected $eavSetupFactory;

    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    /**
     * Install Orchestra id attribute
     *
     * @param ModuleDataSetupInterface $setup
     * @param ModuleContextInterface $context
     * @return void
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $eavSetup->addAttribute(
            'customer_address',
            self::ORECHESTRA_ID_ATTRIBUTE_CODE,
            [
                'label'         =>  'Orchestra ID',
                'input'         =>  'text',
                'visible'       =>  true,
                'position'      =>  100,
                'unique'        =>  true,
                'required'      =>  false,
                'system'        =>  false
            ]
        );

        $dumpFile = fopen('/var/www/vhosts/store-api.silverwax.ca/httpdocs/var/log/dataDump', 'w+');
        fwrite($dumpFile, 'Install eav \n');

        $setup->endSetup();
    }
}

I've also created the Maru3l/SyncOrchestra/etc/extension_attributes.xml:

<?xml version="1.0"?>
<!--
/**
 * Copyright © Mageside. All rights reserved.
 * See MS-LICENSE.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Sales\Api\Data\OrderAddressInterface">
        <attribute code="orchestra_id" type="string" />
    </extension_attributes>
</config>

My other concern is how can I get or set the value programmatically.


texts: How to add size range in layered navigation? just like price range.


texts: Is it safe to modify product name attribute character limit

texts:
I'm reaching a character limit issue with the product name attribute which is in catalog_product_entity_varchar, with a limit of 255 characters.

Is it safe for me to simply modify this using phpMyAdmin and modify this length to 500:

ALTER TABLE  `catalog_product_entity_varchar` CHANGE  `value`  `value` VARCHAR( 500 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT  'Value'

Could this cause detrimental effects other than increasing the table size?
I've run the query on a staging environment and am now able to bypass the 255 character limit, I'm just checking to see if anyone can think of something I am missing or should be worried about?


texts: how to show the latest reviews on the homepage?

texts:
i have found this but really don't understand what to do in step 1. Could anybody advise me. Or is there a better way to get this done.

Step1: You can get review Collection by below code:

$Collection=Mage::getModel('review/review')->getCollection()
                ->addStoreFilter(Mage::app()->getStore()->getId())
                ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
                ->addRateVotes()
                ->setDateOrder();

Step2: Create a Cms page from admin>Cms>Page> and at Design tab and put this code

<reference name="content">
<block type="core/template" name="review.form" template="catalog/allreview.phtml"/>
</reference>

Step3: create allreview.phtml on app/design/frontend/your package/your template/templete/catalog/ and put below this phtml file you can put review details by below code:

<?php
    $_items = array_reverse( $Collection->getItems());

    foreach ($_items as $_review):
        $productId =  $_review->getentity_pk_value();
         $_review->getTitle();
         $_votes = $_review->getRatingVotes();
         $_review->getDetail()
          $this->formatDate($_review->getCreatedAt()) ?>
              $this->__('[Posted %s]', $this->formatDate($_review->getCreatedAt()), 'long');

    endforeach;
?>


texts:
I am beginner in magento 2, I want to add a style CSS for my Block but it does not work, here is the code:

 <head>
    <css src="Managys_Pricing::css/style.css"/>
</head>
<update handle="editor"/>
<body>
    <referenceContainer name="content">
        <block class="Managys\Pricing\Block\Adminhtml\Configuration\Edit" name="pricingadmin_configuration_edit"/>
    </referenceContainer>
    <referenceContainer name="left">
        <block class="Managys\Pricing\Block\Adminhtml\Configuration\Edit\Tabs" name="pricingadmin_configuration_edit_tabs"/>
    </referenceContainer>
</body>

At the level of Block\Adminhtml\Configuration\Edit\Tab I added column_css_class

$fieldset
        ->addField(
            'date_update',
            'label',
            [
                'label' => __("Dernière mise à jour des prix   :"    .$configuration["last_price_update"]),
                'column_css_class' => 'date_update'
            ]

        );

And I put in the css file,

.date_update{
width: 500px;
 }

I do not know if as the continuation or no. Thank you to help me!


texts: Magento2 add text to minicart while product added to cart

texts:
In Magento2 - I want to add message on top of the mini-cart while product add to cart.

Using event and observer I want to add this message and also want to apply conditions for that, if cart sub total less than (<) 100 then add message

  please add more product for a free shipping


texts:
Setup scripts are versioned. It is known. As a result, any time you use a reference from an external object or class, you run the risk of the setup script itself changing ex post facto. For example, suppose I want to insert a new status that is the default for the "New" state:

$tbl = $installer->getTable('sales/order_status_state');
$fields = array('status', 'state', 'is_default');
$values = array(
    'unsubmitted',
    Mage_Sales_Model_Order::STATE_NEW,
    'is_default' => 1,
);
$conn->insertArray($tbl, $fields, array(array_combine($fields, $values)));

Maybe it's unlikely that a future release of Magento would change the value of Mage_Sales_Model_Order::STATE_NEW, but it could happen, and if it did, this setup script would have the same version number(s), but produce different results. That's bad!

The real question here is that good programming practice tells me that I shouldn't have the string 'unsubmitted' in my code/config more than once. I would really like to put it in config.xml, actually, but I can't, because if I do that then future versions of this setup script can change meaning without actually changing the code of the setup script.

Has anyone found a reasonable compromise between hard-coding values into setup scripts and maintaining pure differences between versions?


texts: How to use "CASE WHEN" on select join magento 2

texts:
I try to get shipping postcode, shipping city, billing postcode, billing city of order, join to table sales_order_address, but i can't use "CASE WHEN" on Join. Can someone help me, please.
This is my code,
$a = new \Zend_Db_Expr('CASE WHEN sales_order_address.address_type <> "shipping" THEN street END');
$b = 'CASE WHEN sales_order_address.address_type <> "shipping" THEN postcode END';
$c = 'CASE WHEN sales_order_address.address_type <> "shipping" THEN city END';
$d = 'CASE WHEN sales_order_address.address_type <> "billing" THEN street END';
$e = 'CASE WHEN sales_order_address.address_type <> "billing" THEN postcode END';
$f = 'CASE WHEN sales_order_address.address_type <> "billing" THEN city END';

$this->getSelect()
        ->joinLeft(
            $joinTable . ' as cgf',
            'main_table.entity_id = cgf.order_id',
            ['invoices' => 'cgf.increment_id']
        )
        ->joinLeft(
            'sales_order_address',
            'main_table.entity_id = sales_order_address.parent_id',
            array(
                'country_id' => 'country_id',
                'shipping_street' => $a,
                'shipping_postcode' => $b,
                'shipping_city' => $c,
                'billing_street' => $d,
                'billing_postcode' => $e,
                'billing_city' => $f
            )
        )
->where('main_table.store_id = ' . $storeId);

Echo select, it show
SELECT `main_table`.*, `cgf`.`increment_id` AS `invoices`, `sales_order_address`.`country_id`, `CASE WHEN sales_order_address`.`address_type <> "shipping" THEN street END`, `CASE WHEN sales_order_address`.`address_type <> "shipping" THEN postcode END` AS `shipping_postcode`, `CASE WHEN sales_order_address`.`address_type <> "shipping" THEN city END` AS `shipping_city`, `CASE WHEN sales_order_address`.`address_type <> "billing" THEN street END` AS `billing_street`, `CASE WHEN sales_order_address`.`address_type <> "billing" THEN postcode END` AS `billing_postcode`, `CASE WHEN sales_order_address`.`address_type <> "billing" THEN city END` AS `billing_city` FROM `sales_order_grid` AS `main_table` LEFT JOIN `sales_invoice_grid` AS `cgf` ON main_table.entity_id = cgf.order_id LEFT JOIN `sales_order_address` ON main_table.entity_id = sales_order_address.parent_id WHERE (main_table.store_id = 2)

You can see there error, there shouldn't have ` before CASE and after END
`CASE WHEN sales_order_address`.`address_type <> "billing" THEN postcode END`

Please help me, or welcome for another way


texts: How to change sort direction in magento admin for categories product

texts: In magento $this->setDefaultSort('position'); sorts the grid by 'position' column but in descending order. How can I change its sorting order to Ascending.


texts: Is it Necessary to create layout.xml for massDelete file?

texts:
here my delete action

<action name="delete">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="type" xsi:type="string">delete</item>
                <item name="label" xsi:type="string" translate="true">Delete</item>
                <item name="url" xsi:type="url" path="faq/cat/massDelete"/>
                <item name="confirm" xsi:type="array">
                    <item name="title" xsi:type="string" translate="true">Delete FAQs</item>
                    <item name="message" xsi:type="string" translate="true">Are you sure you wan't to delete selected FAQs?</item>
                </item>
            </item>
        </argument>
    </action>

when I clicked on delete not working


texts:
I've had this issue with my Magento 2.2.3 installation where nothing gets updated in the pub folder. So every time I re-deploy, product images don't get re-populated, and no CSS changes will go through. I've only been able to add rules by putting CSS in template files, those update just fine. I'm not sure what happened to it, it was working fine at one point.

I've tried several CLI commands including static-content:deploy of course. It sounds like it could be a folder permission issue, but when I look the pub folder has the same permissions as the app folder. Anyone else run into this issue?


texts: I want to add one more method same like getUrl method in Vendor/Magento/module-email/Model/AbstractTemplate.php.How we can override?

texts:
I want to add one more method same like getUrl method in Vendor/Magento/module-email/Model/AbstractTemplate.php.

How can we override in magento2.1.12?

If I directly add a new method in Vendor/Magento/module-email/Model/AbstractTemplate.php, what is a problem?


texts: Product Qty Increment / Decrement buttons at checkout page

texts:
I am trying to add my own logic behind the [-] and [+] buttons at the checkout page:

Using the template path helper module, I have found the template that is providing the layout for the basket item rows, which is:

app/design/frontend/MY-TEMPLATE/default/template/checkout/cart/item/default.phtml

This is the code that is rendering the input field for entering the qty (from the template):

        <input readonly name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4" title="<?php echo $this->__('Qty') ?>" class="input-text qty" maxlength="12" />

        <a href="<?php echo $this->getDeleteUrl()?>" title="<?php echo $this->__('Remove')?>" class="btn-remove btn-remove2"><?php echo $this->__('Remove')?>

I cannot find the html/js code that is injecting the [-] and [+] buttons on this template file.

However if I "Inspect" the element (in firefox) I can see the following:

Any idea where these qty inc/dec buttons are coming from - on this page/template?


texts: Integrity constraint violation:1062 Duplicate entry after product import

texts:
I have imported some products into Magento 2.2.6. Everything looks correct in the backend but when I reindex I get this error-

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-510' for key 'PRIMARY', query was: INSERT  INTO `temp_catalog_category_tree_index_40850d82` (`parent_id`,`child_id`) VALUES (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?,
Product Categories indexer process unknown error:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-510' for key 'PRIMARY', query was: INSERT  INTO `temp_catalog_category_tree_index_cebdbaaf` (`parent_id`,`child_id`) VALUES (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?,
Catalog Rule Product index has been rebuilt successfully in 00:00:00

I can't find that table to remove duplicate so it must be pulling from another table. Which one is it?


texts: Magento 2 - Using context variables for cache segmentation

texts:
I am trying to deliver different content with magento 2 based on default country of the visitor.
I am using for that a plugin like this: https://github.com/dmytro-ch/m2-custom-cache-context/
But magento seems to ignore my customs context variables set with a plugin beforeGetVaryString.
I am using version 2.4.1
Any help would be very appreciated.
Thanx


texts:
I would like to pull a  from another phtml to my, how can I do this?
I would like to use the same div that appears for the desktop cart for the mobile cart.

My Phtml

Itens in cart!

Magento PHTML

<?php $_items = $this->getRecentItems(); ?>
<?php if (count($_items)): ?>

            <?php if ($tmpHtml = $this->getChildHtml('block_mini_cart_above_products')): ?>

<?php echo $tmpHtml; ?>

            <?php endif; ?>

<?php echo $this->__('Recently added item(s)') ?>

            <?php foreach($_items as $_item): ?>
                <?php echo $this->getItemHtml($_item) ?>
            <?php endforeach; ?>

                <?php if ($canApplyMsrp): ?>
                    <?php echo $this->__('ORDER TOTAL WILL BE DISPLAYED BEFORE YOU SUBMIT THE ORDER'); ?>
                <?php else: ?>
                    <?php echo $this->__('Cart Subtotal:') ?> <?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()) ?>
                    <?php if ($_subtotalInclTax = $this->getSubtotalInclTax()): ?>

                        (<?php echo Mage::helper('checkout')->formatPrice($_subtotalInclTax) ?> <?php echo Mage::helper('tax')->getIncExcText(true) ?>)
                    <?php endif; ?>
                <?php endif; ?>

                <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('View all items in your shopping cart')) ?>" class="button btn-inline-ver-carrinho" onclick="setLocation('<?php echo $this->getUrl('checkout/cart') ?>')">Ver Carrinho</button>

                <?php if($_cartQty && $this->isPossibleOnepageCheckout()): ?>
                    <button type="button" class="button btn-checkout-finalizar-compra btn-inline" onclick="setLocation('<?php echo $this->getCheckoutUrl(); ?>')">Finalizar
Compra</button>
                    <?php echo $this->getChildHtml('extra_actions') ?>
                <?php endif; ?>

<?php else: ?>


texts: how to set BaseImage, Small Image, Thumbnail to different images for each product in database

texts:
I have imported a number of products at once, but the problem is: the Base Image, Small Image, Thumbnail are all set to the same image.

On the catalog page, I'm trying to change the image shown when you hover over a product. I believe, to do this, the small image and thumbnail image would need to be set to different images for the same product.

How can I achieve this?

I found below query, but I do not understand how to modify it to meet my requirement.

UPDATE
    catalog_product_entity_media_gallery AS mg,
    catalog_product_entity_media_gallery_value AS mgv,
    catalog_product_entity_varchar AS ev
SET
    ev.value = mg.value
WHERE
    mg.value_id = mgv.value_id
AND
    mg.entity_id = ev.entity_id
AND
    ev.attribute_id IN (70, 71, 72)
AND
    mgv.position = 1;

Please, can you help me find the right modifications.


texts: how to override Custom theme phtml file by custom module

texts:
I Want to override this is Current theme path that i want to override.
 I have a file In

  /public_html/app/design/frontend/Venustheme/fashion/Magento_Catalog/templates/product/view/gallery.phtml

but i want to override in my theme, Path Like :-

  app/code/Vendor/Module/view/frontend/templates/gallery.phtml

here is my xml file :-preview_product_gallery.xml

<?xml version="1.0"?>
    <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
            <referenceContainer name="content">
                <referenceBlock name="product.list.gallery">
                    <action method="setTemplate">
                        <argument name="template" xsi:type="string">Vendor_Module::gallery.phtml</argument>
                    </action>
                </referenceBlock>
            </referenceContainer>
        </body>
    </page>


texts: created plugin to override the response of customer details

texts:
I have created the plugin to override the customer details response based on the token. URL I am using to get customer details is: v1/customers/me

In my plugin folder, I have created a file ModifyUserResponse.php code is as below:

namespace Henote\Overrideresponse\Plugin;

class ModifyUserResponse
{
    public function afterGetById(\Magento\Customer\Api\CustomerRepositoryInterface $subject, $result) {
  $modifiedresult=array();

    if($result){
      $modifiedresult['user_details']=$result;
      $modifiedresult['status']=200;
      $modifiedresult['success']=true;
      $modifiedresult['message']="Data Successfully generated";
    }
    echo json_encode($modifiedresult);
    exit;

}

}

In my etc/di.xml i have mentioned this class:

I am getting the response in json format but the userdetails are missing and the json array is as below:
``{"user_details":{},"status":200,"success":true,"message":"Data Successfully generated"}

I don't know where I am doing wrong. Please correct me if I am wrong anywhere.


texts: Clarifications regarding the extra filterable attributes for product import in Magento2

texts:
I need to know the function of this column in magento2x product import csv template.

additional_attributes column

1) How to map extra attributes (filterables in particular) to products?

2) Where can we check once added?

3) How to configure the same?

4) Also, how to add 'Brand' attribute in Magento2?


texts: Magento 2 : Default filter on sales admin order grid

texts:
I need to create a filter on sales admin order grid that only shows the orders that contain products from a specific source.

I found questions that sort of answered this for Magento 1 but not for Magento 2. Most of the solutions add a custom column to the grid and filter on that.

I need this filter to be executed on page load. If the order contains products from source A, the admin should not be able to see orders for products from source B in the grid.


texts: Error message display using js in backend

texts:
I want to display an error message on the form/listing in magento 2 back-end. I know how to show those message using a controller.

But how can i achieve same with JavaScript.


texts: Fatal error: Class 'Zend_Cache' not found /app/code/core/Mage/Core/Model/Cache.php

texts:
Does anyone know why this kind of messages appear? It seems like my Magento installation does not fully load all Zend classes, although they are there on a proper place with proper file permissions.

If I try removing the whole project and uploading it again, it happens again, only with different Zend class.

Does anyone know how to debug these kind of errors?

SOLVED: by clearing the APC cache on the server. For whatever the reason, it loaded the old instance of Magento in cache and only partially the new ones, therefore causing the buggy behaviour.

Thanks once again to Alan and mbalparda for their responses.


texts:
I have added the log in form to a custom page that I want customers to be able to log in from. It currently looks like this in the layout file

   <block type="customer/form_login" name="customer_form_login" template="customer/form/login.phtml"/>

and is called from the phtml like this

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

After a user submits this I'd prefer if it didn't redirect anywhere. I know I could stop this happening from it's controller but I don't want to change how it behaves all over the website. Is there a way I can stop it redirecting from the layout file where I reference it in my custom block. This would allow me to achieve my goal of no redirect in the custom page but standard behaviour throughout the rest of the site.


texts:
Added a couple of functions, trying to call them in the form template and get the error.

<?php

    class RonisBT_Feedback_Helper_Data extends Mage_Core_Helper_Abstract
    {

        public function getName()
        {
            if (Mage::getSingleton('customer/session')->getFeedbackName() != "") {
                $name = Mage::getSingleton('customer/session')->getFeedbackName();
            } else {
                $name = $this->helper('contacts')->getUserName();
            }
            return $name;
        }

        public function getEmail()
        {
            if (Mage::getSingleton('customer/session')->getFeedbackEmail() != "") {
                $email = Mage::getSingleton('customer/session')->getFeedbackEmail();
            } else {
                $email = $this->helper('contacts')->getUserName();
            }
            return $email;
        }

        public function getPhone()
        {
            Mage::getSingleton('customer/session')->getFeedbackPhone();
            $phone = Mage::getSingleton('customer/session')->getFeedbackPhone();
            return $phone;
        }

        public function getMessage()
        {
            Mage::getSingleton('customer/session')->getFeedbackMessage();
            $message = Mage::getSingleton('customer/session')->getFeedbackMessage();

            return $message;
        }
    }

Call

<?php echo Mage::helper('feedback')->getName(); ?>

I get this error.
Fatal error: Call to undefined method RonisBT_Feedback_Helper_Data::helper()


texts: How to use Mage::getModel() on Magento 2?

texts:
I need to convert my following Mage::getModel() from Magento1 to Magento2

$cart_api = Mage::getModel('checkout/cart_api');
$quoteId = $cart_api->create($storeObject->getStoreId());
$quote = Mage::getModel('sales/quote')->loadByIdWithoutStore($quoteId);

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

$customer = Mage::getModel('customer/customer');
$customerAddress = Mage::getModel('customer/address');

$convertQuoteObj = Mage::getModel('sales/convert_quote');

$storeObject = Mage::getModel('core/store')->load(1);

So anyone let me know the correct method for Magento2.


texts: How to hide category name on category page only for second level category in magento 2

texts:
I want to hide the category name on the category page only for the sub category of only one parent category.
The category names will be displayed for all other categories and sub categories.
For e.g I have Cat A-> Cat B -> Cat C
And Cat D-> Cat E-> Cat F

I want to hide all the category names on category page of level Cat B.
For rest, it will be displayed.


texts: PAGINATION : Show First and Last Page at pager / toolbar grid view

texts:
at the moment my pager at grid view is like this " 1 2 3 4 5 >" on page 5 it's "< 5 6 7 8 9 >". See Screenshot

How can I edit my pager.phtml template to get a result like this : " 1 2 3 4 5 Last >" or "First < 5 6 7 8 9 > Last"

I want to show the first and last page on my pager.


texts:
I have a question and I'm not sure if anyone can help me.

I found out that I have to set webroot to the pub/ folder.

So what I did was basically change the document root for my domain in my cpanel - addon domains to /public_html/magento2/pub.

I know that it is pointing to the pub and my website works.

However when the email for product alert sends out the email. All the pictures are broken links. When I inspect the pictures on my browser, the link adds the /pub/media.....

However my domain should be pointing to the pub folder and should not add the pub again.

Can anyone let me know if it is normal and also the way I change the document root to /pub is the correct way?

I have a the managed cloud hosting with Siteground.

Thank you


texts: Product Image in my orders -Magento My acccount

texts: How show product thumbnail instead of order id


texts: what are the parameters mandateory to dispatchEvent?

texts:
// Init and load product
Mage::dispatchEvent('catalog_controller_product_init_before', array(
    'controller_action' => $controller,
    'params' => $params,
));

magento always dispatches events like the above. Is it necessary to pass the $controller and $params to the Mage::dispatchEvent()


texts: want to add qty's to custom options but have nowhere to add extra weight?

texts: I have a product that can be sold as 1 or up to a case which is 4. The drop down allows me to add the qty but not the additional weight. Im I missing something? This is a hazmat item so weight is very important.


texts: Magento2 - dispatched event for create shipment

texts:
I'm looking for similar event like sales_order_shipment_save_after and sales_order_shipment_save_before in Magento1.

Oh I am using Magento 2.1.3.

I tried

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="sales_order_shipment_save_before">
        <observer name="poczta_beforeshipment" instance="Test\Poczta\Observer\BeforeShipment" />
    </event>
    <event name="sales_order_shipment_save_after">
        <observer name="pocztapolska_aftershipment" instance="Test\Poczta\Observer\AfterShipment" />
    </event>
</config>

But it is not working.
I tried find it here https://cyrillschumacher.com/magento2-list-of-all-dispatched-events/
but I'm not sure what one is a correct.

Should I use observer via di instead event observer?
http://blog.chapagain.com.np/magento-2-before-after-method-event-observer-using-plugin/


texts:
I use this code to display a line between 08.00h and 18.00h;

<?php if( (date('H') >= 8) && (date('H') < 18) ) : ?>

But I only want to display this line from Monday till Friday.
What line do I need to use for this?


texts: Best practices adding css/less to custom widget block

texts:
I created a custom widget inside my module and I'm trying to figure out how to add css to widget template. I can do it with the styles tag inside my template (phtml) but I assume that is not the right way?

How should you add custom css / less code to your widget block?


texts: i am using magento 1.9. when clicking add to cart button, want to add customer id (who logged in) at the end of product URL (like http://www.google.com/product_1&cusomer_id=1) is it possible?


texts: Magento 2 - Google analytics / Tag manager does not track afilliates and gclid details

texts:
I have just updated our store at https://okulos.com.br from M1.9.4.1 to M2.3.2.

First I added Google Analytics via Magento admin panel. It tracked visits fine but I could not track sources like gclid for AdWords and others form our partners.

Then I disabled GA and enabled Tag Manager. Still getting the same issue.

Anyone can help me ?

Thanks !!!


texts: how to restrict the specific product in the cart page that should not allowed to specific country?

texts:
this should be done in the Web Shop Apps Matrix Rate – #1 Multiple Table Rates Extension.the product added in the cart page ,and only the specific product should
be allowed to certain country.and restricted for some country.this should be done only by using the above extension.


texts:
We have an old Magento 2 installation, roughly a year old. Browsing the magento site it looks like patches are only for 1.x and not 2.x. Is that right? So for the latest fixes I need to upgrade to the latest version of 2.x?

Thanks


texts: how to set cron.sh for magento using ssh

texts:
I am weak in server handling I want to know to to set crontab to start cron.sh for my magento website.

when I run command

crontab -l

I get output

  no crontab for root

i tried editing /etc/crontab and restarted apache but still it does not works please guide me how to fix it

line I put in etc/crontab is

**5 * * * * root /bin/sh /var/www/mour/cron.sh**


texts: Category Controller overriding to allow multiple Categories in URL

texts:
My custom module (AKA AraujoPhillips/SpecialCategories) should allow URLs with multiple categories, like:

example.com/category1/category2.html

example.com/sales/phones.html

The following custom router manage these kind of URLs (Which is working):

AraujoPhillips/SpecialCategories/Controller/Router.php

public function match(Zend_Controller_Request_Http $request)
{
    $this->request = $request;
    $this->realUri = /* Some code here */;
    $this->mainCategoryPath = /* Some code here */;

    if ($this->isSpecialCategoryUri($this->realUri)) {
        $urlRewrite = Mage::getModel('core/url_rewrite');

        $urlRewrite->setStoreId(Mage::app()->getStore()->getId())
            ->loadByRequestPath($this->mainCategoryPath);

        $this->request->setPathInfo($this->mainCategoryPath);
        $this->request->setModuleName('catalog');
        $this->request->setControllerName('category');
        $this->request->setActionName('view');

        $this->request->setParam(
                            'id',
                            $urlRewrite->getCategoryId()
                        );

        $urlRewrite->rewrite($this->request);

        return true;
    }

    return false;
}

/**
  * Eval if the category allows more categories in URL
  * @param string
  * @return boolean
  */
 private function isSpecialCategoryUri($uri){
    // Do something
 }

Everything looks good at this point.

Then, I'm trying to extend CategoryController.php from Mage_Catalog_CategoryController:

AraujoPhillips/SpecialCategories/etc/config.xml

<config>
    <modules>
        <AraujoPhillips_SpecialCategories>
            <version>0.1.0</version>
        </AraujoPhillips_SpecialCategories>
    </modules>
    <global>
        ...
        <events>
            <controller_front_init_routers>
                <observers>
                    <araujophillips_specialcategories>
                        ...
                    </araujophillips_specialcategories>
                </observers>
            </controller_front_init_routers>
        </events>
    </global>
    <frontend>
        <routers>
            <catalog>
                <args>
                    <modules>
                        <AraujoPhillips_SpecialCategories before="Mage_Catalog">AraujoPhillips_SpecialCategories</AraujoPhillips_SpecialCategories>
                    </modules>
                </args>
            </catalog>
        </routers>
    </frontend>
</config>

And finally:

AraujoPhillips/SpecialCategories/controllers/CategoryControllers.php

require_once Mage::getModuleDir('controllers','Mage_Catalog').DS.'CategoryController.php';

class AraujoPhillips_SpecialCategories_CategoryController extends Mage_Catalog_CategoryController
{
    public function viewAction()
    {
        echo 'It worked!!';
        die();
    }
}

The message 'It worked!!' is not being shown so the CategoryController.php file is not being extended.

Where is the error?


texts: Get the existing product id in Magento 2

texts:
How to get the existing product id from my Model.

<?php

class SyncObserver implements ObserverInterface {

    function __construct
    (
    \Vendor\Module\Model\Engine $syncEngineFactory
    ) {
        $this->syncEngineFactory = $syncEngineFactory;
    }

    public function execute(\Magento\Framework\Event\Observer $observer) {
        $product = $observer->getEvent()->getProduct();
        $this->productUpdate($product);
        return $this;

   public function productUpdate($product){
     $productId = 1;
     $objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
     $currentproduct = $objectManager->create('Vendor\Module\ResourceModel\Queue')->load($productId,'entity_id');   //Erro here   'Recoverable Error: Argument 1 passed to Magento\Framework\Model\ResourceModel\Db\AbstractDb::load()
    }
}

UPDATE:

Event is : catalog_product_save_after

<event name="catalog_product_save_after">
    <observer name="catalog_product_save_after_handler" instance="Vendor\Module\Observer\SyncObserver"/>
</event>


texts: Magento 2: How to fetch system config value in an email template

texts:
I am trying to fetch system config value inside an html file for email template. But below code is not working
{{config path="design/footer/copyright"}}

Can someone suggest if there is another way or syntax to do this?


texts: Special symbols are also allowed in magento 2 User name & Role name?

texts:
Only Alphabetic characters are allowed. But in actual Special symbols are also allowed.
I don't special symbols while creating User/Role. Someone tell me how to do this. Which file need to be override?


texts: Saving a value without triggering aftersave()

texts:
I'm not going in detail about what i'm exactly saving because this question is regards all the possible thing you can save with the ->save() function in each repository.

Anyways , when importing data from an API i use the save() method to store the data that i retrieved. Now it seems that that save() will trigger my plugin AfterSave().

Which makes sense right?

But now is the question. The AfterSave() is ment for when a customer or an admin saves an order/product/customer/... and not for when this is triggered over an autosync (cron job).

Is there somewhere where i can put a filter to determine when to use aftersave and when not?


texts: Magento 2 - Customer click stock alert on product page after logged in it shows 404 page

texts:
When customer click subscribe to price or stock notification (on product page) then after login, gets redirected to the 404 page.

Any help, experience and knowledge sharing would be appreciated.


texts: What model to use to query customer_entity_varchar table in Magento 2?

texts:
I have a custom varchar attribute stored on customers. I've been struggling to find the proper way to query for a specific attribute value without going straight to SQL joins. What is the right way to query a custom attribute from a model?

e.g. customer a has "my_attribute" value of "3aF"

How do I query the customer model / collection to find the user based on that value?


texts: 500-ERROR when trying to download custom option file

texts:
I want to add the custom option to upload files so my clients can add pictures or files to their respective products. This is working fine.

When I try to retrieve the files, this becomes an issue and I get 500 error like this:

[Mon Feb 06 10:52:33 2012] [error] [client x.x.x.x] PHP Fatal error:  Undefined class constant ‘OPTION_PREFIX’ in /var/www/vhosts/domain.com/httpdocs/app/code/core/Mage/Sales/controllers/DownloadController.php on line 160, referer: https://www.domain.com/index.php/admin/sales_order/view/order_id/15/key/3f88d86de2532ab233077d978054dfe2/

Has anybody had anything like this before? Please suggest a solution.


texts: How to load filter state for admin grid?

texts:
I'm looking for a way to get the state/settings for the order_sales_view grid on a in a php class.

I want to load the grid and the filter state to use for selecting previous and next order according to the logged in user settings in the sales order grid.

By using \Magento\Ui\Api\BookmarkManagementInterface I can find the grid settings.

public function __construct(\Magento\Ui\Api\BookmarkManagementInterface $bookmarkManagement){
    $bookmark = $this->bookmarkManagement->loadByNamespace('sales_order_grid');
}

This does not load the filter settings.
How can i load the filter settings?


texts: Magento 2 What we can do when two modules override same block?

texts:
I have two modules which are using the same block function.

i.e. module 1-> ABC, module 2-> XYZ

both modules are using preference method to override core module's block file.

=> Let say in core block file there is one function name getPrice() and it will return price. Both modules are overriding the same class function to manipulate the new price.

module ABC return price multiply by 2
module XYZ return price addition by 50

and I want both modules should work with its own extended function. How it can be work?

What solution do I need to apply it so both functions will work perfectly?


texts: Why it's showing Undefined index when I try to convert a module from M1 to M2?

texts:
I'm trying to convert one module to M2, and after running the code_conversion_tool, I've ended up with .converted files all around.

I've renamed them to replace the actual files.

While doing setup:upgrade I get:

[Exception]
  Notice: Undefined index: modules in <path to magento2>/vendor/magento/framework/App/Route/Config/Converter.php on line 47

If I remove the module from the app/code folder the error disappears, so it's clear that is the converted module causing this.

How can I pinpoint the origin of this issue?

I've done  " grep -rnisI "converter" * " inside the module folder and got 2 references for the word "Converter"

Model/Checkout/Onepage.php:30:
\Magento\Framework\Api\ExtensibleDataObjectConverter $extensibleDataObjectConverter,

Model/Checkout/Onepage.php:59:
$extensibleDataObjectConverter,

But i don't see any relation with line 47 wich is:

$routeConfig['modules'] = $this->_sortModulesList($routeConfig['modules']);

Can someone help, please?


texts: Magento 2.3.1 how to disable default rich snippets

texts:
i install a 3rd party rich snippets on my site that comes with porto theme i have done a structured data test today and it,s shows 2 sets of product now google always picking the default one.
can some one help me to remove magento default rich snippets so i can use the 3rd party rich snippets


texts: How to create a dynamic generated admin fields?

texts:
How to create multiple custom configuration for two multiple fields?.

And how to get it in frontend?


texts: Changing a fieldset label on an ui-components form

texts:
I have a form built with ui-components.
And when changing a field, I'm trying to change the label of the fieldset that contains that field.
Here is what I have (the significant part)

THe fieldset definition:

             <fieldset name="steps">
                <settings>
                    Step config
                    <collapsible>true</collapsible>
                </settings>
                <field name="title" formElement="input" component="[Namespace_Module]/js/fieldset-title">
                    <argument name="data" xsi:type="array">
                        <item name="config" xsi:type="array">
                            <item name="fit" xsi:type="boolean">false</item>
                        </item>
                    </argument>
                    <settings>
                        <validation>
                            <rule name="required-entry" xsi:type="boolean">true</rule>
                        </validation>
                        <dataType>text</dataType>
                        Title
                        <dataScope>title</dataScope>
                    </settings>
                </field>
            </fieldset>

and the fieldset-title js file that handles my title field looks like this:

define([
    'Magento_Ui/js/form/element/abstract',
    'uiRegistry'
], function (Abstract, uiRegistry) {
    'use strict';

    return Abstract.extend({
        onUpdate: function (value) {
            var fieldset = uiRegistry.get({'name': this.parentName});
            fieldset.label(value);
        }
    });
});

What I'm saying here is ... "when the value of my input changes, set the same value as fieldset label".

Additional info:
Inside js, fieldset is retrieved properly. I get the fieldset instance I need.
The value variable is what I'm expecting it to be.

Other than
fieldset.label(value); I tried fieldset.label = value; fieldset.setLabel(value);, fieldset.getLabel(value);


texts: Additional Parameter when Add items to cart

texts:
I'm needing to save an additional parameter when the customer click in "addToCart". In the product page I added a box with some data to fill. When the customer click on "addToCart" these data should be saved in a column created in sales_flat_quote_item called "passengers_data". But I can't save in my custom column.

I've created a Event to catch the custom parameters.
Here is my config.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<config>
    <modules>
        <DevXIII_CpfPlus>
            <version>0.1.0</version>
        </DevXIII_CpfPlus>
    </modules>

    <global>

        <models>
            <cpfplus>
                <class>DevXIII_CpfPlus_Model</class>
            </cpfplus>
        </models>

        <events>
            <checkout_cart_add_product_complete>
                <observers>
                    <cpfplus>
                        <type>singleton</type>
                        <class>cpfplus/observer</class>
                        <method>convertPassengers</method>
                    </cpfplus>
                </observers>
            </checkout_cart_add_product_complete>
        </events>

        <resources>
            <cpfplus_setup>

                <setup>
                    <module>DevXIII_CpfPlus</module>
                    <class>DevXIII_CpfPlus_Model_Resource_Setup</class>
                </setup>
                <connection>
                    <use>directory_setup</use>
                </connection>

            </cpfplus_setup>
        </resources>
    </global>

    <frontend>

        <!-- Begin: Sobrescrevendo o controller do checkout -->
        <routers>
            <checkout>
                <args>
                    <modules>
                        <DevXIII_CpfPlus before="Mage_Checkout">DevXIII_CpfPlus</DevXIII_CpfPlus>
                    </modules>
                </args>
            </checkout>
        </routers>
        <!-- End: Sobrescrevendo o controller do checkout -->

        <layout>
            <updates>
                <cpfplus>
                    <file>cpfplus.xml</file>
                </cpfplus>
            </updates>
        </layout>
    </frontend>
</config>

And here is my Model/Observer.php:

<?php

class DevXIII_CpfPlus_Model_Observer
{

    public function convertPassengers( $observer )
    {
        $item = $observer->getQuoteItem();
        $product = $observer->getProduct();

        $params = $observer->getRequest()->getParams();

    }

}

The idea is save these data to display for each product saved in order, but I don't know how I can do this.

Thanks!!!


texts: Open Graph Protocol Image Too Small Magento 2

texts:
I notice the default code for the image open graph protocol generates the smallest image available.

<meta property="og:image" content="<?= $block->escapeUrl($block->getImage($block->getProduct(), 'product_base_image')->getImageUrl()) ?>" />

How do I get the image that's shown on the product page (which is actually over 1000px)?

I am trying to upload products to a Facebook catalogue via pixel (it uses Open Graph data). And I can only presume this is the reason why it's not working correctly.


texts: Magento 2.2.4 white page after admin login showing unknown url

texts:
When i login as admin in magento2 i get redirect to same page, but there is a blank HTML body. Only an url (https://www.censoredunnecessaryurl.co.uk/pub/health_check.php) is displayed, which is not linked in any way to our store.
I cant find this url in database and no file was edited in last weeks.
A few weeks ago we set up a developer store by cloning production page on same server with different subdomain. On this every login works without this error.
I disabled cache, cleared cookies and reindexed our store. I dont know what to do else.
Any ideas?


texts: Sell products in pack with restriction of choice

texts:
i want to sell products in packs like table, chair and flower all set to qty 1,

So i made bundled product now issue is that i want that will not have option to remove items from packs , he will have to buy it as set .

How can i do this .

Please not table , chair and flower are simple products .


texts: How to generate Password Reset Token in Magento 2

texts:
I want to generate password reset token in Magento 2.

In magento 1, I was generating token by using below code -

$oldtoken = $cust->getRpToken();
$newResetPasswordLinkToken = Mage::helper('customer')->generateResetPasswordLinkToken();
$cust->changeResetPasswordLinkToken($newResetPasswordLinkToken);`

But not sure how to generate in magento 2.

I have search complete /vendor/magento/module-customer but not able to generate Token.

Edit -

Code for Magento 2 -

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$helper = $objectManager->get('\Magento\Customer\Helper\View');
$newResetPasswordLinkToken = $helper->generateResetPasswordLinkToken();
$cust->changeResetPasswordLinkToken($newResetPasswordLinkToken);


texts: Magento 2 - Email Template Variable Condition

texts:
I am trying to show some information in an email template based on a shipping method that is chosen.  Here is what I have tried:
Note: var order.getShippingDescription() returns Pickup - Pickup
{{if var shippingMethod == 'shippingcode_shippingcode'}}
Hello
{{/if}}

{{if var order.getShippingDescription() == 'Pickup - Pickup'}}
Hello 2
{{/if}}

{{if var order.getShippingDescription('Pickup - Pickup')}}
Hello 3
{{/if}}

None of the following returns any information:

{{trans "ShippingMethod"}}{{var shippingMethod|raw}}

{{trans "ShippingMethod 2"}}{{var shippingMethod}}

{{trans "ShippingMethod 3"}}{{var shippingMethodCode}}

Any idea how I can do this?
Thanks,
Stan


texts: How to manipulate product position in Magento's search results?

texts:
I am trying to figure out how Magento sorts products and how one can move a product up or down in the catalog search results.

How can this be done?


texts: Magento2 Shipping Methods are not display in fronend

texts:
i have checked in magento2 core file and it returns empty array :  $shippingAddress->getGroupedAllShippingRates()
and becuase of that my shipping methods are not display.
Line No:289

vendor/magento/module-quote/Model/ShippingMethodManagement.php

any one suggest please how i can solve this issue ?


texts: How to program yes/no/any in grid with serializer (within edit form)?

texts:
I have edit page of some entity with tab with grid and serializer.
So, above checkboxes we can see the dropdown which is responsible of list of chosen elements or non-chosen element or show all of ones.
It doesn't work from me. When I press Yes/No and Search it doesn't affect getting items on ajax request.

Add column:

$this->addColumn(
    'selected_countries',
    array(
        'type'       => 'checkbox',
        'index'      => 'country_id',
        'align'      => 'center',
        'name'       => 'selected_countries',
        'field_name' => 'selected_countries',
        'values'     => $this->getSelectedItems(),
    )
);

layout update:

<reference name="left">
    <block type="restrictshipping/adminhtml_rule_edit_tabs"
           name="restrict_shipping_rule_edit_tabs"
           as="rule.edit.tabs">
        <block type="restrictshipping/adminhtml_rule_edit_tab_countriesList"
               name="restrict_shipping_rule_edit_countries_list"
               as="rule.edit.tab.countries.list">
        </block>
        <action method="addTab" >
            <name>rule_edit_tab_countries_list</name>
            <block>rule.edit.tab.countries.list</block>
        </action>
    </block>

            <block type="adminhtml/widget_grid_serializer" name="related_grid_serializer">
                <action method="initSerializerBlock">
                    <grid_block_name>restrict_shipping_rule_edit_countries_list</grid_block_name>
                    <data_callback>getSelectedItems</data_callback>
                    <hidden_input_name>selected_countries_ids</hidden_input_name>
                    <reload_param_name>country_id_reload</reload_param_name>
                </action>
                <action method="setFormId">
                    <id>edit_form</id>
                </action>
            </block>
</reference>

Also it doesn't send selected items IDs.

And there is a strange behavior:

public function getCondition()
{
    if ($this->getValue()) {
        return $this->getColumn()->getValue();
    }
    else {
        return array(
            array('neq'=>$this->getColumn()->getValue()),
            array('is'=>new Zend_Db_Expr('NULL'))
        );
    }
    //return array('like'=>'%'.$this->getValue().'%');
}

because Mage/Adminhtml/Block/Widget/Grid.php:470

I believe it must use in if value === 1 and nin if value === 0 and not use any filter when value === ''. I don't understand how it can work...


texts: Why my sales aren't showing in Magento 2 Admin Panel?

texts:
I can see my sales in sales_order table, though, I can't see in sales_order_grid.

I guess that it's some related to it, how can I solve it?


texts:
Normally you can get order shipment colletion like this from order:

$order->getShipmentsCollection();

but i'd like to retrieve the collection of shipments using order id, and i want to sort it by entity_id, so it will become like this:

$shipmentCollections = $this->shipmentModel->create()
                    ->getCollection()->addFieldToFilter("order_id",$orderId)->setOrder('entity_id','DESC');


texts: Magento 2 : Frontend load ajax page custom product collection with search set total items

texts: Facing issue with frontend load ajax page custom product collection with search set total items 1 in Magento 2.


texts:
I have accidentally deleted the "color" attribute with the ->delete(); function.

Would anyone know what entries and in what tables need to be restored?


texts: Place order button does not work Magento 1.9

texts:
My website works completely fine until few hours ago I received couple of messages that customers cannot click on the Place order button. I have one step checkout module installed since day one that my site launched and suddenly it stopped working.

I clicked on the inspect console and this error pops up.

Please help..


texts: how to change customer session data in Magento 2?

texts:
after customer login, I want to change some of the session params like customer name. I do like this

$this->_customerSession->getCustomer()->setName("ddddddd");

also i tried this

$this->_customerSession->setName("ddddddd");

but it does not work.so how I can change the customer basic data, also how Magento handles session data? I think after every request the Magento set session data from database...hmmm am I going wrong?
is there anyone to talk about this?

  I want to change the customer name and this change should be staying
  until the customer is login  ...lets to review my problem ... I have a
  customer that can have sub customer (or may should I say, members)
  when a sub customer want to login with his/her username and password I
  check them and if they were correct I get parent customer and set it
  login but I want to replace parent name with sub customer


texts: Magento 1: API SOAP V2 created configurable product with associated simples

texts:
Description:
I need help with the creation of a configurable products with Magento SOAP API V2.

My problem is:

I managed to create the configurable product, but there aren't any simple associated and when I open the configurable I see a windows that tell me "Select Configurable Attributes".

I thought there is a mistake in the configurable attributes.

Additional information:
This is my configurable probuct data array:

$data = array(
"categories" => array("0" => 19),
"websites" => array("0" => 3),
"name" => "Sport",
"description" => "a classic-looking wimbledon-style tennis shoe re-imagined in aged blue leather and featuring a chic band-covering around the box sole",
"short_description" =>"",
"weight" => 0.9600,
"status" => 1,
"url_key" => "sport-pr53801aq000",
"url_path" => "sport-pr53801aq000.html",
"visibility" => 4,
"price" => 395.0000,
"tax_class_id" => 2,
"meta_title" => "Sport - low top - calfskin - PR53801AQ000",
"meta_keyword" =>"",
"meta_description" => "A classic-looking wimbledon-style tennis shoe re-imagined in aged blue leather and featuring a chic band-covering around the box sole",
"stock_data" => array(
"manage_stock" => 1,
"is_in_stock" => 1,
"qty" => 0.0000,
"is_qty_decimal" => "",
"use_config_manage_stock" => 1,
),
"additional_attributes" => array(
"single_data" => array(),
"multi_data" => array(),
),
"has_options" => 1,
"required_options" => 1,
"configurable_attributes" => array("0" => 167), // this correspond to the id of configurable attribute
"associated_ids" => array("82229" => 5661),
)


texts: Magento 2.4.0: Retuning - 'This site can’t be reached127.0.0.1 refused to connect.'

texts:
After a fresh install of Magento 2.4.0 i am unable to access the main site or Admin page due to: 'This site can’t be reached127.0.0.1 refused to connect.'
Setup:
/etc/apache2/sites-available/magento2.conf:
<VirtualHost *:80>
     ServerAdmin magento_admin@localhost
     DocumentRoot /var/www/html/magento2
     ServerName XX.XX.XX.XX
     ServerAlias www.Domain.co.uk
     <Directory "/var/www/html/magento2/">
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        allow from all
     </Directory>
   ErrorLog /var/log/apache2/magento-error_log
   CustomLog /var/log/apache2/magento-access_log common
</VirtualHost>

My Apache.config contains:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

Unsecureurl: --base-url=http://127.0.0.1/magento2/
Actions so far:

Performed all the steps suggested under: https://magecomp.com/blog/fix-404-error-page-not-found-admin-url-magento-2/

reapplied file permissions using:
sudo chown -R www-data:www-data /var/www/html/magento
sudo chmod -R 777 /var/www/html/magento

replaced the .htaccess file in root with the one under pub/

Confirmed domain is pointing to correct directory on Magento server

Server specs: Ubuntu 18.04, Apache 2.4, PHP 7.4.
Please let me know if you have any further recommendations/things I can check.
Thank you

Use proper formatting for your code samples (the apache virtual host configuration is unreadable) - Done

  magento_admin@localhost:/$ apachectl configtest
            Syntax OK

    magento_admin@localhost:/$ apachectl -S
    VirtualHost configuration:
    *:80                   XX.XX.X.XX (/etc/apache2/sites-enabled/magento2.conf:1)
    ServerRoot: "/etc/apache2"
    Main DocumentRoot: "/var/www/html"
    Main ErrorLog: "/var/log/apache2/error.log"
    Mutex default: dir="/var/run/apache2/" mechanism=default
    Mutex watchdog-callback: using_defaults
    Mutex rewrite-map: using_defaults
    Mutex proxy: using_defaults
    PidFile: "/var/run/apache2/apache2.pid"
    Define: DUMP_VHOSTS
    Define: DUMP_RUN_CFG
    User: name="www-data" id=33 not_used
    Group: name="www-data" id=33 not_used

magento_admin@localhost:/$ a2ensite magento2
Site magento2 already enabled

No obvious startup errors:
[Mon Aug 31 16:15:00.367270 2020] [mpm_event:notice] [pid 8558$]
 [Mon Aug 31 16:15:00.372145 2020] [mpm_event:notice] [pid 8558$]
 [Mon Aug 31 16:15:00.372178 2020] [core:notice] [pid 85589:tid$]


texts:
I have problem in remove extension,

How to install git in magento 2?


texts: EE Rewards Points - How to modify number of points given on a product level?

texts:
I am trying to develop a way to use Enterprise Editions rewards points in a more useful fashion.

For example say we have a product with manufacturer of "Sony" and a price of $100

The normal reward exchange rate is 1 point for every dollar spent.

I want to be able to have a custom exchange rate depending on what product is added. So for example if manufacturer is "Sony" , on add to cart they get 3 points for each dollar. So normally they would have 100 points but in this new way, they would get 300 points.

Any advice? Has anyone done this before?


texts: Magento2 : Data Not saving in Custom Table

texts:
I have created a custom module and trying to save data but not saved data into custom_table. I don't know why? I compared same code with my previous Modules Everything is same.

  Here is my installSchema.php

 public function install(\Magento\Framework\Setup\SchemaSetupInterface $setup, \Magento\Framework\Setup\ModuleContextInterface $context)
    {
        $installer = $setup;
        $installer->startSetup();
        if (!$installer->tableExists('table_name')) {
            $table = $installer->getConnection()->newTable(
                $installer->getTable('table_name')
            )->addColumn(
                'row_id',
                \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                null,
                [
                    'primary'  => true,
                    'nullable' => false,
                    'unsigned' => false,
                ],
                'Missing Order ID'
            )->addColumn(
                'entity_id',
                \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                null,
                [
                    'nullable' => false,
                    'unsigned' => false,
                ],
                'Qoute ID'
            )->addColumn(
                'reserved_order_id',
                \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                null,
                [
                    'nullable' => false,
                    'unsigned' => false,
                ],
                'Reserved Order ID'
            )->addColumn(
                'customer_email',
                \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                100,
                [
                    'nullable' => false,
                ],
                'Costumer Email'
            )->addColumn(
                'created_at',
                \Magento\Framework\DB\Ddl\Table::TYPE_DATE,
                null,
                [

                    'nullable' => false,
                ],
                'Order Date'
            )->addColumn(
                'base_grand_total',
                \Magento\Framework\DB\Ddl\Table::TYPE_DECIMAL,
                null,
                [
                    'nullable' => false,
                ],
                'Grand Total'
            )->setComment('Missing Orders');
            $installer->getConnection()->createTable($table);
        }

 $installer->endSetup();
}

here is my code to save data

public function execute(Observer $observer)
    {
        $orderIds = $observer->getEvent()->getOrderIds();
        $order    = $this->orderFactory->create()->load($orderIds[0]);
        $quote    = $this->_quoteFactory->create()->load($order->getQuoteId());
        $order    = null;
        if (empty($order)) {
            try {
                $rowData = $this->_missingOrdersFactory->create();
                $rowData->setEntityId($quote->getEntityId());
                $rowData->setReservedOrderId($quote->getReservedOrderId());
                $rowData->setCustomerEmail($quote->getCustomerEmail());
                $rowData->setCreatedAt($quote->getCreatedAt());
                $rowData->setBaseGrandTotal($quote->getBaseGrandTotal());
                $rowData->save();
                echo "<pre>";
                print_r($rowData->getData());
                exit;
            } catch (\Exception $e) {
                echo $e->getMessage();
            }

        }
    }

  print_r($rowData->getDdata) is returning me

Array
(
    [entity_id] => 200
    [reserved_order_id] => 000000168
    [customer_email] => waqarcui@gmail.com
    [created_at] => 2019-07-03 04:29:03
    [base_grand_total] => 105.0000
)

Thanks.