texts: Magento 2 - what does the require means in composer json?

texts:
"require": {
        "segmentio/analytics-php": "^1.5",
    }

This code is there in composer json, when i have composer update the segmentio lib version changed from 1.5 to 1.7 not sure why.


texts: How to Add "My Cart" on my account navigation in magento2?

texts: How to add New "My Cart" links from the  menu on customer account page?


texts: Does Shopping cart Rule apply to Simple Associated products also?

texts:
I have a shopping cart price rule to only one category say id 20. Now this category has all the configurable products. The simple products of these configurable products do not have any category assigned.

The rule also applies to the simple products also.

Question: Should the rule be applied to these simple products also? Because they do not have any category assigned?

I use Magento ver. 1.9.2.4


texts: Add a link to the header links only if a customer is signed in

texts:
When a customer is logged in, I'd like to add a custom link to Magento's header links, like below:

So far, I've been able to add the link by adding the below to the default.xml file from my theme, but it adds it even when the customer is logged out, I need it to only be added there when the customer is logged in:

<referenceBlock name="header.links">
    <block class="Magento\Framework\View\Element\Html\Link" name="custom-link" before="-">
        <arguments>
            <argument name="label" xsi:type="string" translate="true">Custom Link</argument>
            <argument name="path" xsi:type="string" translate="true">custom</argument>
        </arguments>
    </block>
</referenceBlock>


texts: How to overide "Magento_Sales::email/items.phtml" in custom module?

texts:
I am trying to override core template file
Magento_Sales::email/items.phtml

in custom module, but not sure how to start
Any thoughts please.
i have created  a layout file in view/frontend/layout/sales_email_order_items.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="order_email_items">
            <action method="setEmailItems">
                <argument name="emailItems" xsi:type="string">Emp_Sales::email/items.phtml</argument>
            </action>
        </referenceBlock>
        <referenceBlock name="order_totals">
            <action method="setOrderTotals">
                <argument name="orderTotals" xsi:type="string">Emp_Sales::order/totals.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

Thankyou


texts: Magento 2 replace product images via CSV import

texts:
I'm following this tutorial http://docs.magento.com/m2/ce/user_guide/system/data-import-product-images.html to upload and assign images to product.
I have successfully completed this process but i want to replace exiting images with new images. To replace images following CSV header is used to update images

sku store_view_code attribute_set_code  product_type  base_image  base_image_label  small_image small_image_label thumbnail_image thumbnail_image_label

But problem is instead of replacing images, Magento2 import process adds new image with old image.

(Similar issue with category update : https://github.com/magento/magento2/issues/7930)


texts: What would be the Mage::getSingleton('core/layout') in Magento 2?

texts:
In Magento 1 I can Inject a template through coding like below.

$layout = Mage::getSingleton('core/layout');
$block = $layout->createBlock('module/module_block_identifier');
$block->setTemplate('module/test.phtml');

In Magento 2, how can I inject a template like above?


texts: ADD TO CART button is not working Magento 1.9

texts:
I am facing with problem several days, actually ADD TO CART button is not working. In debug mode of Chrome below messages are generated :

  Refused to execute script from 'http://www.planet-gadgets.ru/index.php/ajaxcartsuper/ajaxcart/add/uenc/aHR0…Gf08Ab/?callback=jQuery172003263813592517817_1484323397815&_=1484323616853' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

  Uncaught TypeError: Cannot read property 'style' of null
  at Function.hide (prototype.js:1931)
  at klass.baseInitialize (controls.js:88)
  at klass.initialize (controls.js:347)
  at new klass (prototype.js:101)
  at klass.initAutocomplete (js.js:349)
  at (index):204

Any kind of help will be useful.

Thanks in advance.


texts:
I have a list of elements printed with a field type='checkboxes' but when I try to save only one of the results saved.

As a solution to this problem, we tried to print each element with a checkbox and so Magento saves it in the database as a single row.

Right now we have an array with the data and what we need is to loop through them as a field in the system.xml

The system.xml is like that:

 <field id="cmspage" translate="label comment" type="checkboxes" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
        <label>Lista pagine</label>
        <source_model>[vendor]\PersonalMenu\Model\Adminhtml\System\Config\Source\Cms\Cms</source_model>
        <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
 </field>

The source_model give in the output the array

Is the backend_model the file where we can set the loop?

Or are there some other ways to customize a module settings page with all the elements dynamically showed?

P.S. sorry for my English


texts: Magento 1.7 wrong tax for product when discount is active

texts:
I have  a fixed discount amount of 30 for the whole cart.
My product price is 189, and product tax is 5% = 9.

When I apply fixed discount of 30, my prodcuct tax should be caluclated for 159, and it should be 7,95. For some reason Magento returns me 7,57 for the tax and 151,43 for the subtotal.

Any ideas?


texts: How can I get product urls of each store view?

texts:
I have 2 store view:

www.example.com (EN Store)
www.example.it (IT Store)

and I have 2 different urls that point at the same products:

www.example.com/car-honda-civic.html (<--- I want obtain this url)
www.example.it/auto-honda-civic.html (<--- and I want obtain this url)

and I use some php function to redirect the users to the right store based on user's language browser (parsing $_SERVER['HTTP_ACCEPT_LANGUAGE']).

I'm trying to get these links into a separate Magento folder and page:

www.example.com/myproject/mypage.php

and this is what I tried to do:

// REQUIRE MAGENTO ESSENTIAL CODE
require_once("../app/Mage.php");
umask(0);

// I NEED TO GET ONLY GROUPED PRODUCTS
$collection = Mage::getResourceModel('catalog/product_collection');
$grouped_collection = array();

foreach($collection as $product) {
    if ($product->getTypeId() == 'grouped') {
      //echo $product->getId();
      array_push($grouped_collection, $product->getId());
    }
}

// E.G.: LOAD PRODUCT 12
$productId = $grouped_collection[12];
$product = Mage::getModel('catalog/product')->load($productId);

// I TRYING TO GET PRODUCT URLS OF EACH STORE VIEW
$productLinkEn = $product->getUrlInStore(array("_store" => "en"));
$productLinkIt = $product->getUrlInStore(array("_store" => "it"));

echo $productLinkEn; //Output: http://www.example.com/auto-honda-civic.html?SID=2fdsfsd34fsdfsdf34$__store=en
echo $productLinkIt; //Output: http://www.example.it/auto-honda-civic.html?SID=2fdsfsd34fsdfsdf34$__store=it

How can I get both clean above urls product?


texts:
I am trying to override an installed language package (magenerds/de_de) with a custom package as described in this answer. My problem is that my custom package is ignored, and I have no idea why.

The magenerds/de_de package is installed in app/i18n/magenerds/de_de, my custom package is in app/i18n/projectxyz/de_de.

composer.json

{
  "name": "projectxyz/language-de_de",
  "description": "German (Germany) language",
  "version": "1.0.0",
  "require": {
    "magento/framework": "100.1.*"
  },
  "type": "magento2-language",
  "autoload": {
    "files": [
      "registration.php"
    ]
  }
}

de_DE.csv

My billing and shipping address are the same,Lieferadresse als Rechnungsadresse verwenden

language.xml

<?xml version="1.0"?>
<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd">
    de_DE
    <vendor>projectxyz</vendor>
    <package>de_de</package>
    <sort_order>10</sort_order>
    <use vendor="magenerds" package="de_de"/>
</language>

registration.php

<?php

/**
 * @category   projectxyz
 * @package    projectxyz_de_de
 * @subpackage Module
 * @version    1.0.0
 * @license    OSL 3.0
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
    'projectxyz_de_de',
    __DIR__
);

Any hint what I could be doing wrong? Thanks!


texts: upgrade javascript library versions in Magento 2

texts:
Recently we have made pen-test on Magento 2.3.3 version.

We have received the following issues.

Vulnerable Javascript Library Versions In Use

  adminhtml/Magento/backend/en_US/jquery/jquery-ui-1.9.2.js
  adminhtml/Magento/backend/en_US/knockoutjs/knockout.js
  adminhtml/Magento/backend/en_US/jquery.js

Can we upgrade these library files to latest versions?

How this can be achieved? Can anyone help me with the steps to implement it.

Thanks in Advance!!


texts: Display Products in shopping cart in a drop down format in Magento

texts:
copy file of sidebar.phtml file in path app\design\frontend\base\default\template\checkout\cart paste in mytheme  name is cart_top.phtml path is mythmeme\template\checkout\cart
add the code in my header.phtml file. <?php echo $this->getLayout()->createBlock('checkout/cart_sidebar')->setTemplate('checkout/cart/cart_top.phtml')->toHtml()."Mycart"; ?> add this code in my header.phtml but block is not working. can you tell me what the issue?


texts:
I am using Custom Tab code "\Phpcmsframework\Customtabs". Followed link is Custom Tabs.
Expected Result : It shows Custom Tab only while adding product details. Here in image Pickup/Dispatch Address show only on this page.

Current Result : It showing Custom Tab in Previous section ie. Product Type section.Showing Pickup/Dispatch Address Tab in both pages.

Here is my Customtabs.xml file.Please refer it.
customtabs.xml

<?xml version="1.0"?>
<layout>
<adminhtml_catalog_product_edit>
    <reference name="product_tabs">
        <action method="addTab">
            <name>my_custom_tab</name>
            <block>customtabs/adminhtml_catalog_product_tab</block>
        </action>
    </reference>
</adminhtml_catalog_product_edit>
<adminhtml_catalog_product_new>
    <reference name="product_tabs">
        <action method="addTab">
            <name>my_custom_tab</name>
            <block>customtabs/adminhtml_catalog_product_tab</block>
        </action>
    </reference>
</adminhtml_catalog_product_new>
</layout>


texts: Issue in Admin Panel after SUPEE Patch 8788 installation

texts:
I have Magento CE 1.9.2.4 installed along with patches (5377,1533,4788 etc. almost all patches).

This question also reveals issues that may/surely occur in any custom module involving Image uploads in their custom sections, rather than just core magento issues.

Now after I installed the latest patch 8788 through command-line, I am not able to open "Add/Edit" page of my custom module, which was working fine prior to 8788 installation.

I am getting below error when I try to open the "Add New Banner" page of my module:

  Fatal error: Call to a member function setUrl() on a non-object in /home/site_user/public_html/app/code/community/My/Module/Block/Adminhtml/Banner/Add/Tab/Image.php on line 57

The culprit line is as below:

$this->getUploader()->getConfig()->setUrl(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/*/image'))

Also I cannot see already uploaded product images in admin Catalog > Manage Products > Any product > Images section.

Below is the core Mage_Adminhtml_Block_Media_Uploader class being called.

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    Mage
 * @package     Mage_Adminhtml
 * @copyright  Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

/**
 * Adminhtml media library uploader
 *
 * @category   Mage
 * @package    Mage_Adminhtml
 * @author      Magento Core Team <core@magentocommerce.com>
 */

/**
 * @deprecated
 * Class Mage_Adminhtml_Block_Media_Uploader
 */
class Mage_Adminhtml_Block_Media_Uploader extends Mage_Uploader_Block_Multiple
{
    /**
     * Constructor for uploader block
     */
    public function __construct()
    {
        parent::__construct();
        $this->getUploaderConfig()->setTarget(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/*/upload'));
        $this->getUploaderConfig()->setFileParameterName('file');
    }
}

Anyone let me know how to fix this with least code changes as possible.


texts: How to add Qty Field on Product Listings Page in Magento 2

texts:
I want to add Qty field on product list page when I have change qty on textbox then qty is updated after add to cart button click. mini cart qty is changed.

Expected Output


texts:
I have created a custom module where i add data. This data is displayed on the grid. On the grid i have enable inline editing.

Now i want to disable this inline editing only when certain condition is match.

Like the parameter passed on the page is x then show the inline edit else disable inline edit.


texts: How to determine upsell products in shopping cart

texts:
In cart items list, is there any data to determine whether products were added from upsell (and realated, cross sell if any)?

Does Magento provide a built-in data for this or I have to do myself by modifying database?

Thank you.


texts: When i run Setup upgrade CLI i got SQLSTATE[42S02]: Base table or view not found

texts:
Please give me the solution for this problem, I didn't change any modules i can't catch this error how it occured

> SQLSTATE[42S02]: Base table or view not found: 1146 Table
> 'amtdb.amt_tbl_price_list_data_from_sheet_marketing' doesn't exist,
> query was: SHOW CREATE TABLE
> amt_tbl_price_list_data_from_sheet_marketing


texts: Mage::getModel('catalog/product')->getCollection() returns only created_at & updated_at attributes

texts:
If I use following, only weight and status are added.

$_products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect("*");

If I could get SKU or entity_id, I can still make another call to get some other attributes, but that is not the option.


texts: Create product with custom option using rest api

texts:
I am trying to create simple product with custom option using rest api but custom option is not saving with product endpoint rest/V1/products. anything missing here
Here is my request body
    {
    "product": {
        "sku": "test_simple_product3",
        "name": "Test Simple Product",
        "attribute_set_id": 4,
        "price": 25,
        "status": 1,
        "visibility": 1,
        "type_id": "simple",
        "weight": "0.5"
    },
    "custom_attributes": [

        {
            "attribute_code": "has_options",
            "value": 1
        },
        {
            "attribute_code": "required_options",
            "value": 1
        }
    ],
    "options": [
        {
            "product_sku": "test_simple_product3",
            "title": "Scelta",
            "type": "checkbox",
            "sort_order": null,
            "is_require": true,
            "price_type": null,
            "values": [
                {
                    "title": "A3",
                    "sort_order": 1,
                    "price": 7.35,
                    "price_type": "fixed",
                    "sku": "A3"
                },
                {
                    "title": "A4",
                    "sort_order": 1,
                    "price": 9.45,
                    "price_type": "fixed",
                    "sku": "A4"
                }
            ]
        }
    ]
}


texts: About accessing only through mage.php to generate json output

texts:
I want to disable the frontend and backend Magento web access temporarily and generate json output from the existing database content.

Am I right when assuming controllers and blocks are not called when doing that?
For a beginner in Magento and PHP in general, what are tips and tricks to find the elements needed to write Magento code when accessing externally just to use the existing business logic (it's not needed to extend it). Do you think I should study the content of blocks and controllers to find out how the different types of models are used to do all the main store processing?
Just out of curiosity, can I have the Magento installation out of the root web directory?


texts: Magento 2.3 - Fresh install admin login error

texts:
I have recently installed magento 2.3.4 via softaculous app installer. Site works fine but while I try to login as admin its displays An error has happened during application run. See exception log for details. When I check it says

  [2020-03-05 14:15:16] main.CRITICAL: Warning: realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/home/admin/web/shop.rrsmedia.tk/public_html:/home/admin/tmp) in /home/admin/web/shop.rrsmedia.tk/public_html/vendor/magento/framework/Filesystem/DirectoryList.php on line 101 {"exception":"[object] (Exception(code: 0): Warning: realpath(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/home/admin/web/shop.rrsmedia.tk/public_html:/home/admin/tmp) in /home/admin/web/shop.rrsmedia.tk/public_html/vendor/magento/framework/Filesystem/DirectoryList.php on line 101 at /home/admin/web/shop.rrsmedia.tk/public_html/vendor/magento/framework/App/ErrorHandler.php:61)"} []`.

I try again after making open_basedir value to none in php.ini and still get the same error.

Anyone can help me with this??

Thanks.


texts: how to show the value in custom grid without saving in table in magento 1.9

texts:
I am trying to show a column in grid using renderer .

here is my renderer file

public function render(Varien_Object $row)
{

    $value =  $row->getData($this->getColumn()->getIndex());
    $collection = Mage::getModel("manager/asmtracker")->load($row->getManagerId());
    $customerId = $collection->getManagerId();
    //$customer=Mage::getModel('customer/customer')->load($customerId);
    $city = Mage::getModel("manager/cities")->getCollection()
                                            ->addFieldToFilter('regionalmanager',array('id' => $customerId))
                                            ->getFirstItem();
    //$reg = Mage::getModel("customer/customer")->load($city->getManagerCity());

    return $city->getName();

}

also my grid.php is :

protected function _prepareColumns()
        {
                $this->addColumn("id", array(
                "header" => Mage::helper("manager")->__("ID"),
                "align" =>"right",
                "width" => "50px",
                "type" => "number",
                "index" => "id",
                ));
                $this->addColumn("manager_id", array(
                "header" => Mage::helper("manager")->__("Manager ID"),
                "index" => "manager_id",
                ));
                $this->addColumn("manager_name", array(
                "header" => Mage::helper("manager")->__("Manager Name"),
                "index" => "manager_name",
                'renderer'  => 'Company_Manager_Block_Adminhtml_Renderer',
                ));
                $this->addColumn("manager_city", array(
                "header" => Mage::helper("manager")->__("City"),
                "index" => "manager_city",
                'renderer'  => 'Company_Manager_Block_Adminhtml_Renderercity',
                ));
                $this->addColumn("punch_in_time", array(
                "header" => Mage::helper("manager")->__("Punch In Time"),
                "index" => "punch_in_time",
                'type'      => 'datetime',
                //'renderer'  => 'Company_Manager_Block_Adminhtml_Rendererintime',
                ));
                $this->addColumn("punch_out_time", array(
                "header" => Mage::helper("manager")->__("Punch Out Time"),
                "index" => "punch_out_time",
                'type'      => 'datetime',
                //'renderer'  => 'Company_Manager_Block_Adminhtml_Rendereroutime',
                ));
                $this->addColumn("in_coordinates", array(
                "header" => Mage::helper("manager")->__("Punch In Location"),
                "index" => "in_coordinates",
                ));
                $this->addColumn("out_coordinates", array(
                "header" => Mage::helper("manager")->__("Punch Out Location"),
                "index" => "out_coordinates",
                ));
                $this->addColumn('create_at', array(
                    'header'    => Mage::helper('manager')->__('Created At'),
                    'index'     => 'create_at',
                    'type'      => 'datetime',
                ));

                    return parent::_prepareColumns();
    }


texts:
I'm using magento 2.3, may i ask how can i made a back button on product view page.
Beacuse i tried this code but not working in the product view page.
Anyone can help? thank you!!

<a class="action back" href="<?php echo $block->escapeUrl($block->getBackUrl()) ?>"><?= __('Back') ?>


texts: Magento 2 get product attribute value without objectManager

texts:
I load some related products inside a foreach and want to call some attribute values of these individual products.

My current code below works fine with using $objectManager, but that's not the best way to handle this.

How can I get the value of the product attribute, without using the $objectManager ?

Code Helper/Data:

<?php
namespace MyModule\LinkedProducts\Helper;

class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
    public function __construct(
        \MagePal\LinkProduct\Model\Accessory $accessory,
        \Magento\Catalog\Block\Product\AbstractProduct $abstractProduct
    ) {
        $this->accessory = $accessory;
        $this->abstractProduct = $abstractProduct;
    }

    public function getLinkedProducts()
    {
    $product = $this->abstractProduct->getProduct();
    return $this->accessory->getAccessoryProducts($product);
    }

}

Code phtml:

<?php $linkedproducts = $this->helper('MyModule\LinkedProducts\Helper\Data');
$relatedProducts = $linkedproducts->getLinkedProducts();?>

<?php foreach ($relatedProducts as $relatedProduct) {

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$_product = $objectManager->create('Magento\Catalog\Model\Product')->load($relatedProduct->getId());
echo $_product->getData('my_attribute_value');
}?>


texts: Need a fix to "Page blocks cache" in Magento CE 1.9.0.1

texts:
It seems there is a bug with the cache in Page blocks.

Here is the description of the problem:
The problem shows first in menu navigation, if I click on a menu category, it gets active, but once I click on an item inside this category, the category is NOT active anymore although in the URL, the same category is still there.

Sometimes, when I navigate between categories and then click on different items in different categories, the older categories get active (highlighted) although the current item I am looking at does NOT below to this category!

Once I disabled cache for Page blocks, there is no problem anymore.

I am using Magento 1.9.0.1 on Ubuntu 14.0.1 server and apache2.

Does somebody have a fix for this bug?


texts: Magento : Is the layout reference scoped for an specific handle?

texts:
When I put the following block inside catalog_category_layered handle, it works and I can call it by getChildHtml(). But when I insert it in default handle it doesn't work at all. Is the catalog.layer.state somehow reserved for an specific list of handles?

<reference name="product_list_toolbar">
    <block type="catalog/layer_state" name="catalog.layer.state" template="catalog/layer/state.phtml" />
</reference>


texts: Forget password link expire, password is updated

texts:
I'm working in magento 1.9.0.1 which has issue with confirm password not match in checkout as guest.

I tried to fix it with following code being provided by StackExchange Magento1.9.1 Please make sure your password match issue

$confirmation = $this->getConfirmation();
$passwordconfirmation = $this->getPasswordConfirmation();
//if ($password != $confirmation) {
if (!(($password == $confirmation) ||
    ($password == $passwordconfirmation))) {
    $errors[] = Mage::helper('customer')->__('Please make sure your passwords match.');
}

When I use "forget password" to reset the password it breaks the first time, but after reload it shows Cannot save a new password.
Your password reset link has expired. but also includes Your password has been updated.


texts: I want to store the detail's in custom variable any one know how to done this?

texts:
I want to store the detail in custom variable any one know how to done this?

like {{order_number}},{{order_price}}

i want set variable at backend.


texts: Magento2 remove columns from admin sales order view page items grid

texts:
Can anyone let me know how to remove existing columns from Admin->Sales->Order->View->Items Grid? Moreover, I also need to add a new column in the same grid, please find attached screenshot for your reference:

I have tried to override vendor/magento/module-sales/view/adminhtml/layout/sales_order_view.xml file in my module and removed some of the columns but it throws the following error.

[2018-10-02 09:18:58] main.CRITICAL: The element 'order_items' already has a child with alias 'default' {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): The element 'order_items' already has a child with alias 'default' at /var/www/html/bannerbuzzmagento2/vendor/magento/framework/Data/Structure.php:611)"} []
[2018-10-02 09:18:59] main.CRITICAL: Invalid block type: Namespace\Module\Block\Adminhtml\DefaultRenderer {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): Invalid block type: Namespace\\Module\\Block\\Adminhtml\\DefaultRenderer at /var/www/html/bannerbuzzmagento2/vendor/magento/framework/View/Layout/Generator/Block.php:275, ReflectionException(code: -1): Class Namespace\\Module\\Block\\Adminhtml\\DefaultRenderer does not exist at /var/www/html/bannerbuzzmagento2/vendor/magento/framework/Code/Reader/ClassReader.php:19)"} []


texts: How can I store additional information against an attribute?

texts:
So, I have an attribute, let's call it Brand, and every Brand has a unique attribute itself, let's call it Warranty. What would be the best way of storing these warranties? So far I can think of:

Storing the warranty information in a helper (but then I'd need to edit code overtime there was a new brand
Creating another table in my database that stores this information, but I can't think of a mangento-y way to make it editable in the admin section

Any ideas?


texts: Remove a dropdown attribute value from a product

texts:
I have a custom product attribute that gets populated from a csv import. If the relevant field has a value, that value is applied to the product's attribute. However if that field is empty, the value should be removed. This is what I currently have, but it's not removing the value:

if (trim($prod[$fields['SOPDiscountCode']]) != ''){
    $newproduct->setProductDiscountCode($discounts[$prod[$fields['SOPDiscountCode']]]);
}else{
    $newproduct->setProductDiscountCode(0);
}

I'm not sure of the correct way to remove the value:

$newproduct->setProductDiscountCode('');

or

$newproduct->setProductDiscountCode();

for example?


texts: What is the difference between taxvat and vat_id

texts: \Magento\Customer\Api\Data\CustomerInterface has method getTaxvat() and \Magento\Customer\Api\Data\AddressInterface has method getVatId(). Do they store the same data? What is the difference?


texts: Can't change Customer's Customer Tax Class

texts:
I have this weird problem where I can't change a customer's Customer Tax Class through the admin interface. It keeps jumping back to Retail customer.

So when I select a different Customer Tax Class and press save, it just stays at Retail customer.

Even when I update the customer's Customer Tax Class through the database with an SQL query (shown below), it works and does change the Customer Tax Class of the customer, but when I go back to the interface, and press the "Save Customer" button (in case I would like to edit some other information) it will jump back to the wrong Customer Tax Class, "Retail Customer".

UPDATE `customer_entity` SET tax_class_id = MY_TAX_CLASS_ID
WHERE entity_id = CUSTOMER_ENTITY_ID

I checked the Customer Group settings, and for that Customer Group, I set the default Customer Tax Class to the one I actually want, but even then it keeps jumping back to Retail Customer.

I haven't set up this installation so a previous manager might have set up a limitation somewhere? I don't know.

Thanks in advance, this stackexchange board has been of great help trying to unravel the enigmatic spaghetti which is Magento.


texts:
How can I override vendor/magento/module-theme/view/adminhtml/ui_component/design_config_form.xml in Magento 2.1.2?

Basically, I want to fix favicon issue, as described here in my custom module.


texts: Magento 1.9 API - How to do oauth admin authorization login page in android appilcation?

texts: Need to know the possible way to do oauth admin authorization in android. In web I can be able to do it by showing the login page in browser. once success authorization I can get access token in PHP code. I want to do the possible way to do this android.


texts: Get single dimensional php array from model getData

texts: From my model collection I got the list of data, which is in format - array(0 => "first", "1" => "second", ...). Is it possible to get the data in a normal single dimensional php array like array("first", "second", ...).


texts: Search, cart and category not working on product page

texts:
I have a problem with this shop: www.phone-parts.dk

The search function, cart and category works fine, when a customer is watching the products from a category, but when he/she clicks and enters the product page, they stop working. They are there, but nothing happens when you click it.
The cart won't drop down and the search bar wont show. Specially on mobile devices. On mobile devices the category drop-down menu, wont work either.

Any of you guys have an idea of the problem?


texts:
my root.phtml looks like this:

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

// @codingStandardsIgnoreFile

?>
<!doctype html>
<html <?= /* @escapeNotVerified */ $htmlAttributes ?>>
    <head <?= /* @escapeNotVerified */ $headAttributes ?>>
        <?= /* @escapeNotVerified */ $requireJs ?>
        <?= /* @escapeNotVerified */ $headContent ?>
        <?= /* @escapeNotVerified */ $headAdditional ?>
    </head>
    <body data-container="body" data-mage-init='{"loaderAjax": {}, "loader": { "icon": "<?= /* @escapeNotVerified */ $loaderIcon ?>"}}' <?= /* @escapeNotVerified */ $bodyAttributes ?>>
        <?= /* @escapeNotVerified */ $layoutContent ?>
    </body>
</html>

How can I output the base URL?

I have tried:

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

But it doesn't work.


texts: setup:di:compile error because of duplicated class of data-migration-tool

texts:
I'm running into following fatal error when trying to execute the setup:di:compile command:

  Fatal error:  Cannot declare class Migration\Step\Version11410to2000Test, because the name is already in use in /var/www/html/magento/vendor/magento/data-migration-tool/tests/unit/testsuite/Migration/Step/UrlRewrite/Version11410to2000Test.php on line 109

I tried to re-compile because I was getting an 404 on backend (triggered by magento, not apache websever).

Any help appreciated.

Edit:
It is a fresh Magento 2 install, except for adding the official (and correct) data-migration-tool.


texts: Magento 2 - Very slow performance, Cache/static files issues after disabling cache and flushing static files cache

texts:
Today is my first day using Magento 2 (I know Magento 1).

I'm running Magento 2.1.3 locally on MAMP, PHP v 7.0.13.

I had installed Magento 2, I was trying out creating a new theme, and the site was running OK.

I was trying to switch the parent theme and not seeing expected results, so I (naively):

1) disabled the Cache
2) flushed Static Files cache.

I did this in the Cache Management admin area. I didn't realize all hell was going to break loose when I did this...

Since then, I can barely load pages. I could see files were being generated to pub/static. This has been happening for about an hour and a half.

When I did this, Magento was in default mode. I've now switched to developer mode (about 20 minutes ago) as per "Set the Magento mode":http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-mode.html

rm -rf <your Magento install dir>/var/di/* <your Magento install dir>/var/generation/*
magento deploy:mode:set developer

...but I'm still waiting for minutes (like 10 minutes or more) for pages to load, it's just absolutely crawling. It seems like the page renders but it doesn't finish loading and there are JS issues (I can't use the admin menu, etc.) I also can't see icons like the cart icon, menu icons...

I thought the site was not dependendent on pub/static when in developer mode? Static files still seem to be being generated in pub/static (on the fly??)

I'm on a Macbook Air with 8GB memory, 1.7 GHz Intel Core i7, and the fans going crazy, CPU is maxed out. Running Magento 1 was possible, although sometimes slow, but never this slow!

I have also tried to enable/disable Caches and enabling caches makes things faster. But surely (like Magento 1) while developing, it makes sense to keep caches disabled?

Any suggestions? Do I just need to wait and have more patience?

Thank you.


texts: Add custom active links to customer account navigation in Magento 2

texts:
I am trying to add a custom link in customer account navigation. My custom link is showing in account navigation and working too, but it's not showing as active/current on click.

Below is the code I have:

  /app/code/Namespace/Support/view/frontend/layout/customer_account.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customer_account_navigation">
            <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-suppport-ticket-link" after="-">
                <arguments>
                    <argument name="path" xsi:type="string">support/customer/index</argument>
                    <argument name="label" xsi:type="string">Support Ticket</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

  /app/code/Namespace/Support/Controller/Customer/Index.php

<?php
namespace Namespace\Support\Controller\Customer;

use Magento\Framework\App\Action;
use Magento\Framework\Exception\NotFoundException;
use Magento\Framework\Controller\ResultFactory;

class Index extends \Namespace\Support\Controller\Index
{
    /**
     * Show customer tickets
     *
     * @return \Magento\Framework\View\Result\Page
     * @throws NotFoundException
     */
    public function execute()
    {
        /** @var \Magento\Framework\View\Result\Page resultPage */
        $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
        return $resultPage;
    }
}

  /app/code/Namespace/Support/view/frontend/layout/support_customer_index.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">
    <update handle="customer_account"/>
    <head>
        <title>Support Ticket</title>
        <css src="Namespace_Support::css/styles.css"/>
    </head>
    <body>
        <referenceContainer name="content">
            <block class="Namespace\Support\Block\TicketList" name="ticketViewList" template="Namespace_Support::list.phtml" />
        </referenceContainer>
    </body>
</page>


texts: Magento 2 echo newsletter subscriber's email in frontend after subscription

texts:
How can we display a newsletter subscriber's email address in the frontend after they subscribe for a newsletter.

Currently, Magento 2 displays a message "Thank you for your subscription".

We need this changed to "Thank you for your subscription. A confirmation email will be sent to youremail@example.com within 10 minutes"


texts:
in Finland we have reference number this: 1234 -> 12344, 12345 -> 123453,...
Where last number is counted from first ones and bank system tests that number is correct. This is how we calculate number:

function viitenumero($orderid) {
$orderid = strval($orderid);
$paino = array(7, 3, 1);
$summa = 0;
for($i=strlen($orderid)-1, $j=0; $i>=0; $i--,$j++){
    $summa += (int) $orderid[$i] * (int) $paino[$j%3];
    }
    $tarkiste = (10-($summa%10))%10;
    return $orderid.$tarkiste;

How can I change all Magento Invoice numbers counted like this? And what is the file that I should change?


texts: how to convert guest to customer and send email to reset password in magento 2

texts:
How to convert guest to customer using order id and how to send them password reset email in magento 2.

Please provide me a solution to send convert guest to customer


texts:
I am trying to override template of Magento_Review module

I added new layout file under my module

  app/code/Custom/CustomReview/view/frontend/layout/review_product_list.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">
    <update handle="catalog_product_view"/>

        <referenceBlock name="product.info.product_additional_data">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Custum_CustomReview::product/view/list.phtml</argument>
            </action>
        </referenceBlock>

</page>

and template file

  app/code/Custom/CustomReview/view/frontend/templates/product/view/list.phtml

Overriding

and ny module.xml file look like below

    <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Custom_CustomReview" setup_version="1.0.1">
        <sequence>
            <module name="Magento_Review"/>
        </sequence>
    </module>
</config>

But my template is not getting override. I cleared cache but no luck. Can anyone help what I am doing wrong here.

Thanks


texts:
I need to change the settings for the image upload dialog in TinyMCE to remove the  Advanced Tab.

I've already changed settings of the tool bar icons successfully by creating:

<type name="\Magento\Cms\Model\Wysiwyg\Config">
    <plugin name="add_wysiwyg_data" type="\Hidden\System\Plugin\WysiwygConfig" sortOrder="10" />
</type>

and

namespace Hidden\System\Plugin;

class WysiwygConfig
{
    public function afterGetConfig($subject, \Magento\Framework\DataObject $config)
    {
        $styleArray = [
            'Hero - Image' => 'hero__image',
            'Hero - Heading' => 'hero__heading',
            'Hero - Action Button' => 'hero__primary-action'
        ];

        $styles = array_map(function ($title, $class) {
            return "{$title}={$class}; ";
        }, array_keys($styleArray), array_values($styleArray));

        $config->addData(
            ["settings" =>
                ["theme_advanced_styles" => implode("; ", $styles),
                    "theme_advanced_buttons1" => "magentovairable,magentowidget,styleselect,formatselect,bold,italic,underline,|,bullist,numlist,link,unlink,anchor,image",
                    "theme_advanced_buttons2" => "undo,redo,cut,copy,paste,pastetext,|,search,replace,|,outdent,indent,blockquote,|,removeformat,sub,sup,|,charmap,iespell,|,fullscreen",
                    "theme_advanced_buttons3" => "",
                    "theme_advanced_buttons4" => ""]]);

        $config->addData(["image_dimensions" => false]);
        $config->addData(["image_advtab" => false]);

        return $config;
    }

As you can see I have tried to add the config data to disable image_dimensions and image_advtab but to no effect, I have also tried having this as elements of the previous $config->addData (under settings).

I got these settings from this documentation, but the docs for the version of TinyMCE in Magento 2 aren't that great.

I think I must be barking completely up the wrong tree, how can I disable this tab?


texts: How to show shopping cart/stock only when you are logged in?

texts: Is there a way to show the shopping cart and the amount in stock when you login to store?


texts:
I'm doing "search by fulltext" in "Banner Slider" module, and every thing works perfect, but when i click on "x" button to reset the search, it return exactly the same slide as the last slide which in the result. For example, i have 2 slide, "banner_1" and "banner_2" and after i search for "banner_1" (ofcause it work), and then i click on "x" button, and it return 2 "banner_1" (watch the image below):

EDIT 1:

Here is my xml file.

  C:\xampp\htdocs\magento\app\code\Aht\BannerSlider\view\adminhtml\ui_component\banner_listing.xml

<dataSource name="banner_listing_data_source" component="Magento_Ui/js/grid/provider">
    <settings>
        <updateUrl path="mui/index/render"/>
    </settings>
    <aclResource>Aht_BannerSlider::banners</aclResource>
    <dataProvider class="Aht\BannerSlider\Ui\Component\DataProvider" name="banner_listing_data_source">
        <settings>
            <requestFieldName>id</requestFieldName>
            <primaryFieldName>id</primaryFieldName>
        </settings>
    </dataProvider>
</dataSource>


texts: Store view and admin view show different tax for a product

texts:
We have one product with 10% vat in our store. In the admin view the tax is calculated and displayed correctly. But the store view shows the product with 24% vat.

Would anyone have any ideas on what might cause the problem?


texts:
I tried using Magento 2 and enabled the microcache for dynamic content for 30 minutes expiration date.

The problem is that the products from carts 'magically' get cloned in another user's cart. I was thinking that the cause was the form_key input in html that remains the same(due to FPC- microcache).

Did anyone manage to get Magento 2 to work with nginx dynamic micro-cache system?

Thanks!


texts: Thanks for submitting message not show in Magento contact form

texts:
I have included contact us form in cms block using below code

{{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}}

After submit contact form after thanks message not displayed.


texts:
I have run below code

use Magento\Framework\App\Bootstrap;
use Magento\Catalog\Block\Product\Image;
include("app/bootstrap.php");
    //$product_id = 4814;
    $bootstrap = Bootstrap::create(BP, $_SERVER);
    $objectManager = $bootstrap->getObjectManager();
    $state = $objectManager->get('Magento\Framework\App\State');
    $state->setAreaCode('frontend');
    $simple_product = $objectManager->create('\Magento\Catalog\Model\Product');

    $storeId = '1'; //Store ID
    $product_id = 4814;
    $productFactory = $objectManager->get('\Magento\Catalog\Model\ProductFactory');
    $product = $productFactory->create()->setStoreId($storeId)->load($product_id);

    echo $imagePath = '/var/import/bulb.jpg'; // path of the image
    //exit();
    $product->addImageToMediaGallery($imagePath, array('image', 'small_image', 'thumbnail'), false, false);

    $product->save();

And getting following error

  Fatal error: Uncaught Magento\Framework\Exception\LocalizedException:
  The image doesn't exist. in
  C:\xampp\htdocs\magento23\vendor\magento\module-catalog\Model\Product\Gallery\Processor.php:145
  Stack trace: #0
  C:\xampp\htdocs\magento23\vendor\magento\module-catalog\Model\Product.php(1577):
  Magento\Catalog\Model\Product\Gallery\Processor->addImage(Object(Magento\Catalog\Model\Product\Interceptor),
  '/var/import/bul...', Array, false, false) #1
  C:\xampp\htdocs\magento23\generated\code\Magento\Catalog\Model\Product\Interceptor.php(895):
  Magento\Catalog\Model\Product->addImageToMediaGallery('/var/import/bul...',
  Array, false, false) #2 C:\xampp\htdocs\magento23\image.php(22):
  Magento\Catalog\Model\Product\Interceptor->addImageToMediaGallery('/var/import/bul...',
  Array, false, false) #3 {main} thrown in
  C:\xampp\htdocs\magento23\vendor\magento\module-catalog\Model\Product\Gallery\Processor.php
  on line 145


texts: Magento ver. 2.3.5-p1 Setup PWA store step by step Guide or documentation

texts:
I am new to PWA Studio.
Can anyone guide or suggest any website or blog tutorial for step by step installation of PWA storefront? Does Magento PWA require to lean React and GraphQL?
Which one is better Magento PWA or Vue storefront? Also, suggest to me if any other opensource options are available as well!
Thanks in advance.


texts: header_slider is empty, where can I fill it?

texts:
I am fairly new to Magento.

I am trying to get a slider and I think I found the default in de thema I'm using. It looks like this in de header.phtml

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

When I var_dump this it's empty. Where can I fill this?

The theme I'm using is this: http://www.templatemonster.com/demo/51048.html and the header I want is this:


texts: enterprise_url_rewrite table - what does column "inc" save?

texts:
I'm wondering what does "inc" means? In my particular case all rewrites do have set inc=1.

mysql> describe enterprise_url_rewrite;
+----------------+----------------------+------+-----+---------+----------------+
| Field          | Type                 | Null | Key | Default | Extra          |
+----------------+----------------------+------+-----+---------+----------------+
| url_rewrite_id | int(10) unsigned     | NO   | PRI | NULL    | auto_increment |
| request_path   | varchar(255)         | NO   | MUL | NULL    |                |
| target_path    | varchar(255)         | NO   |     | NULL    |                |
| is_system      | smallint(5) unsigned | NO   |     | NULL    |                |
| guid           | varchar(32)          | NO   |     | NULL    |                |
| identifier     | varchar(255)         | NO   | MUL | NULL    |                |
| inc            | int(10) unsigned     | NO   |     | 1       |                |
| value_id       | int(10) unsigned     | NO   | MUL | NULL    |                |
| store_id       | smallint(5) unsigned | NO   |     | NULL    |                |
| entity_type    | smallint(5) unsigned | NO   |     | NULL    |                |
+----------------+----------------------+------+-----+---------+----------------+
10 rows in set (0.00 sec)

Thanks!


texts: Magento 2 on shared hosting, Vendor autoload is not found. Please run 'composer install'

texts:
I am trying to install magento2 on shared hosting environment this is what i did.

Downloaded magento .zip archive and uploaded it to server in public_html/magento2 directory.

Tried running it in browser it gives me this error "Vendor autoload is not found. Please run 'composer install' under application root directory."

Same archive is working fine in my local server, i have successfully installed it on local server with sample data.

Please guide me what i am doing wrong.

EDIT

I have SSH access of my shared hosting, as i am on windows so i have connected that via putty and when i run composer install there it gives me this error "-bash: composer: command not found"


texts: Magento 2 - Order status update observer

texts:
I am looking for order status update observer

In many post I have found this one:

sales_order_save_after

But, it is not working, I have checked it myself. It is not even listed in these articles:
https://www.simicart.com/blog/magento-2-events-list/
https://www.mageplaza.com/magento-2-module-development/magento-2-events.html

Please help, which observer should I use? I need to do something when order status updated.

Thanks


texts: After setting up a subsite, how to change template to same as default but showing diff catalog?

texts:
I have several subsites that I've set up on a site I've inherited where there needs to be several sites with differing domains.

I found this tutorial and these two screencasts (Part 1 & Part 2) very helpful, however I am not finding a way to apply the same template design of the main default site to these subsites.  The goal is to use the same design for all of the sites with primarily simply a different root category for the subsites.

To give this context I have something like MainStore.tld and then MensShoes.tld, OutdoorSupplies.tld, etc. and I simply want make MensShoes.tld to look like MainStore.tld, but to have a different catalog base so as to have different products and perhaps some different elements such as slide images, images, etc.

How is this scenario usually configured in Magento?


texts: Magento 2 How to unserialize data from column to display in custom Grid?

texts:
I am looking for a way to unserialize data (coming from db table) and display it in admin grid (column in ui component)

I have custom module in admin which fetch record from table and one of the column have serialized data

a:2:{s:12:"increment_id";s:5:"60231";s:4:"rate";a:4:{s:6:"points";s:1:"1";s:15:"currency_amount";s:6:"1.0000";s:9:"direction";s:1:"1";s:13:"currency_code";s:3:"NZD";}}

I want to display increment_id from this field in my view/adminhtml/ui_component/modulename_model_listing.xml

Any help please.


texts:
Last night, there was an update in Magento CE v2.0 and also a release of patch MDVA-84. Any possible problems that may encounter by anyone of us? Magento also fixed issues which mostly includes the upgrade problems between previous versions of magento 2.

They are also not supporting the downloads of Magento CE v2.0.0 and Magento CE v2.0.1 and asking to download Magento CE v2.0.2 directly which means that it might be good to go completely with magento 2 now?

Possible suggestions, problems, bugs reported here below may help us all. See the link below for more information:

Release Notes Magento CE 2.0.2

Technical Bullets


texts: Magento 2: How to set Custom Session Lifetime?

texts:
I have created a custom session in Magento. I'm using it for custom user management. when login successfully it set the user data in the session.
I have to set 1 day lifetime for that session but not understanding how to do it with Magento 2. Can someone please help with this?
$this->userSession->setUserData($userData);


texts:
I want to filter some orders based on the date range so in SQL i use this query
SELECT  * FROM  `sales_order` WHERE
    date(created_at) >= '2020-12-02'
    AND (date( created_at) <= '2020-12-16')

in magento i use
$orders->addFieldToFilter('date(created_at)', ['qteq' => $startDate->format('Y-m-d')]);
$orders->addFieldToFilter('date(created_at)', ['lteq' => $endDate->format('Y-m-d')]);

but it does not work and the result is like this instead
SELECT * from sales_order where (`DATE(created_at)` >= '2020-12-01') AND (`DATE(created_at)` <= '2020-12-16)


texts:
namespace send\sms\Cron;

use Magento\Framework\ObjectManagerInterface;

class Run  /*extends send\sms\Controller\Customr*/  {

   public function execute()
   {

    $om = \Magento\Framework\App\ObjectManager::getInstance();
     $customerSession = $om->get('Magento\Customer\Model\Session');
     if($customerSession->isLoggedIn()) {

         $idd =$customerSession->getCustomer()->getId();

     }
       $this->_resources = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Framework\App\ResourceConnection');
    $connection= $this->_resources->getConnection();
    //$sql = "UPDATE `total_cashback` SET is_active= 100 WHERE user_id = '801' ";
     $sql = "UPDATE `wallet_discounts` SET is_active = 12000 WHERE customer_id = $idd ";
    $connection->query($sql);
   }

}

Cannot get customer Id in the above snippet.


texts:
I am having real trouble getting past this stage. I have looked at posts on this topic from different websites and none of the solutions work. I have created secret keys via magentocommerce website and using the keys to login to repo.magento.com.

Everytime I get the same error:

[Composer\Downloader\TransportException]
  Invalid credentials for 'https://repo.magento.com/packages.json', aborting.

I have tried the manual approach when the username and password keys are not stored in auth.json file in .composer. After I enter the username I see the following error:

Password: bash: stty: command not found

I then tried to add the username and password to auth.json using the following format suggested here getcomposer.org/doc/articles/http-basic-authentication.md

I then ran this to test:

/usr/local/php56/bin/php-cli composer.phar update --dry-run

Which results with:

Loading composer repositories with package information

[Composer\Downloader\TransportException]
  Invalid credentials for 'https://repo.magento.com/packages.json', aborting.

I have also created and new magento account and created new set of keys which has not helped.

Is anyone able to help?

Kind regards,

Hemal


texts: How to retrieve product photos and product info from (a non-working) Magento 1.3.1?

texts:
Magento 1.3.1

I had a store installed/running on Magento 1.3.1 on an old server. Then we setup another store (running Magento 1.9.1) on a new server. The newer server had higher versions of pHp and mySQL as it was needed for Magento 1.9.1 but these were too high versions for Magento 1.3.1 so when I had to discontinue the old server and I migrated this store running Magento 1.3.1 to the new server - it no longer works because the pHp and mySQL versions are incompatible with Magento 1.3.1 (too high). I installed the pHp selector blahblah but it only has a limited range of pHp versions so long story short - I'm looking for the easiest way to set this old store up again and I think that will be installing brand new version of Magento 1.9.3.6 on the new server (I have done that already) and then setup the Porto theme again.

The big question is - what is the easiest way to retrieve the product information (and product photos) from the old (Magento 1.3.1) store? I have all the files the same as they were migrated from the old server to the new and I can access them via FTP only (trying to load the front or back-end gives an Error).

As per a request from Shyam Krishna Sreekumar - here is the Error...I know for sure that this really is related to the pHp and mySQL versions - I've been through this for many many hours when I tried to run my other Magento 1.3.1 site on the server where the pHp and mySQL versions were higher. The older Magento stores require lesser versions of pHp to run!

Here is the Error:

SQLSTATE[HY000]: General error: 145 Table './mysite_shop/log_visitor' is marked as crashed and should be repaired
Trace:
#0 /home/mysite/public_html/lib/Zend/Db/Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(457): Zend_Db_Statement->execute(Array)
#2 /home/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(230): Zend_Db_Adapter_Abstract->query('INSERT INTO `lo...', Array)
#3 /home/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(259): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `lo...', Array)
#4 /home/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(535): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `lo...', Array)
#5 /home/mysite/public_html/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(349): Zend_Db_Adapter_Abstract->insert('log_visitor', Array)
#6 /home/mysite/public_html/app/code/core/Mage/Core/Model/Abstract.php(251): Mage_Core_Model_Mysql4_Abstract->save(Object(Mage_Log_Model_Visitor))
#7 /home/mysite/public_html/app/code/core/Mage/Log/Model/Visitor.php(157): Mage_Core_Model_Abstract->save()
#8 /home/mysite/public_html/app/code/core/Mage/Core/Model/App.php(1167): Mage_Log_Model_Visitor->initByRequest(Object(Varien_Event_Observer))
#9 /home/mysite/public_html/app/Mage.php(301): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#10 /home/mysite/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(410): Mage::dispatchEvent('controller_acti...', Array)
#11 /home/mysite/public_html/app/code/core/Mage/Core/Controller/Front/Action.php(45): Mage_Core_Controller_Varien_Action->preDispatch()
#12 /home/mysite/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(356): Mage_Core_Controller_Front_Action->preDispatch()
#13 /home/mysite/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(247): Mage_Core_Controller_Varien_Action->dispatch('index')
#14 /home/mysite/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(158): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 /home/mysite/public_html/app/Mage.php(457): Mage_Core_Controller_Varien_Front->dispatch()
#16 /home/mysite/public_html/index.php(69): Mage::run('mysiteisbestpro...', 'website')
#17 {main}


texts:
After re-indexing the Magento 1.9.1

It freezes for some time  and
Gives 505 error as shown in below snapshot.

I contacted server administrator they say its Magento problem server is working perfectly.

There is no error in server log neither in Magento log file

Any suggestion how to resolve this ?

Thank You.


texts:
I have a working module that puts plus minus buttons next to the quantity. But when a user wants to change the amounts from the cart the plus minus buttons are not there.

I know i have to edit the file;

module-checkout/view/frontend/templates/cart/item/configure/updatecart.phtml

but how i tell the module that it has to override the file in core somewere in a XML?

My XML so far:

catalog-product-view.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>
        <referenceBlock name="product.info.addtocart">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Jilco_plusminknoppen::catalog/product/view/addtocart.phtml</argument>
            </action>
        </referenceBlock>
        <referenceBlock name="product.info.addtocart.additional">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Jilco_plusminknoppen::catalog/product/view/addtocart.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>


texts: How to add a custom tab in product detail page?

texts:
I want to add three more tabs below the already present details tab in product detail page as shown in the picture below.

Can anybody please help me with this?

Please see this screenshot for the location of the tab where i want it to be.


texts:
I need to get the products from a specific category and display in a specific template style.
I know you can do this on a cms page:

{{block type="catalog/product_list" name="product_list" category_id="209" column_count="4"  mode="grid" limit="25"  template="catalog/product/list.phtml"}}

But how can I do this in a php file?


texts: Display Time of Delivery in related.phtml

texts:
First to the Environment i'm working with:

Magento Communitiy Edition 1.9.1

What do i want to do?

I wanted to add the delivery time of every related product at the related.phtml to display the delivery time unter each related product.

I studied the file an quickly got the point to hook in:

<a href="<?php echo $_item->getProductUrl()?>"><?php echo $this->escapeHtml($_item->getName())?>/a>

    <?php Mage::register('no_shippingcharges', true); echo this->getPriceHtml($_item, true, '-related') ?>
    <?php if ($this->helper('wishlist')->isAllow()) : ?>
        <a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?>
    <?php endif; ?>

I've got the single related products wich are looped through with a for loop.
Every $_item-Object seems to be a product and if i load attributes like the id or the name i always get values. But if i want to load the delivery time, with the following one-liner:

<?php echo ($_item->getTimeOfDelivery); ?>

i don't get any values back.
Even working with the attributetext-method doesn't work:

$_item->getAttributeText("time_of_delivery");

I've also tried to load the product seperatly with

$_product->Mage::getModel("catalog/product")->load($_item->getId());

But it also doesn't get me some values.
Is there any other method of getting the "delivery time"-attribute displayed?
I hope someone can give me some advice.


texts:
I have a custom phtml inside I called attribute.phtml but it's not working:

echo $block->getTemplateFile('Magento_Catalog::product/view/attribute.phtml');
echo $this->getLayout()
        ->createBlock("Magento\Framework\View\Element\Template")
        ->setTemplate("Magento_Catalog::product/view/attribute.phtml")
        ->toHtml();

Both showing error only.


texts: linking customer/account url in a static block

texts:
In our theme we have a static block for the links we have in our footer.
We have three blocks with  Account, info and social media.

At the moment everything is hard coded with relative link paths to store pages & absolute link paths to the social media pages.

I'm wondering what is the best way to link to store pages, and know you can use cms directives

For instance there are these links for customer account pages.

My Account
My Address
My Wishlist

Why would you use this method rather than a relative path? i.e.

My Account

Is there another way to link to the customer/account page?  without using the customer/account keywords?

Also why would you use something like this for a CMS page?

Contact Us

is there a better way to link to a cms page from within a static block or another cms page?


texts:
I am on Magento 2.2.5 (issue persisted on 2.2.4 as well). I am not able to create any new customer. Whenever I try to fill in the details in NEW CUSTOMER ACCOUNT form, "customer/account/create/", the page reloads itself on clicking CREATE ACCOUNT button. I am not overriding register.phtml in my theme. Any idea on what's going on?

I had this issue on 2.2.4 but someone suggested this issue is resolved in 2.2.5 and I upgraded but the issue still persists. Please help.

PS: There are no errors in any logs.

Thanks, Sanjay


texts: Is it safe to truncate the catalog_category_product table?

texts:
I was trying to reindex Category Products and I kept getting "There was a problem with reindexing process" error message. When I into SSH and tried 'php indexer.php --reindex catalog_category_product', I got:

Category Products index process unknown error:

  exception 'PDOException' with message 'SQLSTATE[23000]: Integrity
  constraint violation: 1452 Cannot add or update a child row: a foreign
  key constraint fails
  (account_mage142.mg_catalog_category_product_index, CONSTRAINT
  FK_MG_CAT_CTGR_PRD_IDX_CTGR_ID_MG_CAT_CTGR_ENTT_ENTT_ID FOREIGN KEY
  (category_id) REFERENCES mg_catalog_category_entity)' in
  /home/account/public_html/magento/lib/Zend/Db/Statement/Pdo.php:228

and

  Next exception 'Zend_Db_Statement_Exception' with message
  'SQLSTATE[23000]:

  Integrity constraint violation: 1452 Cannot add or update a child row:
  a foreign key constraint fails
  (account_mage142.mg_catalog_category_product_index, CONSTRAINT
  FK_MG_CAT_CTGR_PRD_IDX_CTGR_ID_MG_CAT_CTGR_ENTT_ENTT_ID FOREIGN KEY
  (category_id) REFERENCES mg_catalog_category_entity), query was:
  INSERT INTO mg_catalog_category_product_index (category_id,
  product_id, position, is_parent, store_id, visibility)
  SELECT mg_catalog_category_product_index_idx.category_id,
  mg_catalog_category_product_index_idx.product_id,
  mg_catalog_category_product_index_idx.position,
  mg_catalog_category_product_index_idx.is_parent,
  mg_catalog_category_product_index_idx.store_id,
  mg_catalog_category_product_index_idx.visibility FROM
  mg_catalog_category_product_index_idx ON DUPLICATE KEY UPDATE
  category_id = VALUES(category_id), product_id =
  VALUES(product_id), position = VALUES(position), is_parent =
  VALUES(is_parent), store_id = VALUES(store_id), visibility =
  VALUES(visibility)' in
  /home/account/public_html/magento/lib/Zend/Db/Statement/Pdo.php:235

I was advised to truncate the mg_catalog_category_product table but I was wondering if it is safe to do so.. will  removing the data in this table have any adverse effects to the data in the Magento store?


texts: how to create file of type less with php in magento2?

texts:
I want to use LESS in Magento 2 with PHP code.

Example: If I want to create CSS with PHP in Magento 2, I can create a file custom.phtml and then in XML I would use referenceContainer.

custom.phtml

<style>
      body{
        color: <?php echo $block->getColor('body') ?>
      }
</style>

How can I create a file _theme.less with PHP code like this?


texts: Couple questions about uninstalling Magento Extension

texts:
I found this uninstall tutorial https://www.youtube.com/watch?v=T63JZNT9MM8

Is that the only thing I would need to do? Would it be completely deleted?

And if I want to use the extension in the future, would I need to Install again? Or I can use the "reinstall" option. If so, that means the extension would not be completely gone right?


texts: Changed value in inline edit field can not be saved in MFTF test

texts:
In a custom admin grid I try to change a value in an inline edit field and save it afterwords using a MFTF test.
I use AdminCustomerGridInlineEditorSection as template and select the inline edit field with a similar selector like customerGenderEditor, only change the type to input.
This works so far, and I can also change the value in the grid.
Strangely I get an error message, that this field would be required and I should fill it, although I can see the new text.
When I then click on save the error message disappears, but the value is not saved.
Does anyone have similar issues and an idea how to solve that?


texts: I have override the magento layer.php file but not work

texts:
I have override magento layer.php file and need to change some method. just like below.

public function getProductCollection()
    {
        if($this->getCurrentCategory()->getId()==290){
        $startprice=0;
            $endprice=499;
             $collection = Mage::getModel('catalog/product')->getCollection()
                        ->addAttributeToSelect('*')
                        ->addAttributeToFilter('price', array('gteq' => $startprice))
                        ->addAttributeToFilter('price', array('lteq' => $endprice))
                        ->getData();

        }else{
            if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
            $collection = $this->_productCollections[$this->getCurrentCategory()->getId()];
        } else {
            $collection = $this->getCurrentCategory()->getProductCollection();
            $this->prepareProductCollection($collection);
            $this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
        }

        }

        return $collection;
    }

After this changes got the following error. how to solve this.

Fatal error: Call to a member function getSetIds() on a non-object in /var/www/html/app/code/core/Mage/Catalog/Model/Layer.php on line 306

Thanks.


texts: Add attribute filter 'manufacturer' to 'reports/product_collection'

texts:
I want to filter reports/product_collection by attribute manufacturer.

I try with this:

    $_productCollection = Mage::getResourceModel('reports/product_collection')
    ->addAttributeToSelect('*')
    ->joinAttribute('manufacturer','catalog_product/manufacturer','entity_id',null,'left')
    ->addAttributeToFilter($attr, array('eq' => $attr_id))
    ->setStoreId($storeId)
    ->addStoreFilter($storeId)
    ->addViewsCount($from, $to)
    ->setPageSize($productCount);
Mage::getSingleton('catalog/product_status')
    ->addVisibleFilterToCollection($_productCollection);
Mage::getSingleton('catalog/product_visibility')
    ->addVisibleInCatalogFilterToCollection($_productCollection);

But the lines:

    ->joinAttribute('manufacturer','catalog_product/manufacturer','entity_id',null,'left')
->addAttributeToFilter($attr, array('eq' => $attr_id))

Do not have any effect. What am I doing wrong?

EDIT: Here's the SOLUTION, including a filter to grouped products. Thanks to Amit! For pointing me there!

$_reportIds = Mage::getResourceModel('reports/product_collection')
    ->setStoreId($storeId)
    ->addStoreFilter($storeId)
    ->addViewsCount($from, $to)
    ->getColumnValues('entity_id');

$_productCollection = Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addFieldToFilter('entity_id', array('in' => array($_reportIds)))
    ->addAttributeToFilter('type_id', array('eq' => 'grouped'))
    ->addAttributeToFilter('manufacturer', array('eq' => $attr_id));

Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($_productCollection);
Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($_productCollection);


texts: Magento 2 Trying to implement paypal payflowpro using CC within a custom SOAP api plugin

texts:
So I have created a custom module that extends Magento 2's API functionalities. Everything works fine except the payment part.

This API extension allows among other things to create orders and it works fine using a "closed-loop" payment method such as checkmo

However we want the transaction to be done using Paypalpayflow pro using CC information.

So far, this is what I have :

    $cart->getPayment()->setMethod('payflowpro');
    $cart->getPayment()->setCcOwner('MDesjardins');
    $cart->getPayment()->setCcNumber('4111111111111111');
    $cart->getPayment()->setAcct('4111111111111111');
    $cart->getPayment()->setCcType('VI');
    $cart->getPayment()->setCcExpMonth('12');
    $cart->getPayment()->setCcExpYear('18');
    $cart->getPayment()->setCcLast4('1111');
    $cart->getPayment()->setCcCid('123');

This communicated with Paypal but we receive an error 23 (Invalid account number) and looking at the Paypal manager, I see that Paypal is not receiving the credit informations (the ccnumber, acct, cctype, ccexpmonth, ccexpyear,cclast4, cccid)

I have tried many different ways and cannot for the life of me figure it out.


texts: Shop specific Header (Logo) in Magento 1.9.0.1

texts:
In my Magento Shop there are two Shops, each Shop should display its own Header image.

How can I realize this ? In Magento Backend, there is only the opportunity to enter a path to a single image.

I tried to do it with static blocks. But where to implement the logic?


texts: override Magento getQty with custom module

texts:
I would like to override the inventory set in Magento with my own custom inventory coming from our ERP. I had to do something similar with getPrice, but I can't seem to find the getQty function in Mage.

Any help locating it and setting a base amount would be most helpful!


texts: Search using REST endpoints on two different columns with OR condition in Magento 2

texts:
I'm using Magento v2.3 and using API to search products.

Following is the search criteria code.

'searchCriteria[filterGroups][0][filters][0][field]': 'name',
'searchCriteria[filterGroups][0][filters][0][value]': '%test%',
'searchCriteria[filterGroups][0][filters][0][conditionType]': 'like',
'searchCriteria[filterGroups][0][filters][1][field]': 'meta_keyword',
'searchCriteria[filterGroups][0][filters][1][value]': '%test%',
'searchCriteria[filterGroups][0][filters][1][conditionType]': 'like',
'searchCriteria[filterGroups][2][filters][0][field]': 'status',
'searchCriteria[filterGroups][2][filters][0][value]': '1',
'searchCriteria[filterGroups][2][filters][0][conditionType]': 'eq',

I want something like this (OR condition between two different columns).

  WHERE name like '%test%' OR meta_keyword like '%test%'

But above code doesn't give me desired results.

I have gone through documentation of Magento here https://devdocs.magento.com/guides/v2.3/rest/performing-searches.html

but the examples shown in above link are "OR conditions on same column".

Thanks in advance!


texts: How can I disable customer emails when order create using rest api in Magento 2

texts:
Is there an API call or cart/quote setting I can use to turn off customer notifications just for the order confirmation?
I create order using this api
Method:PUT
url:
http://localhost/testproject/rest/V1/carts/{cart_id or quote_id}/order


texts:
When I send a transactional email from Magento 1.9.2.4, some people first see a wrong type of header.
They first see the following and after that the right email.

How can I solve this and/or edit this Notice of License?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org=
/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html style=3D"background-color: #fff;">
<head>
<style type=3D"text/css">
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magento.com for more information.
*
* @category design
* @package base_default
* @copyright Copyright (c) 2006-2014 X.commerce, Inc. (http://www.magent=
o.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free L=
icense (AFL 3.0)
*/


texts: Export Salable Qty / Default Stock in Magento 2.3.2

texts:
I use Magento 2.3.2 as a cart to presell our clothing collection.
This means that customers log in and make an order and in past versions of Magento we would simply have a negative QTY and the negative number would be how many we presold.
We could export this in export>products and take the -qty from there.
Now in this version system > data transfer > export > products
does not give me a negative Qty, it remains at zero and does not show me what I oversold (or in my case, pre-sold)
2.3.2 also does not have the option to export the Salable Qty/Default stock which IS showing my presell Qty.
Can someone help me export this to a csv?
exporting stock sources doesn't work
reports>products>ordered works to some extent but doesn't give a tidy amount sold by SKU ( I can build a spreadsheet to make this work but...)
It used to be as easy as exporting products and then the -QTY was in the QTY column, now not.
Any suggestions?


texts: magento 2 knockout js / require js subscribe to another files parameter

texts:
What I need to do is subscribe to another file / object via knockout js and require js.

For example I have in File1.js:

define(
[
    '/path/to/some/component',
    'ko'
],
function (Component, ko) {
    "use strict";
    return Component.extend({

        // this is the var that I need to subscribe to in File2
        somevar: ko.observable(null);

        // I have an event that triggers this method in another
        // external file that sets somevar
        myEvent: function(value){
           somevar(value);
        }
   });
});

and in file2.js I need to do something like

define(
[
    '/path/to/some/component',
    '/path/to/file#1',
    'ko'
],
function (Component, File1, ko) {
    "use strict";
    return Component.extend({

        // set a new observable var in file 2
        subscribeVar: ko.observable(null);

        initialize : function(){

            // and subscribe to the change in value of the var in
            // file 1
            File1.somevar() .subscribe(function(anotherValue){
                // here I want to execute my logic but the
                // illustrated method of doing this is not working.
            }, this);
        },
   });
});


texts:
I have products listed in a catagory and able to sort with layered navigation.  However, I wanted to add a table prior to the products to better describe each one.  See link below to see:
http://www.oxidationtech.com/products/ozone-generators.html

What I want, is when a selection from the layered navigation on the left is selected, the table should disappear as it is no longer necessary.  I would prefer after a selection to narrow-down from layered navigation is selected that only the selected products in that range appear.

Any ideas how I can have both?  Table on landing page + usable layered navigaion?


texts: Why is the default js files outside the theme package?

texts:
I am developing a new admin module and needs to customize the magento admin panel. i've created a new theme in default package of adminhtml. In the skin folder (skin/default/mytheme) i've included my css files and js files. And i've included them via my layout xml file

<?xml version="1.0"?>
<layout>
  <default>
    <reference name="head">
      <action method="addJs"><script>main.js</script></action>
      <action method="addJs"><script>bootstrap/bootstrap.min.js</script></action>
      <action method="addCss"><stylesheet>css/bootstrap.min.css</stylesheet></action>
    </reference>
  </default>
</layout>

Although the css files are loaded, the js files returns 404.

`js/` folder

I've found that magento saves most of the js files in the js/ folder in root. On moving my files here, it works perfectly.

Why does magento save js files here?

How can i save my js files in my package and still include in the header?


texts: Magento 2.3.5 layered navigation (left sidebar) url adding category id not the name

texts:
I am configuring a Magento 2.3.5 shop.
After clicking on a subcategory name in the layered navigation the category id (?cat=) is showing in the url instead of the name. Example: www.myshop.com/shoes/?cat=xx
When clicking on the subcategory through header navigation it does show the full category path name.
For example www.myshop.com/shoes/sneakers. So this does work but not through the layered navigation.
I have also a old Magento 1.9.1 shop and the layered navigation is also showing correctly the full name instead of id's. I can't imagine that Magento has changed this in 2.3.5, I am probably doing something wrong?
Could you please lead me to the right configuration? Did a lot of searching but some folks are mentioning using a third party tool. I don't want to use a tool to achieve this.
Thank you!


texts: How to link two different products to each other

texts:
I'd like to link two different products with each other and within some options. Like this:

Product A (productA.html) and Product B (productB.html) link to each other by (for example) color: Product A is black, Product B is white. I want both products to remain separate products with separate product pages. So there is no configuration, just a box where you can see both products by color.

Each product has its own options. So for example:

Product A

Original
Not Original

Product B

Original
Maybe Original
Not Original

How would I do something like this?


texts: How to add second parameter in Select query in magento

texts:
I try to retrieve some data using magento select.
Below is my coding.

Mage::app('default');
    $connection = Mage::getSingleton('core/resource')->getConnection('core_read');
    $select = $connection->select()
                ->from('wired_points', array('*'))
                ->where('order_id=?',$orderID);

    //$rowsArray = $connection->fetchAll($select); // return all rows
    $rowArray =$connection->fetchRow($select);   //return rowe

I want to add one more condition in where like log_id.

How can i add the second parameter to my where clause?


texts:
Is there any tutorial for top links or top menu.I want to customize top links.
please help me.
Thanks.


texts: Magento 2 CSS files removed from theme/web directory after run setup:upgrade

texts:
I am getting a strange issue from the last few days, The issue is all the files and folders will be from "/app/design/frontend/Compnay_Name/Theme_Name/web" folder after running "php bin/magento setup:upgrade" command from SSH.

Below are the exact steps that I have done from SSH.
I first run below commands remove one directory from \app\code\Rootways for that I first go to this location in SSH then run below commands
 rm -r payment/

then run below commands from the website root directory
 php bin/magento s:up
 php bin/magento c:f
 php bin/magento c:c
 php bin/magento indexer:reindex

Can anyone suggest us how to find out this issue?


texts:
I want to get reviews of the products using magento 2.0.5 . I think rest api for it is not being implemented.

Can u give me some idea about how to start?

And I have tried tutorial from Alan Kent blog(https://alankent.me/2015/07/24/creating-a-new-rest-web-service-in-magento-2/). But it is showing the following error.

[2016-06-09 08:49:34] main.CRITICAL: exception 'ReflectionException' with message 'Report ID: webapi-57592d9ec153f; Message: Class Magento\Review\Api\Review does not exist' in C:\xampp\htdocs\magento\vendor\magento\framework\Webapi\ErrorProcessor.php:194
Stack trace:

0 C:\xampp\htdocs\magento\vendor\magento\framework\Webapi\ErrorProcessor.php(139): Magento\Framework\Webapi\ErrorProcessor->_critical(Object(ReflectionException))

1 C:\xampp\htdocs\magento\vendor\magento\module-webapi\Controller\Rest.php(163): Magento\Framework\Webapi\ErrorProcessor->maskException(Object(ReflectionException))

2 C:\xampp\htdocs\magento\var\generation\Magento\Webapi\Controller\Rest\Interceptor.php(24): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))

3 C:\xampp\htdocs\magento\vendor\magento\framework\App\Http.php(115): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))

4 C:\xampp\htdocs\magento\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http->launch()

5 C:\xampp\htdocs\magento\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))

6 {main} [] []


texts: Magento | How to add Save Action for Customer Group new field

texts:
I added a new field for Customer Group. It called customer group email.
I added the field and it displays in the backend but it doesn't save the data and I don't know How can I add Save action. I tried to add this code in the file that called

  app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php

$groupEmail = $this->getRequest()->getParam('groupemail');
$customerGroup->setData($groupEmail)->setId($this->getRequest()->getParam('id'));

The added code in Form.php is:

$groupEmail = $fieldset->addField('customer_group_email', 'text',
    array(
        'name'  => 'groupemail',
        'label' => Mage::helper('customer')->__('Group email'),
        'title' => Mage::helper('customer')->__('Group email'),
        'note'  => Mage::helper('customer')->__('Maximum length must be less then %s symbols', Mage_Customer_Model_Group::GROUP_CODE_MAX_LENGTH),
        'class' => $validateClass,
        'required' => true,
    )
);


texts: Is the database structuration of Magento can be up dated?

texts:
Subject  :
I have MySQL Server contains Magento's DataBase (I have the diagram standard of magento) By VBA Excel I developped an application which extract many informations from Magento (By exécuting SQL requests).
Question :
Is the structuring of magento can be updated ?
like there is a table called 'sales_flat_invoice' and after updating it will be called 'sales_flat_invoice_V2'

so if it is possible it means my application wont work anymore with old SQL Requests and I have to change the SQL requests in the application :(
any help please !


texts: How to translate a phrase in Magento 2.1 checkout?

texts:
In checkout, under the "Summary" area, I've been able to translate "2 items in cart" using this entry in the .CSV file:

%1 items in cart, %1 artículos en tu carrito, module, Magento_Checkout

This works for 2,3,4... items in cart. However I haven't been able to translate "1 item in cart".

I've tried these entries:

%s item in cart, %1 artículo en tu carrito, module, Magento_Checkout

1 item in cart, 1 artículo en tu carrito, module, Magento_Checkout

None of them work.


texts:
I have created an overwrite for one of the emails using the "transactional Emails" function to customize the html and styles of the email however I cannot find a way to add the following to the top of the emails

<!DOCTYPE html>

In the backend it starts at the body tag and trying to add html tags or doctype do not work as I'm assuming something is combining the body with the css and adding the html tags.

I cannot find what file/function is adding the  tags around this to try and add the doctype into.


texts: Best way to Edit Default files & Apply Custom Application in Magento 2.3?

texts:
What are all the best way to edit core files in Magento 2.3. eg: magento 1.9 edit app/code/local or community instead of  app/code/core.

Note: What are all files I need to focus for Future Version updates.


texts:
I try create custom module config in magento2. This code add field productzoom

Source file: Xyaddons\Productzoom\etc\adminhtml\system.xml.

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd">
    <system>
         <tab id="catalog" translate="label" sortOrder="200">
            Catalog
        </tab>

            <class>separator-top</class>
            Catalog
            <tab>catalog</tab>
            <resource>Magento_Catalog::config_catalog</resource>
            <group id="productzoom" translate="label" type="text" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="1">
                Xyaddons Productzoom(Product views page)
                <field id="flat_xyaddons_productzoom" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                    Active

                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="list_zoom_style" translate="label" type="select" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                    Set style zoom
                    <source_model>Xyaddons\Productzoom\Model\Config\Source\Productzoom</source_model>
                </field>
            </group>

    </system>
</config>

source File Productzoom.php : Xyaddons\Productzoom\Model\Config\Source\Productzoom

<?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Xyaddons\Productzoom\Model\Config\Source;

class Productzoom implements \Magento\Framework\Option\ArrayInterface
{
    /**
     * {@inheritdoc}
     *
     * @codeCoverageIgnore
     */
    public function toOptionArray()
    {
        return [
            ['value' => 'tints', 'label' => __('Tints')],
            ['value' => 'easing', 'label' => __('Easing')]
        ];
    }
}

how do get value in frontend?


texts: Add to cart product with custom option "file"

texts: I am trying to add products to cart with custom options. All are working but if custom options is file, it's not working. I've tried everything so far, but no luck. Anyone tried this and have a solution? TIA!


texts: show last updated date time field in address magento admin

texts:
I want to show a text field in address field which can show the last updated date time in customer address section in magento admin.

I have this field in every address a customer can have 2-3 or more address then this field should be every time show in magento admin.

If any one have any idea and any code script please let me know show I can Integrate this.

Thank you in Advance.


texts: one step checkout Fatal Error: 'Uncaught TypeError: Argument 1 passed to Magento\\Sales\\Model\\Order::setShippingAddress() must implement interface

texts:
Hello, when i enable extension onestep chekout i can't checkout for guest. I can checkout order for login customer. But guest customer cannot success order. It’s show success page but not order id and admin panel and database not show order. But in paypal charge credit customer complete. In folder var/report show error.
Fatal Error: 'Uncaught TypeError: Argument 1 passed to Magento\\Sales\\Model\\Order::setShippingAddress() must implement interface Magento\\Sales\\Api\\Data\\OrderAddressInterface or be null, array given, called in \/home\/rootname\/websitename.com\/app\/code\/Codazon\/OneStepCheckout\/Plugin\/Model\/Checkout\/PaymentInformationManagement.php on line 116 and defined in \/home\/rootname\/websitename.com\/vendor\/magento\/module-sales\/Model\/Order.php:1009\nStack trace:\n#0 \/home\/rootname\/websitename.com\/app\/code\/Codazon\/OneStepCheckout\/Plugin\/Model\/Checkout\/PaymentInformationManagement.php(116): Magento\\Sales\\Model\\Order->setShippingAddress(Array)\n#1 \/home\/rootname\/websitename.com\/vendor\/magento\/framework\/Interception\/Interceptor.php(135): Codazon\\OneStepCheckout\\Plugin\\Model\\Checkout\\PaymentInformationManagement->aroundPlaceOrder(Object(Magento\\Quote\\Model\\QuoteManagement\\Interceptor), Object(Closure), '10625', NULL)\n#2 \/home\/rootname\/websitename.com\/vendor\/magento\/module-braintree\/Plugin\/OrderCancellatio' in '\/home\/rootname\/websitename.com\/vendor\/magento\/module-sales\/Model\/Order.php' on line 1009

And sometime show Failed to load resource: the server responded with a status of 400 (Bad Request) on
https://websitename.com/rest/default/V1/guest-carts/4HbXvlHpJTdCojS4shmej3X9vfvyRSPS/payment-information
Help me please. Please advise me on how to fix it.
Thank you.


texts: CMS Custom layout update not showing in Magento 2.3.4

texts:
I've read the patch notes about moving the Custom Layout Update to a layout file in Magento 2.3.4 so I thought I was doing this correctly but something must be off because I still don't see the option under the Design->Custom Layout Update for this CMS page.
I'm really just looking to add a JS file to this single CMS page. Here's my code:
/app/design/frontend/Vendor/Theme/Magento_Cms/layout/cms_page_view_selectable_my-cms-page_CustomJs.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">
    <head>
        <link src="js/custom.js"/>
    </head>
</page>

I've run cache:clean and cache:flush multiple times, index:reindexed, and run setup:upgrade until my eyes bled. This site does have multiple themes/sites so maybe there's something there I need to do? Any idea what I'm doing wrong?


texts: What is causing SQLSTATE[42000]: Syntax error or access violation: 1064 when trying to Group Tables?

texts:
I have been trying to figure out what is causing the exception when attempting to create a join for my Collections and group them with the main_table.

Here is the code from my Collection.php

<?php

class Companyname_CheckoutComments_Model_Resource_Comment_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract{

    protected function _construct() {

        $this->_init('checkoutcomments/comment');
    }
    public function addCustomerFilter($customer){

        $select = $this->getSelect();
        if ($customer->getId()){
            $select->where('order.customer_id?', $customer->getId());
        } else {
            //Force empty result set for not logged in customers
            $select->where('1=0');
        }

        $select->join(array('order' => $this->getTable('sales/order')),
                'order.entity_id = main_table.order_id',
                array('status', 'created_at'));

        $select->join(array('order_item' => $this->getTable('sales/order_item')),
                'order_item.order_id = main_table.order_id
                AND order_item.parent_item_id IS NULL ',
                array());

        /** Mage_Core_Model_Resource_Helper_Mysql4 */
        Mage::getResourceHelper('core')->addGroupConcatColumn($select, 'product_names', 'order_item.name', ', ' );
        $select->group('main_table.comment_id');
        return $this;
    }
}

The line that is giving me grief is:

$select->group('main_table.comment_id');

As it throws an error that I'm can't seem to fix

QLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2') GROUP BY `main_table`.`comment_id`' at line 4

SELECT `main_table`.*, `order`.`status`, `order`.`created_at`, GROUP_CONCAT(order_item.name SEPARATOR ', ') AS `product_names` FROM `checkout_comments` AS `main_table` INNER JOIN `sales_flat_order` AS `order` ON order.entity_id = main_table.order_id INNER JOIN `sales_flat_order_item` AS `order_item` ON order_item.order_id = main_table.order_id AND order_item.parent_item_id IS NULL WHERE (order.customer_id'2') GROUP BY `main_table`.`comment_id`

If anyone knows the correct syntax to use please could you kindly advise or if there is some error in my code that I have missed.

Thanks in advance guys!


texts:
I have created a new module with my crontab.xml :

<config>
    <group id="default">
        <job name="order_read" instance="Cincuenta\CronOrders\Model\Orders" method="readOrders">
            <schedule>*/5 * * * *</schedule>
        </job>
    </group>
</config>

Also i got a CronOrders/Model/Orders.php with the function :

public function readOrders(){

        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/loggy.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info('LOG1');
...

I had try to run by command with

php bin/magento cron:run

and

php bin/magento cron:run --group:"default"

But the log is not been created.
I also tested my log code and it runs in others functions well.

Any error with the crons in Magento 2 or I'm missing something?


texts: How to create ui-select in form programmatically

texts:
My code to generate the field multi-select
$fieldset->addField('multiselect2', 'multiselect', array(
            'label'     => __('Select Type2'),
            'class'     => 'required-entry',
            'required'  => true,
            'name'      => 'multi',
            'onclick' => "return false;",
            'onchange' => "return false;",
            'elementTmpl' => 'ui/grid/filters/elements/ui-select', // I try this, but not work
            'component' => 'Magento_Ui/js/form/element/ui-select', // I try this, but not work
            'value'  => '4',
            'values' => array(
                '-1'=> array(
                    'label' => 'Please Select..',
                    'value' => '-1'
                ),
                '1' => array(
                    'value'=> Cat::getOptionsToMultiselect(),
                    'label' => __('Category')
                ),
            'after_element_html' => '<small>Comments</small>'
        ));


texts: What are the possible issues and Highlighted features of Magento 2.3.2

texts:
Magento Commerce 2.3.2 Release Notes has released on June 29.

Patch code and release notes published on June 25, 2019. Release notes last updated on July 8, 2019.

What are the highlighted features in this version directly as a list
What are the possible Issues
what are the differences between this version and the previous version.


texts: Magento 2 - Notice: Undefined variable: template in \vendor\magento\framework\View\Page\Config\Renderer.php on line 379

texts:
I have a problem, the interface shows it.

1 exception(s):

Exception #0 (Exception): Notice: Undefined variable: template in

\vendor\magento\framework\View\Page\Config\Renderer.php on line 379

and in the backend it shows everything without style and with errors, for this I need to deploy static-content, but this command does not work properly, what can I do to fix it all, it all happened after I did di:compile


texts: Magento 2 $transport->sendMessage() - where I can get the function body

texts:
In : \vendor\magento\module-contact\Model\Mail.php::$transport->sendMessage();

Where I can get the function sendMessage() body?

Mail is not sending from my magento.


texts:
Since I upgraded from Magento 2.2.7 to Magento 2.3.1 I am getting this message in the system.log file:

  main.INFO: Consumer "async.operations.all" skipped as required connection "amqp" is not configured. Unknown connection name amqp [] []

I get this error also on a fresh Magento 2.3.1 install.

Where could I configure or disable it?