texts: How to customize the Error Report Page so it uses blocks

texts:
We have a custom error report page set up, the specs for the page was that it had to look like the site normally showing the top navigation and category list in the left sidebar, this was done in Enterprise 1.11

while looking at it i found that the person who created the page just got the HTML Source and replaced all the http:// parts with getBaseUrl and added the code in to add the 404 or report .phtml pages, i have found 2 problems with this

in 1.13 all our urls are broken because of the new globally unique url keys, 2/3rds will no longer work
if a chnage has been made to the way the sites looks or new categories are added these wont appear making the error report page and the site no longer looking similar

while i can fix these 2 thing up, the fix is a pain in the ass of how often the page will need to be edited every time there is a change, i have thought to recreate the error page so that it builds up like a normal magento frontend template

here's the kicker, no matter what i google i get the same results which is using static html to make the page with a $baseUrl variable for every link and a require_once $contentTemplate; to get the 404, 503 or report phtml file

i am wondering how i can customize the error report page using the normal blocks so that the page doesn't have to be changed in any template is changed


texts: Showing New Products on home page from Magento 2

texts:
I am trying to show New Products on the home page from Magento 2, for this, I am written below code. But I am not getting correct data. between $from_date = strtotime('12/28/2016'); and $to_date = strtotime('01/30/2017'); dates.

/**
     * Get product collection
     */
    public function getProducts() {

        $from_date = strtotime('12/28/2016');
        $to_date = strtotime('01/30/2017');

        $news_from_date = $this->_localeDate->date($from_date)->setTime(0, 0, 0)->format('Y-m-d H:i:s');
        $news_to_date = $this->_localeDate->date($to_date)->setTime(23, 59, 59)->format('Y-m-d H:i:s');

        $collection =  $this->_collection
            ->addMinimalPrice()
            ->addFinalPrice()
            ->addTaxPercents()
            ->addAttributeToSelect('name')
            ->addAttributeToSelect('image')
            ->addAttributeToSelect('special_price')
            ->addAttributeToFilter('news_from_date', array('date' => true, 'to' => $todayDate))
        ->addStoreFilter()->addAttributeToFilter(
                'news_from_date',
                [
                    'or' => [
                        0 => ['date' => true, 'to' => $news_from_date],
                        1 => ['is' => new \Zend_Db_Expr('not null')],
                    ]
                ],
                'left'
            )
        ->addAttributeToFilter(
                'news_to_date',
                [
                    'or' => [
                        0 => ['date' => true, 'from' => $news_to_date],
                        1 => ['is' => new \Zend_Db_Expr('not null')],
                    ]
                ],
                'left'
            )->addAttributeToFilter(
                [
                    ['attribute' => 'news_from_date', 'is' => new \Zend_Db_Expr('not null')],
                    ['attribute' => 'news_to_date', 'is' => new \Zend_Db_Expr('not null')],
                ]
            );
        return $collection;
    }

Could you please suggest me how to get the product collection between two dates?


texts: Target all page layouts in layout xml file

texts:
I have a file with the following content:

<?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>
        <block class="Website\Product\Block\Header" name="header" htmlTag="div" template="Website_Product::phtml/header.phtml"/>
    </body>
</page>

Where <page layout="1column"... is there an option to apply to all layouts? <page layout="*"...?


texts: Change Discount Label in PDF Invoice in magento 2

texts:
In Magento-2 I generate PDF invoice and successfully edit the layout of PDF.
There is one More thing to change the label of Discount

Current Label is Discount(Coupon Code)
want change in Discount(Coupon Code -inclusive tax)

I already try many things like (1) change in en_US.csv but it doesn't work with me

Thanks In Advance.


texts: Magento 2 C2C Platform with Offline Payment

texts:
I'm Looking for Magento 2 extension where users can post their products to buy/sell. Payment process will be done offline. Buyer & Seller can do discussion online via messaging.

So there are number of sellers & buyers. Admin has rights to approve/disapprove product of seller as well as his account.

Offline they will meetup exchange product & pay over there. Once product sold seller mark product as [Sold] on site.

Example: https://sg.carousell.com/

Let me know if you have any suggestions.

Thanks


texts: Magento 1.14 Image upload from admin panel throwing 404

texts:
I am working with the Magento EE 1.14 site, recently I've installed the patch(11295), after installed it, I am facing issue while upload the product image from back-end.
I've reviewed the code changes after applied the patch.
In the following file path, the Patch made some changes.
app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery/Content.php

$this->getUploader()->getConfig()
            ->setTarget(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/catalog_product_gallery/upload', array('_query' => false)))
            ->setFileField('image')
            ->setFilters(array(
                'images' => array(
                    'label' => Mage::helper('adminhtml')->__('Images (.gif, .jpg, .png)'),
                    'files' => array('*.gif', '*.jpg','*.jpeg', '*.png')
                )
            ));

The changes are in setTarget, previously(before patch) It's setUrl. I've also reverted to setUrl and tested in my end, that case It's working good.
While upload and save the image it's going to the following path:
setTarget : /index.php/admin/admin/catalog_product/upload/key/aad8074310eecfbe3a6508a4a0c763df1f8ff0a89da1c387587794f87924efcb/
setUrl : /index.php/admin/admin/catalog_product_gallery/upload/key/01c9c1534b8147b59fb2234d904ed4d42b6636dc3b469ab26c615cc840dfd9e2/

Any one faced this kind of issue, thanks in advance for your better support


texts:
We have recently updated magento from 2.2.3 to 2.3.1 using composer (with automated script), it went though fine but we get following error on indexing:

  Catalog Search indexer process unknown error: SQLSTATE[42S22]: Column
  not found: 1054 Unknown column 'e.category_ids' in 'field list', query
  was: SELECT e.entity_id, e.type_id, e.category_ids,
  e.sku FROM catalog_product_entity AS e  INNER JOIN
  catalog_product_website AS website ON website.product_id =
  e.entity_id AND website.website_id = 1  INNER JOIN
  catalog_product_entity_int AS visibility_default ON
  visibility_default.entity_id= e.entity_id AND
  visibility_default.attribute_id = '99' AND visibility_default.store_id
  = 0  LEFT JOIN catalog_product_entity_int AS visibility_store ON visibility_store.entity_id= e.entity_id AND
  visibility_store.attribute_id = '99' AND visibility_store.store_id =
  '1'  INNER JOIN catalog_product_entity_int AS status_default ON
  status_default.entity_id= e.entity_id AND status_default.attribute_id
  = '97' AND status_default.store_id = 0  LEFT JOIN catalog_product_entity_int AS status_store ON
  status_store.entity_id= e.entity_id AND status_store.attribute_id =
  '97' AND status_store.store_id = '1' WHERE
  (IF(visibility_store.value_id > 0, visibility_store.value,
  visibility_default.value) IN (3, 2, 4)) AND (IF(status_store.value_id

    0, status_store.value, status_default.value) IN (1)) AND (e.entity_id > 0) AND (e.entity_id < 501) ORDER BY e.entity_id ASC
    LIMIT 500

we are using ElasticSearch.

any suggestions? please.

Thanks


texts: The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly Error

texts:
When I try to complete the checkout by paying with Hosted Payment Form (mastercard module) I get an error 400 Bad request.
I was reading the exception.log file and I found an error that says the following:

main.CRITICAL: The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly {"exception":"[object]

I was searching in internet and tried the following commands:

export COMPOSER_HOME="$HOME/.config/composer/"
export CGR_BASE_DIR="$HOME/.config/composer/global"
export CGR_BIN_DIR="$HOME/.config/composer/vendor/bin"

but none of this worked yet, i'm still getting the error.
Hope someone can help me.
Greetings!


texts: Magento 2 - Error in magento during re-indexing by CLI?

texts:
I am using magento 2.2.2. I am working on it last 3 months. But suddenly It giving me this error while I run command for re-indexing the site.
commend for re-indexing,

php bin/magento cache:clean;

php bin/magento cache:flush;

php bin/magento indexer:reindex;

Catalog Search indexer process unknown error,

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.category_ids' in 'field list', query was: SELECT e.entity_id, e.type_id, e.category_ids, e.sku FROM catalog_product_entity AS e
   INNER JOIN catalog_product_website AS website ON website.product_id = e.entity_id AND website.website_id = '1' WHERE (e.entity_id > 0) ORDER BY e.entity_id ASC
   LIMIT 100

Does anyone have the solution for this? Thanks in Advance.


texts: How to add & remove column in admin > sales > orders

texts: i have to remove Bill to Name column & add two new columns product title name (which describe the product Name of Product) &  Payment Method(which describe the payment method at the time of order in Magento admin panel (admin > sales > orders)


texts: Is it Possible to add Remove from cart in product page?

texts: I want to add a remove from cart button in product page, do you have an clue guys?


texts:
I did the resize images command due to the bug in 2.1.6 and now the inodes are way over my quota and the images are not fully loaded yet.
Is there anything we can do to solve this ASAP.

I have been clearing my cache every 3-4 hours to make sure the site does not crash.


texts: Magento 2 - add static reset css just before head close

texts:
I want to use a static css to reset my theme css, i cant modify main files because its paid theme and it will be auto reset at time of update.

So I need to add a static css just before  (head close) so it could reset all top css.

I know how to add by : default_head_blocks.xml but that is adding css at the top of .

i want to use it like this js example:

 <referenceContainer name="before.body.end">
      <block class="Magento\Framework\View\Element\Js\Components" name="js.beforebody" as="jsbeforebody" template="Magento_Theme::js/js.phtml"/>
    </referenceContainer>


texts: How can I find after how many sales a product becomes best seller?

texts: It is kind a silly question (I know), but where can I find after how many sales a product becomes a Bestseller?


texts: Magento 2.2.5: How to make the catalog product image as required?

texts:
I want to make catalog product image as required in magento2.2.5

Any help would be appreciated


texts: Checkout as Guest = "Please make sure your passwords match"

texts:
I found an error in my e-commerce website when I tried to checkout a product as guest.

When I try to continue the process, I get this message:

I would like to know how I can fix this issue.

Can someone help me?


texts: HTML and attachment issue in order confirmation email - Magento 1.9

texts: When someone placed an order on the website, they received a order confirmation email  and its works, but the problem is its coming as attachment email and HTML format to show on the email so my question is how to i stop it from coming as an attachment i just want it to be HTML with out the download part.


texts: Mage_Eav_Model_Entity_Attribute_Backend_Abstract's afterLoad() doesn't get called in certain cases?

texts:
I have created a custom attribute defined by a module. I am doing this to define a custom Input Renderer in the admin. This attribute serializes/unserializes its content within an afterLoad() override, like this:

<?php
    class WarrantyLengths_Attr_Model_Custom extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract{
        public function beforeSave($object)
        {
            //before saving the product check if the attribute is an array.
            //if it is, serialize it for saving in the db
            $attributeCode = $this->getAttribute()->getAttributeCode();
            $data = $object->getData($attributeCode);
            if (is_array($data)) {
                $data = array_filter($data);
                $object->setData($attributeCode, serialize($data));
            }
            return parent::beforeSave($object);
        }
        public function afterLoad($object) {
            //after loading the product, check if the value for custom_values is not an array. If it's not try to unserialize the value.
            $attributeCode = $this->getAttribute()->getAttributeCode();
            $data = $object->getData($attributeCode);
            if (!is_array($data)) {
                $object->setData($attributeCode, @unserialize($data));
            }
            return parent::afterLoad($object);
        }
    }

This works fine ... for some templates. I can do a $_product->getData('warranty_lengths') within catalog/product/view.phtml just fine - afterLoad() provides unserialized content from a getData() call.

But... this is not the case for catalog/product/list.phtml. The attribute value is returned unserialized.

Why might this be? Smells like a bug to me. I'm developing under Magento ver. 1.9.2.4.


texts: Magento 2: how to create your own custom cache type?

texts:
In Magento 1, it was possible to create your own cache type by declaring the following in your config.xml:

<global>
    <cache>
        <types>
            <custom translate="label,description" module="module">
                <label>Custom Cache</label>
                <description>This is my custom cacge</description>
                <tags>CUSTOM_CACHE_TAG</tags>
            </custom >
        </types>
    </cache>
</global>

It will result in a new cache type added to the backend under System > Cache Management and thus, it will add the ability to flush cache related to the CUSTOM_CACHE_TAG cache tag.

Is that possible in M2 and how to achieve it ?


texts: Using the right event observer name issue in the admin area

texts:
I would like to some custom things when you are on the create a new website in the admin area page.
This is the exact controller used to render that page:
\Magento\Backend\Controller\Adminhtml\System\Store\NewWebsite::execute

and this is the content of the adminhtml/events.xml file:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="controller_action_postdispatch_system_store_newwebsite">
        <observer name="custom_name"
                  instance="Namespace\Module\Observer\Custom" />
    </event>
</config>

I am looking for the right event name. I tried several variations like:
controller_action_postdispatch_system_store_newwebsite
controller_action_postdispatch_system_store_newWebsite
controller_action_postdispatch_admin_system_store_newwebsite
controller_action_postdispatch_adminhtml_system_store_newWebsite

None of them are working. I am trying to get the full action name. This is from the docs:
controller_action_postdispatch_{full_action_name} – executes after a controller with specific {full_action_name}.

The route defined in the : vendor/magento/module-backend/etc/adminhtml/routes.xml is: admin
. See:
<router id="admin">
    <route id="adminhtml" frontName="admin">
        <module name="Magento_Backend" />
    </route>
</router>

Would you please help out, to get the right event name ? Thank you


texts: Customer Login Page randomly stopped working

texts:
For some reason the customer login page on my site has just totally stopped working and just refreshes.

https://www.coffeeseller.com/customer/account/login/

any help would be much appreciated.


texts: Custom Rest API for custom table not wroking

texts:
My webapi.xml is below.

<?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
     <route url="/V1/garage/insert/" method="POST">
        <service class="Garage\Motogaadi\Api\GarageInsert" method="insert"/>
        <resources>
           <resource ref="anonymous"/>
        </resources>
    </route>
</routes>

Also my di.xml is below

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
      <preference for="Garage\Motogaadi\Api\GarageInsert" type="Garage\Motogaadi\Model\GarageAdd" />
</config>

My interface is below.

<?php
namespace Garage\Motogaadi\Api;

interface GarageInsert
{

    /**
     * Returns greeting message to user
     *
     * @api
     * @param string $data Users name.
     * @return string Greeting message with users name.
     */

    public function  insert($data);
}

My model is below

<?php
namespace Garage\Motogaadi\Model;
use Garage\Motogaadi\Api\GarageInsert;

class GarageAdd implements GarageInsert
{

    /**
     * Returns greeting message to user
     *
     * @api
     * @param string $data Users name.
     * @return string Greeting message with users name.
     */

    public function insert($data)
    {

        //Customize the code as per your requirement.
        $cid = $data['id'];
        $gid = $data['gid'];
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager
        $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
        $connection = $resource->getConnection();
        $tableName = $resource->getTableName('garage_customer_ids');
        $sql = "Insert Into " . $tableName . " ( customer_id, garage_data_id) Values ('$cid','$gid')";
        $connection->query($sql);
        return 'successfully saved';

    }
}

I get the below error when I post the data.

"message": "The \"array\" value's type is invalid. The \"string\" type was expected. Verify and try again.",


texts:
I created a simple product without variants (without possibility choosing sizes).

when this product is added to the basket, the system correctly adds the set delivery costs.

I created second configurable product with variants (need to choose the size of the product (S,M,L, or XL).

when I choose eg size M and add the product to the basket then then delivery costs are not added to the product. I can finalize the order without paying the shipping costs. How to solve it ?

Thanks for help.


texts:
I'm currently trying to add a product (with custom options) to the cart via JavaScript in Magento 2.1.

I've implemented a solution in the past for Magento 1.9, but this solution no longer works for the new Magento version. The old solution retrieved the quoteId for the current user and then created an add-to-cart-link which added the product to the cart. But it seems there is no more such link and the retrieving of the quote id also won't work anymore.

Until now I was able to create a new quote/cart id and add a product to this cart:

function AddToCart(data) {
    var sku = data.sku;
    var qty = data.quantity;

    // create a new quote
    var request = jQuery.ajax({
        url: "http://foo.com/rest/default/V1/guest-carts",
        method: "POST",
        dataType: "json"
    }).done(function( quoteId ) {
        // add the product if quote creation was successful
        var data = {
            "cartItem": {
                "sku": sku,
                "qty": qty,
                "quote_id": quoteId
            }
        };
        jQuery.ajax({
            url: "http://foo.com/rest/default/V1/guest-carts/"+quoteId+"/items/",
            method: "POST",
            dataType: "json",
            data: JSON.stringify(data)
        }).done(function( response ) {
            console.log("Product added to cart. ");
        }).fail(function( jqXHR, textStatus ) {
            console.log("Add to cart failed. " + textStatus);
        });
    }).fail(function( jqXHR, textStatus ) {
        console.log("Couldn't retrieve the QuoteId. " + textStatus);
    });
}

Problems with this code:

The cart is not in anyway associated with the currently active client/user, it's just an invisible cart where I add the product(s). I can interact with the cart via API, but it's not shown to the client
Furthermore this code only works for guests and not for customers who are logged in
A new cart will be created each time, ignoring existing user carts

My questions now are:

Is there a way to retrieve the quote id for a guest? (Question 1 ,  Question 2 and other questions only apply for logged in customers). The quote id could then be used to add the product to an existing cart
Is there a way to assign a guest to a cart? There seems to be an API call which assigns a customer to a cart (/V1/guest-carts/{cartId}), but this only works for users who are logged in since a customerId is required
Is there any other way (which I havn't found yet) to add a product to the cart via JavaScript?


texts:
We're trying for the first time to manually do a migration from WooCommerce to Magento because we want to understand the nuts and bolts of everything that "should" happen in this process because no doubt, if we do this for another client, say with Microsoft product items, we will know what to do.

I have started a Google Spreadsheet that matches the column names in WooCommerce with the column names in Magento. The idea is then to create a script that you could potentially import your two spreadsheets and easily rename the correct columns.

Does something like this already exist...not software that has been.

Many thanks.


texts: Send data in email but email data is empty

texts:
Email code:

$storeId = Mage::app()->getStore()->getId();
        $templateId =     Mage::getStoreConfig(self::XML_PATH_ATTACHMENTS_EMAIL_TEMPLATE);

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

        $vars = array('data' => "hello");
        $a = $emailTemplate->getProcessedTemplate($vars);
        $emailTemplate->setTemplateSubject("Email");
        $emailTemplate->setSenderEmail($email, $storeId);
        $emailTemplate->setSenderName("AAA", $storeId);
        $emailTemplate->send($email,"AAA", $vars);


texts: Which Authorize.net API's are used in Magento?

texts:
Magento has two relevant payment methods:  Authorize.net and Authorize.net Direct Post.  My assumption is that the Authorize.net method uses the AIM api, and the Authorize.net Direct Post uses the DPM api.

A comparison of the Authorize.net APIs can be found here:  http://developer.authorize.net/api/compare/

The code seems to support my assumption based on these two models:

Mage_Authorizenet_Model_Directpost
Mage_Paygate_Model_Authorizenet

Can anyone confirm/deny this assumption?


texts: How include the Swiper slider html in Magento2.2.6?

texts:
I tried i include the swiper.min js. but not working.

https://idangero.us/swiper/demos/080-scrollbar.html

i added this slider in our product phtml file then coming error please let me know how we can fix this screenshot.
http://prntscr.com/lmbmis

http://magento-213836-648260.cloudwaysapps.com/demo
this is my site link.


texts:
I want to create sub admin role with own customer access permission. That means sub admin will login in admin panel and able to create customers. Sub admin can see only own customers, nothing else. There will be two sub-admin.

Please let me know how can I do this in Magento 2. I don't want to purchase any third party module.

Thanks in advance.


texts: How to add product to Wishlist without redirecting and without page refresh using ajax on Listing page

texts:
My controller:
app\code\Vendor\Mymodule\Controller\Index\Wishlist.php

<?php

namespace Vendor\Mymodule\Controller\Index;

class Wishlist extends \Magento\Framework\App\Action\Action {

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Wishlist\Helper\Data $wishlistHelper,
        \Magento\Framework\Controller\Result\JsonFactory $jsonFactory
        ) {
            parent::__construct($context);
            $this->wishlistHelper = $wishlistHelper;
            $this->jsonFactory = $jsonFactory;
    }

    public function execute() {
        $result = $this->jsonFactory->create();
        $data = $this->wishlistHelper->getWishlistItemCollection()->getData();

        return $result->setData(['status' => 200, 'items' => $data]);
    }

}

app\code\Vendor\Mymodule\etc\frontend\routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route frontName="customwishlist" id="customwishlist">
<module name="Heart_Listcolor"/>
</route>
</router>
</config>

Now the product added but redirect to the wishlist landing page, how to add the product to Wishlist without redirecting and without refresh using ajax
My custom theme Magento_Wishlist
app\design\frontend\Zero\my_theme\Magento_Wishlist\templates\catalog\product\list\addto\wishlist.phtml
<?php
/**
* Copyright Â© Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

/** @var Magento\Wishlist\Block\Catalog\Product\ProductList\Item\AddTo\Wishlist $block */
?>
<?php if ($block->getWishlistHelper()->isAllow()) : ?>

<a href="#"
class="action towishlist"
title="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>"
aria-label="<?= $block->escapeHtmlAttr(__('Add to Wish List')) ?>"
data-post='<?= /* @noEscape */ $block->getAddToWishlistParams($block->getProduct()) ?>'

role="button">

<img class="whislist-icon product-id-<?php echo $block->getProduct()->getId();?>" src="<?php /* @escapeNotVerified */ echo $block->getViewFileUrl('images/whislist.png'); ?>" />
<?= $block->escapeHtml(__('Add to Wish List')) ?>

<?php endif; ?>
<?php
$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $_objectManager->get('Magento\Store\Model\StoreManagerInterface');
$currentStore = $storeManager->getStore();
$mediaUrl = $currentStore->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
$img = $mediaUrl."yt.png";
?>

Now i created a controller to update the wishlist icon after the product added to the wishlist. this is working good but redirects to a wishlist landing page,
How to achieve without redirecting and without refresh page to add the product to wishlist.


texts: Changing product based on user's location

texts: Is it possible to change the products based on the local regions without choosing a particular store? So do, I need to make a custom field of location for the products?  Please help me!


texts:
I want to know if there is a way to set a discount to quote before paying ?

I would like to set a percent discount if customer select special payment.

Thanks.


texts: How can I add a custom attribute to the customer table?

texts:
I seach many answer that nerver success.
My last try is this answer
This is my code in my Module/Setup/Patch/Data
<?php
namespace Mus\Hello\Setup\Patch\Data;

use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;

class AddCustomerPhoneNumberAttribute  implements DataPatchInterface
{
    /**
     * @var ModuleDataSetupInterface
     */
    protected $moduleDataSetup;

    /**
     * @var CustomerSetupFactory
     */
    protected $customerSetupFactory;

    /**
     * @var AttributeSetFactory
     */
    protected $attributeSetFactory;

    /**
     * AddCustomerPhoneNumberAttribute constructor.
     * @param ModuleDataSetupInterface $moduleDataSetup
     * @param CustomerSetupFactory $customerSetupFactory
     * @param AttributeSetFactory $attributeSetFactory
     */
    public function __construct(
        ModuleDataSetupInterface $moduleDataSetup,
        CustomerSetupFactory $customerSetupFactory,
        AttributeSetFactory $attributeSetFactory
    ){
        $this->moduleDataSetup = $moduleDataSetup;
        $this->customerSetupFactory = $customerSetupFactory;
        $this->attributeSetFactory = $attributeSetFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function apply()
    {
        $customerSetup = $this->customerSetupFactory->create(['setup' => $this->moduleDataSetup]);

        $customerEntity = $customerSetup->getEavConfig()->getEntityType(Customer::ENTITY);
        $attributeSetId = $customerEntity->getDefaultAttributeSetId();

        $attributeSet = $this->attributeSetFactory->create();
        $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

        $customerSetup->addAttribute(
            Customer::ENTITY,
            'phone_number',
            [
                'type' => 'varchar',
                'label' => 'Phone Number',
                'input' => 'text',
                'validate_rules' => '{"max_text_length":255,"min_text_length":1}',
                'required' => false,
                'sort_order' => 120,
                'position' => 120,
                'visible' => true,
                'user_defined' => true,
                'unique' => false,
                'system' => false,
            ]
        );

        $attribute = $customerSetup->getEavConfig()->getAttribute(
            Customer::ENTITY,
            'phone_number'
        );

        $attribute->addData(
            [
                'attribute_set_id' => $attributeSetId,
                'attribute_group_id' => $attributeGroupId,
                'used_in_forms' => ['adminhtml_customer', 'customer_account_create', 'customer_account_edit'],
            ]
        );

        $attribute->save();
    }

    /**
     * {@inheritdoc}
     */
    public static function getDependencies()
    {
        return [];
    }

    /**
     * {@inheritdoc}
     */
    public function getAliases()
    {
        return [];
    }

    /**
     * {@inheritdoc}
     */
    public static function getVersion()
    {
        return '1.0.0';
    }
}

I try to run bin/magento setup:upgrade,but it doesn't work.
I can't saw the field in the admin customer create table.
How can I solve this question?


texts: TypeError: url is undefined when trying to create an associated product

texts: Firebug shows the error "Url is undefined" when I try to save a quick simple product, so nothing happens when I hit "quick create". "Create empty" and "copy from configurable" pop up as empty windows as well. I have added a screenshot- am a bit at a loss at how to go about fixing this..Any pointers are greatly appreciated!


texts: What would be the Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) in Magento 2?

texts:
in magento 1

$directory = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA).

how i set this in magento 2


texts: Overriding core user data files for Magepack

texts:
We are working on getting Magepack installed on our dev environment.  One of the shims we had to fix was in the "customer-data.js".  It works when we edit the core file(vendor/magento/module-customer/view/frontend/web/js/customer-data.js), but when we try and put it into the "app/code" file, the override doesn't seem to work.
This is what we are trying.
app/code/Magento/Customer/view/frontend/web/js/customer-data.js
We've deployed, clear cache, everything, but that file does not override for some reason


texts: magento can't upload csv file custom module

texts:
here is all my file

Form.php

<?php

class Sample_Bigcom_Block_Adminhtml_Form_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
{
    /**
     * Preparing form
     *
     * @return Mage_Adminhtml_Block_Widget_Form
     */
    protected function _prepareForm()
    {
        $form = new Varien_Data_Form(
            array(
                'id'     => 'edit_form',
                'action' => $this->getUrl('*/*/save'),
                'method' => 'post',
            )
        );

        $form->setUseContainer(true);
        $this->setForm($form);
        $fieldset = $form->addFieldset('bigcom_form', array('legend'=>Mage::helper('sample_bigcom')->__('Project information')));
 $fieldset->addField('file', 'file', array(
          'label'     => Mage::helper('sample_bigcom')->__('Upload'),
          'name'  => 'csvupload',
          'value'  => 'Uplaod',
        //  'after_element_html' => 'Comments',
          'tabindex' => 1
        ));

        $fieldset->addField('submit', 'submit', array(
          'label'     => Mage::helper('sample_bigcom')->__('Submit'),
          //'required'  => true,
          'value'  => 'Submit',
          //'after_element_html' => 'Comments',
          'tabindex' => 2
        ));
       return parent::_prepareForm();
    }
}

here is my controller

BigcomController.php

<?php

class Sample_Bigcom_Adminhtml_BigcomController extends Mage_Adminhtml_Controller_Action
{

    /**
     * View form action
     */
   public function indexAction()
    {
        $this->loadLayout()
            ->_setActiveMenu('mycustomtab')
            ->_title($this->__('Index Action'));
$block11=$this->getLayout()->createBlock('sample_bigcom/adminhtml_form_edit_form');
$this->getResponse()->setBody($block11->toHtml());
$block=$this->getLayout()->createBlock('sample_bigcom/adminhtml_form_edit');
$this->getResponse()->setBody($block->toHtml());
        // my stuff

        $this->renderLayout();
    }
    public function saveAction()
    {
        print_r($_REQUEST);
        Mage::log($_FILES);
        if ($data = $this->getRequest()->getPost()) {

            $type = 'csvupload';
            echo $_FILES[$type]['name'];
            if(isset($_FILES[$type]['name']) && $_FILES[$type]['name'] != '') {
                try {
                    $uploader = new Varien_File_Uploader('csvupload');
                    $uploader->setAllowedExtensions(array('csv'));
                    $uploader->setAllowRenameFiles(true);
                    $uploader->setFilesDispersion(true);
                    $path = Mage::getBaseDir('media') . DS . 'uploads' . DS;
                    $uploader->save($path, $_FILES[$type]['name'] );
                    $filename = $uploader->getUploadedFileName();

                } catch (Exception $e) {
                }

            }
            echo $filename;
        }

    }

}

i tried lot but every time i got error:

2015-08-08T07:07:08+00:00 DEBUG (7): Array
(
)

2015-08-08T07:07:08+00:00 ERR (3): Notice: Undefined index: csvupload  in C:\xampp\htdocs\magentosample77\app\code\local\Sample\Bigcom\controllers\Adminhtml\BigcomController.php on line 30
2015-08-08T07:07:08+00:00 ERR (3): Notice: Undefined variable: filename  in C:\xampp\htdocs\magentosample77\app\code\local\Sample\Bigcom\controllers\Adminhtml\BigcomController.php on line 45


texts: how magento 2 generats and archives log files in file system in server?

texts:
I have been searching in internet for this question "how Magento 2 generate log files and make archive files when the day passes is there an cron or configuration in admin area so I can change it for example archive log files monthly ?

thank you in advance,


texts: How do i add product grid in customer admin section and save the checkbox values to database

texts:
I want to add product grid in Magento 2 admin customer section with a separate tab, that I got completed, but when I select the checkbox values from grid and hit save.

It does not get the values of that grid and checkbox values in get and post action.

I have checked multiple time and tried lot with that but it seems like not working.

Any help on this will be appreciated and a knowledge sharing parts for others.

Thanks.


texts:
Is it possible to output the store name using double curly brace syntax?

For example, I know I can output the contact page's URL using:

Contact Luma

Is there a way I can do something like this:

Hi, welcome to {{store name}}! We hope you like it here.


texts: Unable to reindex after adding extension using Multi-Warehouse 'Insert value list does not match column list'

texts:
I'm having a conflict between two plugins, and can't reindex Product Prices.
The plugins are X-Multi-Warehouse and Simple Configurable Products.
It looks like Multi-Warehouse added the column stock_id to catalog_product_index_tier_price, and now the insert number of columns doesn't match. I'm not sure where to change the code to reflect this change.
It's running Magento 1.8

Error log:

## 2013-11-13 13:58:55
## 28663 ## QUERY
SQL: DESCRIBE `catalog_product_index_tier_price`
AFF: 5
TIME: 0.0006

## 2013-11-13 13:58:55
## 28663 ## QUERY
SQL: INSERT INTO `catalog_product_index_tier_price` SELECT `tp`.`entity_id`, `cg`.`customer_group_id`, `cw`.`website_id`, MIN(IF(tp.website_id = 0, ROUND(tp.value * cwd.rate, 4), tp.value)) FROM `catalog_product_entity_tier_price` AS `tp`
 INNER JOIN `customer_group` AS `cg` ON tp.all_groups = 1 OR (tp.all_groups = 0 AND tp.customer_group_id = cg.customer_group_id)
 INNER JOIN `core_website` AS `cw` ON tp.website_id = 0 OR tp.website_id = cw.website_id
 INNER JOIN `catalog_product_index_website` AS `cwd` ON cw.website_id = cwd.website_id WHERE (cw.website_id != 0) GROUP BY `tp`.`entity_id`,
    `cg`.`customer_group_id`,
    `cw`.`website_id` ON DUPLICATE KEY UPDATE `min_price` = VALUES(`min_price`)
TIME: 0.0008

## 2013-11-13 13:58:55
EXCEPTION
exception 'PDOException' with message 'SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1' in magento/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 magento/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 magento/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#2 magento/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#3 magento/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#4 magento/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `ca...', Array)
#5 magento/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `ca...', Array)
#6 magento/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php(455): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `ca...')
#7 magento/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php(379): Mage_Catalog_Model_Resource_Product_Indexer_Price->_prepareTierPriceIndex()
#8 magento/app/code/core/Mage/Index/Model/Indexer/Abstract.php(143): Mage_Catalog_Model_Resource_Product_Indexer_Price->reindexAll()
#9 magento/app/code/core/Mage/Index/Model/Process.php(210): Mage_Index_Model_Indexer_Abstract->reindexAll()
#10 magento/app/code/core/Mage/Index/Model/Process.php(258): Mage_Index_Model_Process->reindexAll()
#11 magento/app/code/core/Mage/Index/controllers/Adminhtml/ProcessController.php(127): Mage_Index_Model_Process->reindexEverything()
#12 magento/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Index_Adminhtml_ProcessController->reindexProcessAction()
#13 magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('reindexProcess')
#14 magento/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#15 magento/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#16 magento/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#17 magento/index.php(87): Mage::run('', 'store')
#18 {main}

I'm still pretty new to Magento. Apologies if this is super-specific.


texts: Coupon Code not working for configurable and bundle product type

texts:
I have created Shopping Cart Price Rule and coupon code is XXXX. There are no any condition.

Action is:
Apply: Percentage of product price discount
Discount Amount: 10
Maximum Qty Discount is Applied To: 1
Discount Qty Step (Buy X): 0
Apply to Shipping Amount: no
Free Shipping: no
Stop Further Rules Processing: no

Above coupon code (XXXX) is working with simple product type but it is not working with configurable and bundle product type.
Thanks in advance.


texts: Magento2 add estimate shipping button on cart page

texts:
Magento2 by default automatically calculates the shipping rates and shows on the frontend if the user enters the data in the cart sidebar.

I need to add a button so once the user enters the details like Country, zip code, and then click on the apply button shipping method should be shown.


texts: Can't set watermark in Magento2 / How to change footer links?

texts:
I tried to set watermark and thumbnail in Magento2, but its not adding the watermark / thumbnail to the productimages.

I did reindex everything, I did delete / flush every single cache (also image cache).

Anyone an idea? Magento 2.1 seems quite unstable..

I would also be happy if someone could explain me how to change the footer links, seems to be a pain in the ass..

THANK YOU


texts: Magento 2 - Update qty & Addresses Button Not updating first item on Ship to Multiple Addresses page in Multishipping

texts:
I am using magento version 2.1.8 and facing issue while multishipping address save.

if you have more item in cart and your in Ship to Multiple Addresses of multishipping page

and then change the address from drop and click update qty & addresses Button

it will update other item address but first item address will be set to first address not which one we selected from address drop-down


texts:
Does anyone know how Magento has implemented this functionality?
What Magento custom mixins plugin is actually is ?


texts: \Magento\Framework\Registry already exists in context object on compile

texts:
when I do compile I do get the following error which is referencing my custom module Blocks, class

        Incorrect dependency in class ...
\Magento\Framework\Registry already exists in context object

my constructor looks like

public function __construct(
    \Magento\Framework\Registry $registry,
    \Magento\Catalog\Block\Product\Context $context,
    \Magento\Framework\Data\Helper\PostHelper $postDataHelper,
    \Magento\Catalog\Model\Layer\Resolver $layerResolver,
    CategoryRepositoryInterface $categoryRepository,
    \Magento\Framework\Url\Helper\Data $urlHelper,
    \Magento\Sales\Model\ResourceModel\Report\Bestsellers\CollectionFactory $collectionFactory,
    \Magento\Reports\Model\ResourceModel\Product\CollectionFactory $productsFactory,
    array $data = []
) {
    $this->_collectionFactory = $collectionFactory;
    $this->_productsFactory = $productsFactory;
    $this->_coreRegistry = $registry;
    parent::__construct(
        $context,
        $postDataHelper,
        $layerResolver,
        $categoryRepository,
        $urlHelper,
        $data
    );
}

what went wrong in this case?


texts: Magento 1.9.4.3 using old database details even though changed in local.xml

texts:
I've created a development copy of one of my Magento sites so I can do a test upgrade on it.

When you try to add something to the cart I get this error message

  SQLSTATE[42000]: Syntax error or access violation: 1142 TRIGGER command denied to user oldusername@localhost'

It gives the old username in the error message but I have changed all these details within app/etc/local.xml

I've cleaned all the cache and turned it off and wiped all session data too but I still get the same error.

Ive done a grep -ir oldusername on the entire Magento file system but cant find any reference to the old details and also searched the database but cant find anything.

Ive also cleared all cookies and cache from my browser and tried on a fresh browser too but get the same error.

Is there anywhere else that the database connection details are stored other than local.xml?


texts:
I am looking for a method to rewrite product images filenames with product name in it.

What I want to achieve is that a product image filename becomes the product name with some index behind. The original pictures are all named like sku, but google doesn't like that as much as the Product name.

So 654984561-15646465.jpg should become my-product-name.jpg

So far I have nothing :/ Since I could not find anything about it in the search.

Thanks for your help!


texts: Reindexing Catalog Product Rule and Catalog Rule Product

texts:
I am stuck for two days because my reindexing does not work by, I tried several things that I found on the net but nothing helps it does not work.
php bin / magento indexer: reset catalogrule_product
php bin / magento indexer: reset catalogrule_product

and
php bin / magento indexer: index catalogrule_product
php bin / magento indexer: index catalogrule_product

which gave me as result this:
Design Config Grid index has been rebuilt successfully in 00:00:00
Customer Grid index has been rebuilt successfully in 00:00:00
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Catalog rule indexing failed. See details in exception log.
Product EAV index has been rebuilt successfully in 00:00:01
Stock index has been rebuilt successfully in 00:00:00
Inventory index has been rebuilt successfully in 00:00:00
Catalog rule indexing failed. See details in exception log.
Product Price index has been rebuilt successfully in 00:00:01
Google Product Removal Feed index has been rebuilt successfully in 00:00:00
Google Product Feed index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:00

Update :
I go see the logs and i find this :
   main.DEBUG: indexer_invalidation: catalog_product_price {"trace":[{"file":"directoryofthesite/vendor/magento/framework/Event/Invoker/InvokerDefault.php","line":88,"function":"execute","class":"Magento\\CloudCom
ponents\\Model\\Observer\\IndexerStateSaveAfter","type":"->"}

and the second problem :
main.DEBUG: indexer_invalidation: catalogsearch_fulltext {"trace":[{"file":"directoryofthesite/vendor/magento/framework/Event/Invoker/InvokerDefault.php","line":88,"function":"execute","class":"Magento\\CloudCo
mponents\\Model\\Observer\\IndexerStateSaveAfter","type":"->"},

What should be done please?
Thank you in advance for your answers


texts: Does MageReport offer any static ip or a range of ips I can whitelist for our dev site?

texts:
I'd like to run these scans on our test/dev sites, but they're currently behind a IP restricted firewall.

Are you able to provide your public IPs so that I can whitelist them for


texts: Magento : Add Additional Tag in Header After Content is Rendered

texts:
I'm trying to add some data in header of page. When I try to do that, I am getting this error.

  Call to a member function getLastPageNumber() on null error

I am using same method for pagination on same page.
Is there any way to append values in header somewhere in code after this function is no more null?


texts: Headless PayPal Integration - Security header is not valid

texts:
I'm attempting to integrate PayPal in a headless Magento environment. This headless environment is interacting with Magento over the Magento REST API. I have another payment system (Authorize.net) that is working. However, I'm getting errors with PayPal.
I'm using the PayPal JavaScript SDK and I'm able to make PayPal transactions directly through JavaScript.

I'm attempting to pass the PayPal confirmation API response back to Magento 2 via the REST API.
POST /rest/default/V1/guest-carts/(customer-quote-id)/payment-information
Body:
{
  "email": "xxxxx@xxxxx.xxxx",
  "paymentMethod": {
    "method": "paypal_express",
    "additional_data": {
        "paypal_express_checkout_token" : "xxxxxxxxxxxxxx",
        "paypal_express_checkout_redirect_required" : false,
        "paypal_express_checkout_payer_id" : "xxxxxxxxxx"
    }
  },
  "billingAddress": {
    "region": "Indiana",
    "region_id": 24,
    "country_id": "US",
    "street": [
      "123"
    ],
    "telephone": "xxxxxxxxxxx",
    "postcode": "xxxxxx",
    "city": "xxxxxxxx",
    "firstname": "xxxxxxxx",
    "lastname": "xxxxxxxx",
    "save_in_address_book": null
  }
}

When I submit the payment, I get the error:
{
    "message": "PayPal gateway has rejected request. Security header is not valid (#10002: Security error)."
}

I have ENABLED Sandbox Mode and DISABLED Enable SSL Verification and I'm getting the same error as above.


texts: How add new item in existing collection in magento 2

texts:
i have 2 collections

1

Orders
0
date    "2019-07-05"
count   "2"
1
date    "2019-06-20"
count   "2"
2
date    "2019-06-18"
count   "2"
3
date    "2019-06-17"
count   "2"
4
date    "2019-06-14"
count   "1"

2

Amount
0
date    "2019-07-05"
sum "6370.00000000"
1
date    "2019-06-20"
sum "6491.00000000"
2
date    "2019-06-18"
sum "4838.00000000"
3
date    "2019-06-17"
sum "4838.00000000"
4
date    "2019-06-14"
sum "1653.00000000"

In both collections looking date is Same . i want to sum index of second collection add in first collection and it make only one collection

how can do this .
i tried $collection->addItem($collection2) it not work


texts: Magento 2 : When I Create an Order on Admin It Show Disabled Products

texts:
When I manually create an order in the backend and go to add a product, it will show all products even those out of stock or status disable, is there a hook for this in Magento 2 to hide those products?

There is for Magento 1, but I haven't found one for Magento 2.


texts: Not able to add permission on category in Magento 2

texts:
I have gone through document and can see that we can add permission to category without any plugin. Link: http://docs.magento.com/m2/ee/user_guide/catalog/category-permissions.html

But I am not able to see Category permission option under:  Admin sidebar > Products > Categories.

Please help me with it.
Thanks!!!


texts: show top menu bar to left side in magento2

texts:
I want to replace the top menu bar to the left side
i have written this code in my theme default.xml

<body>
<referenceContainer name="sidebar.main">
<block class="Magento\Framework\View\Element\Template"
name="store.menu" group="navigation-sections"
template="Magento_Theme::html/container.phtml">
<arguments>
<argument name="title" translate="true"
xsi:type="string">Menu</argument>
</arguments>
</block>
</referenceContainer>
 </body>

but nothing change


texts: New to Magento, Experienced in Wordpress

texts:
I am in talks with the company I work at about starting to sell our products online and being the in house web developer I'm stuck with the decision making. I have done a medium amount of research on the pros and cons of a lot of the popular e-commerce sites and figured I'd just go to the forum with my problem.

I am very experienced in Wordpress and have come to get used to it's dynamic functionality. I have heard that Magento is also a very cusomizable platform and CMS but have never used it. I know I can get the hang of it as I've used a lot of different CMS in the past but how is it for end users? Would it be easy for me to teach my 50-60 year old co workers to use the back-end?

tldr; Are my wordpress skills transferrable to Magento?


texts:
We have too hight resolution images: https://prnt.sc/rsfqy4

and product photos are loading quite slowly. Is there any way to display reduced image quality on the frontend on products list?


texts: Magento 2: Getting a Product URL from the API

texts:
In Magento 2, is is possible to get a product's URL using the information returned via the API/Repositories?

That is, when grabbing a list of products from the API, the url_key will be returned as part of the custom_attribute array.

  8 =>
    array (size=2)
      'attribute_code' => string 'url_key' (length=7)
      'value' => string 'joust-duffle-bag' (length=16)

However, the actual product URL in the system will not be returned.

Is there a way, using only the API, get get a product's actual URL?

Or am I mistaken, and calls to the ProductRepository api method should include the URL.  If so, what should those calls look like?

Or does this question not make sense due to the way Magento 2 handles product URLs?  If so, what's "dumb" about this question?

I realize it's possible, using the provided PHP objects, to use a Magento\Catalog\Model\Product\Url object with an instantiated Magento\Catalog\Model\Product object.  What I'm looking for is an "API only" way to return a product's URL.


texts: magento "Invalid login or password." for frontend customer after some hack

texts:
Initial version: 1.9.0.1

Seems some hack issue suddenly my frontend customers were not able to login with correct password. I did change password from admin for user and tried to login, even that did not worked.

I also changed password in db put md5 value and tried it did not worked too.

Then I updated magento to 1.9.2.4, but still found same issue. I tried reindex, cleared cache.

Can you please tell steps to fix this?


texts: Magento 2 Categories not showing in Admin Product Edit Page

texts: we have a problem with Magento 2.1.14 enterprise where selected categories for any product and category tree is not displaying randomly. IF I refresh the cache , it start showing up again . we are using Fastly cache.


texts:
A couple of months ago I ran a special sale on my two stores' sites. I added info to the category page's header *("Prices have been discounted an additional 25% off now through 8-31-20!
Discounted price reflected in your shopping cart")*to call attention to the additional discount. Once the sale was over I removed the verbiage, but it still shows. I can't figure out why.
https://www.optechusa.com/sidewalk-sale.html
I had made the changes in "all store views" and double checked to see that the individual store views didn't contain the extraneous info.
I'm afraid I'm a complete noob and inherited my responsibilities when our developer moved away.


texts: Not able to sort the column items in grid

texts: I have created a custom grid I am not able to sort the items of a column.(ascending and descending).If i click first time it will sort in ascending order.Second time it will descend the contents.But if i click again same single content will come many times.For example if i have 1 2 3 as ids it will show 1 1 1 3 times.


texts: Magento 2 static deploy en_US argument invalid on XAMPP

texts:
I've cloned a working magento 2 repo, done composer install and when I'm trying do do: setup:static-content:deploy I get the error:

[InvalidArgumentException]
en_US argument has invalid value, please run info:language:list for list of available locales

When I run info:language:list I've got an empty list.

This is happening only on windows with xampp - on other computer with linux/mac everything is working fine.

What could be the problem?

EDIT:
Every new install of magento 2 fails on two computers with win7 and xampp. I've tried wamp but it failed as well. It doesn't matter how magento is installed - though composer, git clone or zip package. Any ideas?


texts: Magento Adding "default" Prefix with Base URL

texts:
I am working on a Magento Website i.e. Website Link. The issue I am facing is when I click on the logo or trying to get the base URL inside the template files the base URL comes with default prefix like http://www.theemergencyboltcompany.com/default . I have tried to figure out the issue inside .htaccess and database. But the default keyword is not defined anywhere.

    I want to know why this default prefix comes with base URL.

Another issue : Website is using MST menupro Extension to manage navigation menu. On the frontend some navigation menu links comes with Default keyword and some are not. The link that comes with default keyword working fine whereas another link shows 404.

Please help me out how do I figure out the issue Or Fix the issue.

Many Thanks in advance.


texts: Change qty input to the counter of the number of products on mini-cart

texts:
How to change qty input to the counter of the number of products.

Expected Result:


texts: Adding frontend global javascript in Magento 2 theme

texts:
I am creating a new theme for Magento 2 to be used inhouse as a basetheme for new projects. I am basing it on "Zurb Foundation for sites" and this boilerplate includes js files what-input.js, jquery.js and foundation.js:

i have created foundation.js as such:

define([
'jquery',
'what-input'
],function($) {
    'use strict';
    $(function() {
        $(document).foundation();
    });
});

And what-input.js also has the same setup with define depending on jquery only. Am i doing this the right way? Will magento recognize what-input.js as a js module and load it when foundation.js is loaded? Also, how do i tell magento to load foundation.js?

These files are in theme_folder/web/js next to responsive.js and theme.js which both loads properly as far as i can tell.

EDIT:

Solved the issue i described in the comment by replacing the JS:

    "*": {
        "Mage2theme/js/foundation": {}
    }

With:

{
    "*": {
        "Mage2theme/js/foundation": {}
    }
}

But another problems arose, it does not copy the foundation.js file to pub/stacic theme folder so i get a 404 when trying to load it.


texts: Do I need to manually close database connections?

texts:
I have a shop (Magento 1.9) with ~40.000 products.
Every night they will be imported/updated via cronjob. There are other cronjobs that do various database operations as well.

In my import script there are also custom database connections (Mage::getSingleton('core/resource')->getConnection('core_write')).

Occasionally when the shop is crowded with visitors the database seems to be blocked with sleeping connections: General error: 1205 Lock wait timeout exceeded.

I was relying upon magento to take care of the connections but it seems I was mistaken.

Now I am not sure if and at what point (after each use? after the script finished?) I should close those connections manually and what the implications are. Is it ok to simply kill all connections from time to time?


texts:
With our migrated M2 shops the custom attributed were migrated.
But now the problem is that we must make a choice between 2 options.

The attribute is in mysql a varchar but then we can't change the value through the shop. When i change it to text we can change it but then it's not used in the filter option on the category page in the shop.

Is there someone who has fixed this problem, because now the option is to make new attributes and fill them all over, but we have 15k+ product so that's not really what we want.

Thanks very much..


texts: Magento 2.3.4: Unable to change category products position

texts:
I try to change the position for category products.
In admin, each position is set but in the frontend, nothing changes. Even after clear/flush cache and reindexing.
Do you know how and in which file makes this change programmatically to get product collection sort by product position set in the category section?
Can you please give me the file name and path and solution were to achieve this issue?
Thank you in advance!!!


texts: CSV Partially Working While Using Products Import

texts: How can i solve CSV partially working error. Single products CSV working instead of 80 products of CSV import. Format good, bulk products import is the error.


texts: Magento 2 Image Gallery pure SQL Manipulation

texts:
I've written an interface for Magento 2 admin that allows creation and editing of key product attributes from a phone.
Once a product is created and it's images attached to the product, I have been looking for a quick way to select from a gallery which is the main image.
For each store view and attribute I found running the following immediate changes the image in the admin panel.
INSERT INTO `catalog_product_entity_varchar` (`attribute_id`, `store_id`, `entity_id`, `value`) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE `value` = ?

I'm entering the correct attribute values for swatch, image, small_image and thumbnail, for all stores the product is present in and adding the filepath accordingly.
The frontend image however, remains unchanged and worse still, the image then doesn't change from the admin panel unless i clear all the cache's and reindex.
I'm not using flat products so I'm a bit stumped as to what could be stopping the image from changing.


texts: How to tackle with multiple time product load in magento?

texts:
I am working in customized site that site have used the product model load within loop multiple times.

$product = Mage::getModel('catalog/product')->load($productId);

Any Quick Fix that I can use with override the load method and keep minimum php resources and make it better for more concurrent users.


texts: Magento 2 : Hide bundle product form catalog

texts:
i have a site with Magento 2.3.3.
My catalog page have filter on the top and then the classic catalog with configurable product and bundle product.
I wanna hide my bundle product from my catalog page and make them visible only when i click on a filter (like color or other attribute).
I try to use "visibility" option inside Magento product page but nothing change.
How can i solve it ?
Thanks


texts: Magento 2 - multiple emails sent only over 3 accounts

texts:
Im not sure if this is a bug inside of 2.2, or 2 in general & or if its just related to myself. Because if this is a bug, then i'll open it in github, but if it means I'm doing something stupid then please let me know.

The issue:

On adding 3 email addresses to the following:

  Admin -> Stores -> Configuration -> Sales -> Sales emails -> Send Order Email Copy To

I'm receiving 2 copies of the New order every time a new order is placed. Obviously this is annoying, but what seems to be strange is, if there is less than 3 inside of the Send Order Email Copy To then only one copy of the New order comes through.

Has anyone else had this issue, or experienced this? Im pretty lost on it. I've checked the email logs on the server and fro some reason its doubled up on everything!

Could it be related to the cron? Could it be related to outside of magento?


texts:
I am working on this file:

app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php

I have products with long names.
For Example product name is:

loonggggg producttttt nameeeee

I want it like this on the Invoice:

longggggg produc...

Can this be done?


texts: How to add placeholder checkout page Filed magento 2

texts: How to add placeholder in checkout page like street address,city,Zip code etc Filed in magento 2.4


texts: Magento 2 - setCustomPrice() does not work after Quote Item Update

texts:
I've been struggling with this issue for the past few weeks now.

My goal is to set a custom price for an item after I edit them on Cart.

Basically, I'm using an observer on the event checkout_cart_update_item_complete, and on that observer I eventually do the following:

$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
$item->getProduct()->setIsSuperMode(true);
$item->save();

Where $item is the new quote item after the update (check Magento\Checkout\Controller\Cart\UpdateItemOptions.php) and $price is my custom price.

After this, the quote item price gets the value of 0, even though the custom_price field on database is actually the value that I wanted.

Any help is appreciated :)


texts: Magento2.3: Cannot add a product to wish-list even after logged in

texts:
I'm facing an issue in adding the product to wish-list. I have logged-in the site but still can't add the product to wish-list.

When checking the admin configuration, I see the wish-list is enabled for the site but its not working.

I'm not sure, where I have to check to resolve this.

Any help will be appreciated!


texts: How to show the custom admin module(. phtml view) under the Magento Menu ribbon

texts:
I am new to Magento, developed my first custom admin module "HelloWorld"
It's working fine but the .phtml page opens in another tab, I want it to open in the same place where other Magento tabs gets open (i.e. under the same ribbon)

Below are the code from the files

config.xml File

<?xml version="1.0"?>
<config>
  <modules>
    <Company_HelloWorld>
     <version>0.1.0</version>
    </Company_HelloWorld>
  </modules>
  <frontend>
    <routers>
      <helloworld>
        <use>standard</use>
        <args>
          <module>Company_HelloWorld</module>
          <frontName>helloworld</frontName>
        </args>
      </helloworld>
    </routers>
  </frontend>
<admin>
  <routers>
    <helloworld>
     <use>admin</use>
     <args>
      <module before="Mage_Adminhtml">Company_HelloWorld</module>
      <frontName>admin_helloworld</frontName>
     </args>
    </helloworld>
  </routers>
</admin>
<global>
  <helpers>
    <helloworld>
      <class>Company_HelloWorld_Helper</class>
    </helloworld>
  </helpers>
  <blocks>
            <helloworld>
                <class>Company_Helloworld_Block</class>
            </helloworld>
        </blocks>
</global>
<adminhtml>
 <menu>
   <helloworld module="helloworld">
     <title>HelloWorld</title>
     <sort_order>100</sort_order>
    <children>
      <helloworld module="helloworld">
        <title>Hello World</title>
        <sort_order>0</sort_order>
        <action>admin_helloworld/adminhtml_index</action>
      </helloworld>
    </children>
   </helloworld>
 </menu>
  <layout>
    <updates>
    <HelloWorld>
        <file>Company_HelloWorld.xml</file>
    </HelloWorld>
    </updates>
</layout>
</adminhtml>
</config>```

```Company_HelloWorld.xml```
```
<?xml version="1.0"?>
<layout>
    <HelloWorld_adminhtml_index_index>
         <reference name="head">
                <action method="setTitle" translate="title">
                    <title>Module</title>
                </action>
            </reference>
         <modules>
           <reference name="content">
            <block type="adminhtml/template" name="Company_HelloWorld" template="HelloWorld/simple_page.phtml" />
        </reference>
    </modules>
     </HelloWorld_adminhtml_index_index>
</layout>


texts: Product review "Submit" button not working

texts:
I installed Yotpo reviews extension and disabled the Magento's default review block from Configuration> Advanced> Disable Modules Output> Mage_Reviews.

Soon after installing it I found a free extension that could help in generating Google Rich Snippets, so I installed it and and installed the other block. I also Enabled the Mage_Reviews block from both the views in Configuration> Current Configuration Scope. Both means from default as well as from Website view.

Later I found that the reviews form button is not working. I mean there is no problem with the form but the Submit button isn't working. Clicking on it does nothing! It's like an empty button with no function command. May I know what is the issue? Can anyone please help me in solving this?

Here is the Code that I'm getting after using "Inspect element" feature in Chrome.


texts: What is the Use of Type and Virtual Types(di.xml) in Magento2?

texts:
I want to know clear about Type and Virtual Types in di.xml with examples. When we can use it.

Please share simple example to understand concept.

Note please go through the practical examples.


texts:
There is an issue encounter while using mass delete functionality at the catalog product. I am using Magento 2.2.2 setup.
Steps to replicate this issue:
- Select multiple products and submit delete action.
- Refresh the product list page open at another browser or another PC with the same or different admin account.
It will delete all the products of your store.
I fell prey two times.

Please help me to avoid this.


texts: Magento 2 How to get layer navigation filters available in rest api?

texts:
Here am trying to get layered navigation available filters
here is my code
 $filterableAttributes = $this->filterableAttributes;
        $layerResolver = $this->layerResolver;

        $filterList = $this->objectmanager->create(
        \Magento\Catalog\Model\Layer\FilterList::class,
            [
                'filterableAttributes' => $filterableAttributes
            ]
        );
        $filtersResponse = array();
        $sortOptionsResponse = array();
        $layer = $layerResolver->get();
        $layer->setCurrentCategory($param['categoryId']);
        $filters = $filterList->getFilters($layer);

        $maxPrice = $layer->getProductCollection()->getMaxPrice();
        $minPrice = $layer->getProductCollection()->getMinPrice();

        $i = 0;
           foreach($filters as $filter)
           {
               //$availablefilter = $filter->getRequestVar(); //Gives the request param name such as 'cat' for Category, 'price' for Price
               $availablefilter = (string)$filter->getName(); //Gives Display Name of the filter such as Category,Price etc.
               $items = $filter->getItems(); //Gives all available filter options in that particular filter
               $filterValues = array();
               $j = 0;
               foreach($items as $item)
               {
                   $filterValues[$j]['display'] = strip_tags($item->getLabel());
                   $filterValues[$j]['value']   = $item->getValue();
                   $filterValues[$j]['count']   = $item->getCount(); //Gives no. of products in each filter options
                   $j++;
               }
               if(!empty($filterValues) && count($filterValues)>1)
               {
                   $filterArray['availablefilter'][$availablefilter] =  $filterValues;
               }
               $i++;
           }

Here am getting only price filter, it should show 4 more attributes, those are enabled for Filter with Results in admin.
Still am not able get all filter.
Where am doing wrong , can I get Help? thank you in advance.


texts:
I'm working on a design which has the minicart always visible (instead of only when you click on the cart image in the header).

How can I get the minicart to always show?


texts:
I am following Alan Storms documentation to add a custom tab to accounts page but unfortunately I am running into a hiccup. I am not able to route and load my controller when I click on my custom link tab within accounts. I can definitely add the custom tab but routing the url once I click on it is not doing anything. Running version 1.9.0.1

  app/code/community/Brandster/CustomAccount/etc/config.xml

<?xml version="1.0"?>
<config>
  <frontend>
    <layout>
      <updates>
        <brandster_customaccount module="Brandster_CustomAccount">
            <file>brandster_customaccount.xml</file>
        </brandster_customaccount>
      </updates>
    </layout>
    <routers>
      <brandster_customaccount>
        <use>standard</use>
        <args>
          <module>Brandster_CustomAccount</module>
          <frontName>brandster_customaccount</frontName>
        </args>
      </brandster_customaccount>
    </routers>
  </frontend>
  <global>
    <helpers>
      <brandster_customaccount>
        <class>Brandster_CustomAccount_Helper</class>
      </brandster_customaccount>
    </helpers>
  </global>
</config>

  app/design/frontend/mytheme/mypackage/layout/brandster_customaccount.xml

<?xml version="1.0"?>
<layout>
  <customer_account>
    <reference name="customer_account_navigation">
      <action method="addLink">
        <name>our_new_section</name>
        <path>brandster_customaccount/index/index</path>
        <label>Terms &amp; Conditions</label>
      </action>
    </reference>
  </customer_account>
  <brandster_customaccount_index_index>
    <update handle="customer_account" />
  </brandster_customaccount_index_index>
</layout>

  app/code/community/Brandster/CustomAccount/Controllers/IndexController.php

<?php
class Brandster_CustomAccount_IndexController extends Mage_Core_Controller_Front_Action {
public function preDispatch()
  {
    parent::preDispatch();
    $action = $this->getRequest()->getActionName();
    $loginUrl = Mage::helper('customer')->getLoginUrl();

    if (!Mage::getSingleton('customer/session')->authenticate($this, $loginUrl)) {
      $this->setFlag('', self::FLAG_NO_DISPATCH, true);
    }
  }
}

  app/code/community/Brandster/CustomAccount/Helper/Data.php

<?php
class Brandster_CustomAccount_Helper_Data extends Mage_Core_Helper_Abstract
{

}


texts:
Having an issue with UK PayPal Hosted. To start, this is not an issue processing payments normally. As long as a customer completes the checkout, including paying either with a credit card or PP account, everything is fine.

The issue is when a customer confirms the order at the checkout review step, but then fails to complete the order by actually paying, either with a credit card or PP account. In that case, an order is created with a status of Payment Pending. The order shows up in the backend but not on the client dashboard (which is it seems is default for Magento).

The problem is that these orders cannot be progressed. The only way to move forward is with the Invoicing system. With orders using an online payment method there are three options when creating an invoice:

Capture Online: fails - this is to be expected as no attempt was made to actually make the payment at PP so the payment fields on the order are all blank, hence nothing to capture from PP.

Capture Offline: fails - it generates an invoice which has a status of PAID, but the order itself remains Payment Pending and there's no way to change the order status itself to PAID. Creating a Credit Memo for the "paid" invoice sets the order status to Closed so it's now a dead order.

Not Capture: fails - the behaviour here is plain bizarre! It generates an invoice with a status of Pending and the order remains Pending Payment. Only option then is to hit the Capture button on the invoice, which of course fails. Then if you hit Cancel or back on the invoice screen, it bizarrely sets the order status to PAID (total paid remains 0.00), generates an admin order email (extension) but from the default store and not the store the order was placed on, but no order confirmation is send to the customer.

So in this scenario, it seems the only thing the store owner can do is cancel the order because there's no way to progress it to the next step.

Capture Offline would seems to be the most sensible option here as it generated a paid invoice, but does anyone know how to fix Magento so using this option sets the Order Status to PAID as well, completing the order process i.e. sending confirmation email to customer.

Another option would be to change the payment method on the order to an "offline" method, but there's no means I can see for an admin to do this on orders.


texts: Magento 2 Custom GET REST API ready store code from url

texts:
I have a custom REST API url:

<route url="/V1/vendor/module/id/:Id" method="GET">
        <service class="Vendor\Module\Api\ModuleRepositoryInterface" method="get"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>

my get method the same as Magento/Catalog : CategoryRepository

GET URL: ...rest/en_gb/V1/vendor/module/id/1

public function get($id, $storeId = null )
    {
        print_r($id);//OK This prints id = 1
        print_r($storeId);die; //NOT printing `en_gb` or store id
        $cacheKey = $storeId ?? 'all';
        if (!isset($this->instances[$categoryId][$cacheKey])) {
            /** @var Category $category */
            $category = $this->categoryFactory->create();
            if (null !== $storeId) {
                $category->setStoreId($storeId);
            }
            $category->load($categoryId);
            if (!$category->getId()) {
                throw NoSuchEntityException::singleField('id', $categoryId);
            }
            $this->instances[$categoryId][$cacheKey] = $category;
        }
        return $this->instances[$categoryId][$cacheKey];
    }

This ?storeId=1 works but it's not as is called in API Native Magento Module/Catalog:

Any Ideas Anyone? Appreciated!


texts: Add to wishlist button not redirecting to login page while not logged in

texts:
I have used "Magento ver. 1.9.2.1" in my website.

On product list and view page wishlist button working while customer logged in but if any customer not logged in then on click wishlist button it is not redirecting me to login page and showing error in log as shown in below figure :

I have checked it more than three PC but same issue occur.

Is there any setting in magento to remove this error and redirect to login page?


texts: what should be the module name while adding menu in adminhtml

texts:
I've created a module which I named it in CamelCase like MyCustomModule. I've just started it as a little application and wanted to add a menu in admin for that the adminhtml.xml code is

<menu>
    <sales>
        <children>
            <my_custom_module>
                <title>My Custom Module</title>
                <sort_order>0</sort_order>
                <action>my_custom_module/adminhtml_order</action>
            </my_custom_module>
        </children>
    </sales>
</menu>

This is working fine. But as I see in other xmls they have an attribute module maybe for translation purpose like

<my_custom_module module="[module_name]">
    <title>My Custom Module</title>
    <sort_order>0</sort_order>
    <action>my_custom_module/adminhtml_order</action>
</my_custom_module>

for this I've replaced [module_name] with my_custom_module, myCustomModule, mycustommodule and Company_MyCustomModule but none of them work, even the page stops loading due to error. so my question is what could be the possible [module_name] to be passed here?

In case you may be asking for it

<admin>
    <routers>
        <my_custom_module>
            <use>admin</use>
            <args>
                <module>Company_MyCustomModule</module>
                <frontName>my_custom_module</frontName>
            </args>
        </my_custom_module>
    </routers>
</admin>


texts: Magento 2.3 ElasticSearch shows item in dropdown, but not in search

texts:
I'm currently working on a Magento 2.3 store. We have a weird issue with ElasticSearch.

Most of the time, when i search for an SKU, we get normal results. But sometimes, it shows in the search bar dropdown that it has found one product, but when pressing enter, the product doesnt show.

Also, it's very inconsistent. After running indexer, some products are searchable again, but products that could be found in the first place, are not searchable anymore.

Anyone an idea what this could be?

Entering product SKU in searchbar. Dropdown showing 1 result:

After pressing Enter showing no products found, but the filter on the left still shows 1 product.

Using:
Magento 2.3.1
ElasticSearch 5.2
Smile_Elasticsuite module 2.8.1


texts:
I have searched in Magento 2 developer documentation and also googled about the new Magento 2 GET URL method but haven't found something clear that explain how to get url path in new platform.

So I open up this post to complete with your help the missing commands and help also other user searching for the same argument.

The Magento 1 Platform

GET PRODUCT URL
<?php echo $this->helper('catalog/product')->getProductUrl($_product); ?>

GET ATTRIBUTE
<?php echo $_product->getData('manufacturer'); ?>
<?php echo $_product->getSku(); ?>

GET PRODUCT NAME
<?php echo $_product->getName(); ?>

GET DESCRIPTION
<?php echo strip_tags($_product->getDescription()); ?>

GET KEYWORDS
<?php echo htmlspecialchars($this->getKeywords()) ?>

GET PRODUCT IMAGE
<?php echo $this->helper('catalog/image')->init($_product, 'image')->resize(300, 300); ?>

The Magento 2 Platform

GET BASE URL
This is the only reference I have found
<?php echo $block->getBaseUrl(); ?>

if I try all other Magento 1 parameters to get the URL/ATTRIBUTE/NAME etc. Magento 2 crash.


texts: How we can get the customer id from the customer context

texts:
I need to know is there a way to get the customer id from the customer context

$loginObjectManager= \Magento\Framework\App\ObjectManager::getInstance();
$httpContext = $loginObjectManager->get('Magento\Framework\App\Http\Context');
$isLoggedIn = $httpContext ->getValue(\Magento\Customer\Model\Context::CONTEXT_AUTH);

The above code is to check if the user is login. I tried getting it with session as well but it returns null 'Magento\Customer\Model\Session'


texts:
I want to setup new extension with composer on magento2 and I get this error:

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

I use public key and private key as user and password ( get key from marketplace.magento.com )

I use this comment for install new extension:

composer require mageplaza/composer require mageplaza/magento-2-seo-extension


texts: How use in Magento2 inline translations with chosen locale in code? How select locale for inline translations in Magento2?

texts:
We need to have ability in code use inline translations with translated strings from csv files with selected locale, which is different from store. For example, user select english language in frontend, but we want to create PDF or rend email with de_DE translations.
We want to get something like this (not correct this code)

> setLocale('de_DE');
> __('Good morning');

  // Guten Morgen

thanks


texts: Theme not displaying correctly on any page but the homepage.

texts:
I am on Magento 2.2.5 and have been working on it for a few months. I wanted to remove some links on the customer account page so I added-

<referenceBlock name="customer-account-navigation-customer-balance-link" remove="true"/>

To my default.xml. After running static content deploy and flushing the cache I came back and the only page that looked correct was the homepage. Everything else had the Luma theme, which is my parent theme. I immediately reverted the change but the issue is still there.

When I looked at the source code I noted the var require in the header was different. On the homepage which is correct it says-

var require = {
        "baseUrl": "http://example.com/static/version1536251682/frontend/name/name/en_US"
    };
On every other page it says-

var require = {
        "baseUrl": "http://example.com/static/version1536251682/frontend/Magento/luma/en_US"
    };

Why would these be different? How can I make them the same?


texts: Is it best practice for a Block function to call a ResourceModel function?

texts:
Is it appropriate for a Block class to retrieve data through a function in a ResourceModel class, rather than a Model class?
Or should the Block call the Model which then passes the call to the ResourceModel?

Going direct from Block to ResourceModel is simplest and avoids duplication of possible quite a few functions, but would you consider it to be bad form, breaking best practice patterns?


texts: Need event to update quote item while creating an order from admin

texts: Can someone tell me an event for updating quote items while creating an order from admin?


texts: Magento Data Migrate tool error "Attribute vat_id does not exist in the type customer_address"

texts:
I'm trying to migrate Magento 1.8.1.0 to 2.1.6. when i run data migration, i get the following error:

  [2017-04-22 20:28:55][INFO][mode: data][stage: integrity check][step: Data Integrity Step]: started
  [2017-04-22 20:28:56][INFO][mode: data][stage: integrity check][step: EAV Step]: started
  [2017-04-22 20:28:56][INFO][mode: data][stage: integrity check][step: Customer Attributes Step]: started
  [2017-04-22 20:28:56][ERROR]: Attribute vat_id does not exist in the type customer_address
  [2017-04-22 20:28:56][INFO][mode: data][stage: integrity check][step: Map Step]: started
  [2017-04-22 20:28:58][INFO][mode: data][stage: integrity check][step: Url Rewrite Step]: started
  [2017-04-22 20:28:58][INFO][mode: data][stage: integrity check][step: Log Step]: started
  [2017-04-22 20:28:58][INFO][mode: data][stage: integrity check][step: Ratings Step]: started
  [2017-04-22 20:28:58][INFO][mode: data][stage: integrity check][step: ConfigurablePrices step]: started
  [2017-04-22 20:28:58][INFO][mode: data][stage: integrity check][step: OrderGrids Step]: started
  [2017-04-22 20:28:58][INFO][mode: data][stage: integrity check][step: Tier Price Step]: started
  [2017-04-22 20:28:58][INFO][mode: data][stage: integrity check][step: SalesIncrement Step]: started

i already found this post and found that i already have vat_id in eav_attribute table!!


texts: Magento 2 website is not running in local after moving from host. System getting hanged when running the website

texts:
We are using Magento 2 for our website. We have used Bluehost with 2GB RAM, 5TB Memory. Bluehost called me yesterday to change the server because of the huge bandwith. We have currently 1000 products in our website. And we need to add 5000 products in future. Server team told us to check the website for taking huge bandwidth. We planned to check the website in local system(Ubuntu 17.10 8GB RAM, 1TB Memory).

Allocated memory size was exhausted when we run website in local system(Ubuntu 17.10). We changed the memory_limit, phpuploadsize, postmaxsize to -1. But this time system getting hanged when we run website and execute any magento ssh commands reindex, cache flush, clean commands.

What is the main reason for this cause? How do i check it?


texts: Magento 2 Import images for SKUs from external resource

texts:
I am importing images from third party url and following Magento 2 guideline

But It is throwing errors for some rows but others are imported successfully while I can access images for particular error row directly.


texts: M2 REST API: Creating shipment with products from MSI source

texts:
I am using MSI.

When trying to create a shipment with a source code, the shipment uses the "default source" instead of the one I'm providing.

My Request:
[POST] /rest/default/V1/order/5/ship

{
    "items": [
        {
            "order_item_id": 14,
            "qty": 1
        }
    ],
    "extension_attributes" : {
        "source_code" : "3"
    }
}

I've used this documentation to create my request:
https://devdocs.magento.com/swagger/index_23.html#/salesShipmentRepositoryV1/salesShipmentRepositoryV1SavePost

The source "3" has sufficient stock, so this shouldn't be the issue

When "default source" has stock, the shipment is created uses stock from "default source"
When "default source" has no stock, I get the following: Shipment Document Validation Error(s):\nThe order does not allow a shipment to be created.\nYou can't create a shipment without products.

So it definitely tries to use the default source, which is what I don't want.

My question:
How can I tell Magento to use my source code? Do I need to provide the source code in a different way?


texts: Magento 2 - How to override magento 2 hash ?

texts: I'm currently migration from woocommerce to magento 2, the problem is magento and wordpress have different hash engine. there's a way to override magento 2 hash without edit magento core file directly, thank you ..


texts:
while accessing https://website-url/swagger got error as
500 : {"message":"Internal Error. Details are available in Magento log file. Report ID: webapi-5f33c4d0d4891"} https://website-url/rest/all/schema?services=all
Then I checked into exception log
[2020-08-11 11:20:13] main.CRITICAL: Report ID: webapi-5f327eeda2f5a; Message: Class "decimal" does not exist. Please note that namespace must be specified. {"exception":"[object] (Exception(code: 0): Report ID: webapi-5f327eeda2f5a; Message: Class "decimal" does not exist. Please note that namespace must be specified. at /var/www/html/website/vendor/magento/framework/Webapi/ErrorProcessor.php:205, LogicException(code: 0): Class "decimal" does not exist. Please note that namespace must be specified. at /var/www/html/website/vendor/magento/framework/Reflection/TypeProcessor.php:139)"} []


texts: Upgrade Magento 1.7.2 to 1.8.1 via Magento Connect

texts:
I was reading the upgrade guide - but had the idea to try the upgrade via Magento connect. THis has always worked before ;P

http://www.magentocommerce.com/knowledge-base/entry/ce18-upgrade-roadmap

Is there a real reason why we should not upgrade via Magento Connect in backend?


texts: how ko.observable declaration in magento 2 works without mentioning it in any variable?

texts:
In Knockout we make the variable to be observable like var a=ko.observable(); but in Magento 2 without mentioning ko.observable() the variable acts as an observable variable.

This is customer.js file and its path is

  vendor/magento/module-customer/view/frontend/web/js/view/customer.js

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

    return Component.extend({
        /** @inheritdoc */
        initialize: function () {
            this._super();
            this.customer = customerData.get('customer');
        }
    });
});

This is header.phtml file and it's path is

  vendor/magento/module-theme/view/frontend/templates/html/header.phtml

        <span class="logged-in"
              data-bind="text: new String('<?= $block->escapeHtml(__('Welcome, %1!', '%1')) ?>').replace('%1', customer().fullname)">

        <span class="not-logged-in"
              data-bind='html:"<?= $block->escapeHtml($welcomeMessage) ?>"'>
        <?= $block->getBlockHtml('header.additional') ?>

Question : How this.customer variable from js file becomes ko.observable and acts in phtml file as customer() in ?


texts: Overwrite of Fooman EmailAttachments works about 50%

texts:
I'm using Fooman's EmailAttachments extension on Magento CE 1.9.2.4 - or I try to.
This is my config.xml:

<?xml version="1.0" encoding="UTF-8"?> <config>
    <modules>
        <NewName_EmailAttachments>
            <version>1.0</version>
        </NewName_EmailAttachments>
    </modules>
    <global>
        <models>
            <emailattachments>
                <rewrite>
                    <order_pdf_order>NewName_EmailAttachments_Model_Order_Pdf_Order</order_pdf_order>
                    <order_pdf_bundleitems>NewName_EmailAttachments_Model_Order_Pdf_BundleItems</order_pdf_bundleitems>
                 </rewrite>
            </emailattachments>
        </models>
    </global>
    <stores>
        <admin>
            <design>
                <theme>
                    <default>Newdefault</default>
                </theme>
            </design>
        </admin>
    </stores> </config>

As you can see I also tried to make it use a custom admin backend design so I can use my own translation files. This worked for other classes I made overwrites. Any ideas why not here?

This is the module's config:

<?xml version="1.0" encoding="UTF-8"?>
<config>
  <modules>
    <NewName_EmailAttachments>
             <active>true</active>
             <codePool>local</codePool>
             <depends>
                <Fooman_EmailAttachments />
            </depends>
    </NewName_EmailAttachments>
  </modules>
</config>

The really interesting now is that the overwrite of Order_Pdf_Order works but the overwrite of Order_Pdf_BundleItems doesn't. Magento still takes the core class where the Fooman overwrite points to. How can I change that? Is there something more to do?
To make it complete, here are the class definitions of the override files:

class NewName_EmailAttachments_Model_Order_Pdf_Order extends Fooman_EmailAttachments_Model_Order_Pdf_Order
{
...

and

class NewName_EmailAttachments_Model_Order_Pdf_BundleItems extends Fooman_EmailAttachments_Model_Order_Pdf_BundleItems
{
...

Thanks for your help!


texts: Not showing images of Instagram in Approved Instagram Images tab in Magento1.9

texts: It has been set with "Client ID" and "Client Secret" and also "Redirect URI" in magento1.9 admin by registering API form in Instagram. After then it is be authenticated by clicking "Auth on Instagram" button from Admin->Configuration. It has been successfully authenticated. But it is not showing the images in Admin->Instagram->Approved Images page and also in product and also in Category page. I have set all things in Magento admin panel. I can't understand where I am wrong. And but, another thing is that in Instagram account page, it shows an warning message like "You have not authorized any applications to access your Instagram account."


texts:
Hi I am new to magento2 and learning currently the basics.

I have an module and set up some system configuration for it but the checkbox Use system value is not showing up next to the field. I have setup a default value for it in config.xml. I am using magento-ce 2.2.5

Expected:

Actual:

Here is my system.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
   <tab id="mastering" translate="label" sortOrder="10000">
        Mastering
    </tab>

        Mastering
        <tab>mastering</tab>
        <resource>Mastering_SampleModule::mastering</resource>
        <group id="general" translate="label" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
            Item creation by schedule
            <field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                Enabled
                <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            </field>
            <field id="cron_expression" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
                Add Item Cron Expression
            </field>
        </group>

</system>

My config.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
    <mastering>
        <general>
            <enabled>0</enabled>
            <cron_expression>* * * * *</cron_expression>
        </general>
    </mastering>
</default>


texts: CSS stylesheet order acting inconsistently

texts:
I have my standard styles-m and styles-l stylesheets. I also have a custom.css stylesheet that loads later than those 2.
On both staging and production everything loads in that order, but in development, styles.css loads later than the other 2.
As a result, I often don't end up with consistent results between dev and production. How can I make things load in the correct order in development?
Thanks


texts:
Can you help me with next problem: when i try make reindex via SSH i get error:  then i try via admin panel make reindex Product price and also get error: There was a problem with reindexing process. And all, half of the products I just do not see and do not see the newly added products

I use magento 1.7.0.2, how i can solve problem?

Thanks


texts: Changes to template files not updating in newly created storeview

texts:
I am trying to add a second StoreView that uses its own theme and is accessible by a custom URL. For some reason however, I can not get changes to the template files to display in the frontend.

This is what I have done:

I added this to my nginx directives:

if ($http_host ~ "(www\.)?domain1\.com") {
        set $MAGE_RUN_CODE "StoreView1";
        set $MAGE_RUN_TYPE "store";
}
if ($http_host ~ "(www\.)?domain2\.com") {
        set $MAGE_RUN_CODE "StoreView2";
        set $MAGE_RUN_TYPE "store";
}

I then created a new root category in category management. Within store management I added a new store and storeview to the base website. I assigned my newly created root category to my new Store. Within the web tab, I added a custom URL for the new storeview.

Within the design configuration I set everything back to default for the standard configuration, then selected my old storeview to assign my old theme and then the newly created storeview to add my new theme.

I set my old theme as fallback for the new one in theme.xml.

At first everything seemed to be working great but I soon realized that none of the changes to any of the template files in my new theme are shown in the frontend while changes to my old theme will update after flushing my
fpc. I tried disabling all caches and my fpc, flushed redis, restarted php fpm - to no avail.

I checked via template path hints and the correct files from my new theme are being loaded. If I delete one of these template files used by my new theme, that part of the theme will correctly fall back to my first theme. So while a missing file is being recognized, an update to that same file has no effect - how can this be?

I also tried creating a new website instead of just a store but ended up with the same results.

EDIT: I just assigned my old theme to my new storeview, edited a template file of that theme, flushed my cache and opened up both the old store and the new one only to find out that the old store is using the updated template file while no change is present in my new store.


texts: Getting Fatal Error upon setting up new webshop

texts:
I am currently working a project where I am setting up a new webshop, I am still relatively new but have had success in the past, this time, after transferring all files to the new FTP server and having the backend in good conditions for transfer, such as compiler off / caches disabled etc.

I get the following error immidiately upon saving something once I try to save my back-end, in system -> config :/

Fatal error: Class 'Mage_Catalog_Model_Convert_Adapter_Product' not found in /data/sportnor/public_html/multifitness.dk/app/code/core/Mage/Core/Model/Config.php on line 1350"

I thought I messed up the file transfer and broke some files in the process, so I did it over again.. with no success.

EDIT:

    public function getModelInstance($modelClass='', $constructArguments=array())
{
    $className = $this->getModelClassName($modelClass);
    if (class_exists($className)) {
        Varien_Profiler::start('CORE::create_object_of::'.$className);
        $obj = new $className($constructArguments);
        Varien_Profiler::stop('CORE::create_object_of::'.$className);
        return $obj;
    } else {
        /* throw Mage::exception(
            'Mage_Core',
            Mage::helper('core')->__('Model class does not exist: %s.', $modelClass)
        ); */
        return false;
    }
}

public function getNodeClassInstance($path)
{
    $config = Mage::getConfig()->getNode($path);
    if (!$config) {
        return false;
    } else {
        $className = $config->getClassName();
        return new $className();
    }
}

codesnippet taken from line 1345 to 1371 from config.php

Regards


texts:
We need to import a lot of products from different vendors (about 30000 products). For some products the thumbnails are not generated in the front end.

I tried clearing the cache, clearing static content, running deploy, reindexing, reimporting, everything.

Any ideas why this is happening?

Running Magento 2.3.1