texts: Get Product attribute value using getAllVisibleItems() in magento 2.3.2

texts:
I am building one pdf, which will have order details.
I want to print item ordered along with its custom attributes.
I have been using getAllVisibleItems() to loop through items ordered. Below is my code.
How can i get custom attributes value here, like color, size, length etc.
  $items = $order->getAllVisibleItems();
    foreach($items as $item) {
                $productid = $item->getProductId();
         $productcollection = $this->productCollectionFactory-
        >create();
         $productcollection->addFieldToSelect('color');
         $productcollection->addIdFilter($productid);
         $product = $productcollection->getItemById($item-
       >getProductId());

        $color = $product->getData('color'); // this is a value id
        $colorLabel = $this->productHelper->productAttribute($product,
      $color, 'color');
        $logger->info($colorLabel);
               }

Please help.
How can i get color attribute value here.


texts: order confirmation email is not sent for guest's order only Magento 2.1

texts:
In the backend shows (The order confirmation email is not sent), if i clicked on send email it sends the message.

and if the customer logged in working fine.

Configuration

Sales -> Sales Emails -> General Settings -> Asynchronous sending is Disable


texts: Magento equivalent of ALTER IGNORE TABLE?

texts:
I am writing a setup script that adds a unique index to an existing table, but I don't bother iterating through the whole dataset.

Is there a way to specify an IGNORE keyword when I call addIndex()?


texts:
Can somebody help me implemented this script? Any advice is appreciated. Thank You.

For product page:

     <script>
    !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '<FB_PIXEL_ID>');
fbq('track', 'PageView');
fbq('track', 'ViewContent', {
        content_type: 'product',
        content_ids: ['1234'],
        content_name: 'ABC Leather Sandal',
        content_category: 'Shoes',
        value: 0.50,
        currency: 'USD'
    });
    </script>


texts: Magento 1 - Quotation and CRM Extensions

texts:
I'm looking for recommendations for Magento 1 Quotation extensions.

If you have purchased & experienced such an extension, I'd love to hear about it.

I'm also looking into CRM extensions or extensions that integrate with stand alone CRM packages.

Again, any personal experience sharing would be very beneficial to me.

We currently use Sage for our accounting.


texts: Can anyone share Bundle product import sheet?

texts:
I want to import bundle products through import sheet (csv), but it's getting me error. Infact i export the product and import, but it still showing error and not importing.

Can anyone share me tested bundle product import sheet sample?


texts: Magento 2 - Get simple product attributes on Grouped product detailpage

texts:
I'm trying to get the attributes values of the simple products in a grouped product to display on the detailpage (of the grouped product), but it is not working.

At the moment i have the following code in Magento_GroupedProduct/templates/product/view/type/grouped.phtml.

<?php foreach ($_associatedProducts as $_item): ?>
  <?php $item = $objectManager->get('Magento\Catalog\Model\Product')->load($_item->getId());
    $item->getResource()->getAttribute('attribute_code')->getFrontend()->getValue($item) .' <br />';

I'm getting the value of the attribute now, but it looks like it's not "resetting" the value. I have 3 simple products where only 2 of them have a value for the attribute set in the admin backend. Nevertheless does the third product has the attribute value of the second one.

I hope anyone could help me to fix this problem (and maybe with better code then the objectManager). Thanks in advance


texts: Saving label values in Attribute, moves label values to other website views

texts:
When I try to save the labels within a attribute, it moves the values. From Storeview C to Storeview B.

I've added 2 images to make it more clear.

This is how the values are filled in by me, and before clicking save

This is what happens after I hit save, some values disappeared.. and some are moved. Storeview A remains intact, but all other are moved to another position or deleted.

Does maybe anyone knows what can be the problem? And which core file in handling the saving of these attributes?


texts:
How to customise the magento2 checkout shipping VAT field only
I need to add class,id and keyup funcnctionality to the checkout shipping VAT field


texts: Magento Marketplace Extensions VS Other Extensions

texts:
A member of the Magento Team told me to prefer to use the Marketplace Extensions (I know about the audit process) than the other third-party extensions (e.g. from Github or aleatory module store).

Can you explain me listing the pros vs cons of each one using a technical overview?

Magento Marketplace Extensions X Other Extensions

Thanks


texts:
I am looking for a solution to resize a content image, coming from media/wysiwyg/ within the output template of a widget.

Is there anything or have the content editors to do that by photoshop?


texts: Unknown column 'price_index.min_price' when i search for some product

texts:
When I make some search on my store for some product I keep getting this error:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column
  'price_index.min_price' in 'field list', query was: SELECT
  FLOOR(((price_index.min_price +(e.min_price*CASE e.tax_class_id WHEN 4
  THEN       0.2300 WHEN 5 THEN       0.2300  ELSE 0 END)) * 1) / 10) +
  1 AS `range`, COUNT(*) AS `count` FROM `catalog_product_index_price`
  AS `e`  INNER JOIN `catalogsearch_result` AS `search_result` ON
  search_result.product_id=e.entity_id AND search_result.query_id='33'
  INNER JOIN `catalog_category_product_index` AS `cat_index` ON
  cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND
  cat_index.visibility IN(3, 4) AND cat_index.category_id = '3' WHERE (
  e.website_id = '1' ) AND ( e.customer_group_id = 0) AND ((e.min_price
  +(e.min_price*CASE e.tax_class_id WHEN 4 THEN       0.2300 WHEN 5 THEN       0.2300  ELSE 0 END)) IS NOT NULL) GROUP BY `range`

Before was working, I didn't upgrade anything... In database I searched for the  table name "price_index" and I didn't found it, but I guess that the query is made internally so I can't fix it... I already was checking the file Price.php but I can't find any solution to fix this...

  app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php

Any Solution?

Edit: Already reindex all things and still the same...

Edit2: Is the problem from the database or from the magento code?


texts: Magento2 not reading my requirejs-config.js

texts:
Hi I'm new to Magento2 and trying to figure out how RequireJS works in Magento.

Here is my situation:

I have following module:

app/code/Mymodule/Test/view/frontend/requirejs-config.js

Here is the content of this file:

var config = {
map: {
    '*': {
        jQuery110: "Mymodule_Test/js/jquery-1.10.2",
        jqueryNoConflict: 'Mymodule_Test/js/jquery.no-conflict',
        flexslider: 'Mymodule_Test/js/jquery.flexslider-min',
        header: 'Mymodule_Test/js/store/header'
    }
}
};

My theme is at this location:

app/design/frontend/Mycompany/Basic

My Javascripts are at following location:

app/code/Mymodule/Test/view/frontend/web/js/jquery.no-conflict.js
app/code/Mymodule/Test/view/frontend/web/js/jquery.flexslider-min.js
app/code/Mymodule/Test/view/frontend/web/js/store/header.js

In the PHTML file:

app/code/Mymodule/Test/view/frontend/templates/home.phtml

I added the lines:

require(['jqueryNoConflict', 'flexslider'],function($, flexslider){
    (function($) {
        $(window).load(function () {
            $('.flexslider').flexslider();
        });
    })(jQuery);
});

When I check my page in browser, I get 404 error with paths:

http://mag2.com.local/pub/static/frontend/Mycompany/Basic/en_US/flexslider.js

But if I change the require[] line to this:

 require(['Mymodule_Test/js/jquery.no-conflict', 'Mymodule_Test/js/jquery.flexslider-min'],function($, flexslider){
        (function() {
            $(window).load(function () {
                $('.flexslider').flexslider();
            });
        })(jQuery);
    });

the files are loading.

I also cleared the cache, my theme is correct, I executed the command:

php bin/magento setup:static-content:deploy

So, I am not able to figure out why my requirejs-config.js is not loading. I followed the documentation as well.

Please help


texts: How to set up second store in multi-domain configuration?

texts:
I am trying to set up a second store based on a single magento installation. I have created the website, store, and store view as indicated in http://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup

But when I visit my second store (using its own URL), I end up on the home page of my first store.

I have modified the .htaccess and httpd.conf, cleared the cache and restarted apache, as advised in the tutorial

Can you help me please ?

EDIT:

My changes to .htaccess:

SetEnvIf Host www\.broum-utilitaires\.com MAGE_RUN_CODE=broum_utilitaires
SetEnvIf Host www\.broum-utilitaires\.com MAGE_RUN_TYPE=website
SetEnvIf Host ^broum-utilitaires\.com MAGE_RUN_CODE=broum_utilitaires
SetEnvIf Host ^broum-utilitaires\.com MAGE_RUN_TYPE=website

SetEnvIf Host www\.broum-utilitaire\.fr MAGE_RUN_CODE=broum_vintage
SetEnvIf Host www\.broum-utilitaire\.fr MAGE_RUN_TYPE=website
SetEnvIf Host ^broum-utilitaire\.fr MAGE_RUN_CODE=broum_vintage
SetEnvIf Host ^broum-utilitaire\.fr MAGE_RUN_TYPE=website

My httpd.conf

<VirtualHost *:80>
    ServerAdmin contact@broum-utilitaires.com
    ServerName broum-utilitaires.com
    DocumentRoot /var/www/broum
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin contact@broum-utilitaire.fr
    ServerName broum-utilitaire.fr
    DocumentRoot /var/www/broum
</VirtualHost>


texts:
I am working on my custom module where I added a button on Configurable products. The Content I was showing through button was by getting the Parent Category ID.

The main issue I am facing is that when I open a product by going through the path(mean Men>Tops>Jackets) it works. But When I directly open the product from HOME PAGE it gives me the error.

In my Block file, I am using these functions

public function getCurrentCategory()
    {

            return $this->_registry->registry('current_category');
    }

     public function getCurrentProduct()
    {

        return $this->_registry->registry('current_product');
    }

    public function getCollection($id){
        return $this->_Collection->create()
                                ->addFieldToSelect('content')
                                ->addFieldToFilter('parent_category',$id)
                                ->getData();
    }

    public function getDisplay($id){
        return $this->_Collection->create()
                                ->addFieldToSelect('display')
                                ->addFieldToFilter('parent_category',$id)
                                ->getData();
    }

For my phtml file, I am using

$cat = $block->getCurrentProduct()->getCategory();

    if($block->getCurrentProduct())

    {
         foreach ($cat->getParentCategories() as $parent) {
            if($cat)
            {
            $parentId[]= $parent->getId();
        }}

        $sizeColl = $block->getDisplay($parentId[0]);
        if($sizeColl){
            $block->getCurrentCategory()->getId();
            $display = $sizeColl[0]['display'];

            if($display == 'page'):
                $Charts=$block->getCollection($parentId[0]);
                        foreach ($Charts as $chart) {
                            echo $chart['content'];
                        }

            else: ?>

Can Anyone help me out with this or suggest me with a better option. Because I need to target Main Parent Category to do my work. Thanks in advance


texts: How to disable free shipping based on custom product attributes?

texts:
I want to disable free shipping...if I select a product with some custom attribute...is there any way to achieve this.
Thanks in advance.


texts:
I have created a small extension in Magento 1.9 latest which gives me the ability to insert text for SEO purposes on every category page.
I have made this in frontend hidden with CSS.
But as I read Google isn't reading this "hidden" content and sometimes sees this as spam.

What is the best way to use this text in the right way?

Any suggestions?


texts:
I created a custom module to fetch data from an external API and I would like to display it on the frontend.

I put my curl function in Helper\Data.php - Is it the best place to put it?

I called Helper\Data in my Block\Display.php but in the templates\display.phtml. It will show as blank.

Thank you in advance.

Block File:- Block\Display.php

  <?php

namespace NzPost\AddressFinder\Block;

class Display extends \Magento\Framework\View\Element\Template
{
    /**
     * @var \NzPost\AddressFinder\Helper\Data
     */
    private $helperData;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \NzPost\AddressFinder\Helper\Data $helperData
    )
    {
        $this->helperData = $helperData;
        parent::__construct($context);
    }

    public function sayHello()
    {
        $client_id = $this->helperData->getGeneralConfig('client_id');
        $client_secret = $this->helperData->getGeneralConfig('client_secret');
        $result = $this->helperData->getCurl($client_id, $client_secret);
        return __($result);
    }
}

Template File:-display.phtml

    <?php
echo $this->sayHello();


texts: table rates for italy / rest of the world

texts:
I need a little help.

I ve to set shipping rates for a magento store:

10€ for Italy
20€ for the rest of the world

Simple as that, no matter on weight or other shipping parameters. Anyone can help me?..I think I ve to set up a simple CSV file..

Thanks in advance

M :)


texts:
Recently I made my Magento 2.3.1 website live and set mode as "production". Now If I try to run php bin/magento setup:di:compile then it starts showing error

An error has happened during application run. See exception log for details.

In order to protect this I need to set Maintenance mode and website goes offline. Is it anyway by which we can run php bin/magento setup:di:compile and  website will not show error.

Same thing happens during php bin/magento setup:upgrade. It distorted the page layout.


texts: Declaring layout explanation Magento 1.9

texts:
I need someone who explains something to me in the layout that I didn't understand.

I know that when I create some layout.xml I declare it like:
for exemple:

<custom_account_login> //layout handle <router_nameController_methodAction>
    <reference name="content"> //content block when i display my block
        <block type="core/template" name="name.block" template="custom/cus.phtml"> // the template path of my file
    </reference>
</custom_account_login>

Right? but in this one i didn't understand what he do

<?xml version="1.0"?>
<layout>
    <customer_account_edit> //layout handle <router_nameController_methodAction>
        <reference name="customer_edit"> // ?
            <action method="setTemplate"> //?
                <template>stackexchange_customer/form/edit.phtml</template>
            </action>
        </reference>
    </customer_account_edit>
    <customer_account_create>//layout handle <router_nameController_methodAction>
        <reference name="customer_form_register"> //?
            <action method="setTemplate"> //?
                <template>stackexchange_customer/register.phtml</template>
            </action>
        </reference>
    </customer_account_create>
</layout>


texts: Magento 2 : Can't deploy my custom theme

texts:
I've created a theme in Magento 2, but when I'm trying to deploy my Magento site to a server, it's static files don't get generated. I've already tried the solution in error during deploying custom theme in magento 2, but that doesn't work for me.

What happens is when I run bin/magento setup:static-content-deploy, Magento goes and create the static content for Magento/blank and Magento/luma (and the adminhtml template), but not for my custom template.

registration.php:

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/Happy/Foundation',
    __DIR__
);

Locally, in developer mode, everything works fine. Does anyone know what might be causing this?


texts: Dynamically update SKU of configurable product

texts:
I have a configurable product with many options.
How can I update the sku based on selected options?
I have followed this answer, but I am stuck at the JavaScript part.
I try to get the this.config.skus, but I can't find out how.

Could someone provide a working example?
I am using Magento 2.1.
Thank you!


texts: Show hide tax based on customer group magento2

texts:
Is it possible to show/hide tax for specific customer group?

Or show prices with tax and without tax based on customer group in magento2


texts: How to restrict direct access `/pub` with url?

texts: How to restrict direct access /pub with the project URL (www.domain.com/pub) in Magento 2.


texts: Product show in search suggestion after delete

texts:
I delete all products in magento but when i search deleted product name in seachbox it still shows.

I have taken these steps after product deletion:

Re-Index Site
Clear Cache


texts: How to show out of stock product configuration in Magento 2.2.7?

texts:
The display of out of stock products is enabled in the store configuration. This means that out of stock simple products are displayed. But if one or more configuration of a configurable product is out of stock then the swatch of that product is missing from the swatch list of that product.

How do I make all swatches visible, even for out of stock configurations?

There have been a number of questions and answers in this topic but none of them work. Particularly the one that recommends to set Use configuration options under the products' Advanced inventory. This option is not even there in M2.2.7. Another solution involves a custom module but according to comments some files are missing.

The solution posted here is no help either because stock is refreshed from our remote server via Magento 2's API multiple times a day, so setting a stock manually for these simple products would be pointless.

So please do not mark this as a duplicate.

Thanks in advance for all the help!


texts: php bin/magento setup:upgrade Nothing to import

texts:
I searched over Google for the answer, but could not get any concrete answers - I have uploaded Payu money (Payment Method - zipped file downloaded from payumoney) in app folder (hosted at Godaddy) and Extract it and executed the following commands on the server (using ssh)

php bin/magento setup:upgrade

it is showing some lines and then "Nothing to Import"

php bin/magento setup:static-content:deploy

setup:static-content:deploy [-f|--force] [-s|--strategy [STRATEGY]] [-a|--area [AREA]] [--exclude-area [EXCLUDE-AREA]] [-t|--theme [THEME]] [--exclude-theme [EXCLUDE-THEME]] [-l|--language [LANGUAGE]] [--exclude-language [EXCLUDE-LANGUAGE]] [-j|--jobs [JOBS]] [--symlink-locale] [--content-version CONTENT-VERSION] [--refresh-content-version-only] [--no-javascript] [--no-css] [--no-less] [--no-images] [--no-fonts] [--no-html] [--no-misc] [--no-html-minify] [--] []...

then i used php bin/magento setup:static-content:deploy -f

then some lines executed up to 100%

then i checked store -> configuration -> sales -> payment method, but PayU is not showing there in admin

then I searched google and found it may be some problem in system.xml for , then when I searched for system.xml in my public_html folder (on Godaddy server) I found multiple files, which I am not sure which is to edit?


texts: How to ignore/exclude specific folder from di:compile?

texts:
I have a file in my plugin folder which I don't want to be compiled while running
bin/magento setup:di:compile . Is there any way to do that?


texts: How can I append templates to form container

texts:
I have a block that extends Mage_Adminhtml_Block_Widget_Form_Container.

I also have two blocks of type core/template that use template files that I'd like to include within my main form.

Is it possible to add these templates as children of the form and render them after everything else?

I'm trying to prevent having to write a bunch of html when I can use the blocks form building functions.

Here's my layout section:

<adminhtml_onsite_purchaseorder_edit>
    <reference name="head">
        <action method="addJs"><file>darkhorse/simplemde/simplemde.min.js</file></action>
        <action method="addCss"><file>darkhorse/onsite/simplemde/simplemde.min.css</file></action>
    </reference>
    <reference name="content">
        <block type="onsite/adminhtml_purchaseOrder_edit">
            <block type="core/template" template="darkhorse/purchaseOrder/items.phtml" name="purchaseOrder_items" as="purchaseOrder_items" />
            <block type="core/template" template="darkhorse/purchaseOrder/notes.phtml" name="purchaseOrder_notes" as="purchaseOrder_notes" />
        </block>
    </reference>
</adminhtml_onsite_purchaseorder_edit>

Block:

class Darkhorse_Onsite_Block_Adminhtml_PurchaseOrder_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{
    public function __construct()
    {
        $this->_objectId = 'id';
        $this->_controller = 'adminhtml_purchaseOrder';
        $this->_blockGroup = 'onsite';
        parent::__construct();
        $this->_updateButton('save', 'label', Mage::helper('onsite')->__('Save Purchase Order'));
        $this->removeButton('delete');
        $this->removeButton('back');
        $this->removeButton('reset');

        $this->_formScripts[] = '
            function saveAndContinueEdit(){
                editForm.submit($("edit_form").action+"back/edit/");
            }
        ';
    }

    /**
     * Retrieve text for header element depending on loaded page
     *
     * @return string
     */
    public function getHeaderText()
    {
         if (Mage::registry('current_purchaseOrder')->getId()) {
            return $this->escapeHtml(Mage::registry('current_purchaseOrder')->getName());
        } else {
            return Mage::helper('onsite')->__('New PurchaseOrder');
        }
    }

    /**
     * Prepare layout
     *
     * @return Mage_Core_Block_Abstract
     */
    protected function _prepareLayout()
    {
        $this->_addButton('save_and_continue', array(
            'label'     => Mage::helper('onsite')->__('Save and Continue Edit'),
            'onclick'   => 'saveAndContinueEdit(\''.$this->_getSaveAndContinueUrl().'\')',
            'class'     => 'save'
        ), 10);

        return parent::_prepareLayout();
    }

    protected function _getSaveAndContinueUrl()
    {
        return $this->getUrl('*/*/save', array(
            '_current'  => true,
            'back'      => 'edit',
            'tab'       => '{{tab_id}}',
            'active_tab'=> null,
        ));
    }
}


texts: Magento2 - How to bring a 100% html template?

texts:
I have tried several methods to bring an html template to Magento2.
One was to simply load style sheets from the template I was working on. The styles were mixed with the standard template, and the page was defaced. It was useless, but that was expected!
In another attempt, I tried to use reset css techniques, with the hope of "zeroing" the style, and making my custom.css serve as a new style. It was useless.
A third attempt was to search the documentation, to try to configure an XML page with full width, so theoretically I could fill it with html from my template, and have full width features.
Documentation references were not the same as the platform screen, even using magento 2.3.5. Did not work!
One last attempt was to try to find some standard file (within the theme I created), of the type "style.css". It was a cloned Luma theme.
I didn't try to change the Vendor folder! However, pretty much all of the standard style sheets were .less, which I don't know how to work with, let alone knowing what the theme's pattern would be.
I would like to know how is the best way to 100% clone an html template for a Magento2 theme that I create!


texts: How to add media gallery entries via REST API - Magento 2

texts:
I stored image in pub/media/catalog/product. How to add that images into media gallery entries.

I have tried like http://myhost/rest/V1/products

"media_gallery_entries"=> array(
    array(
        "media_type"=> "image",
        "label"=> "Product Image",
        "position"=> 1,
        "disabled"=> false,
        "types"=> array(
            "image",
            "small_image",
            "thumbnail"
        ),
        "file"=> "/1/0/10.jpg"
    )
),

but it always complain about "message":"The image content is not valid."

base64_encode is the only way to add image into rest api?

if yes I tried with

"media_gallery_entries"=> array(
    array(
        "media_type"=> "image",
        "label"=> "Product Image",
        "position"=> 1,
        "disabled"=> false,
        "types"=> array(
            "image",
            "small_image",
            "thumbnail"
        ),
        "content"=> array(
            "base64_encoded_data"=> $data->getMainImage(),
            "type"=> "image/jpeg",
            "name"=> "test.jpg"
        ),
    )
),

It throws exception "message":"The image MIME type is not valid or not supported."

I found supported mime type in /vendor/magento/framework/Api/ImageContentValidator.php

private $defaultMimeTypes = [
    'image/jpg',
    'image/jpeg',
    'image/gif',
    'image/png',
];

It support image/jpeg, but I don't know why it throws exception.

Can anyone enlighten me to how to add media galleries entries?


texts: Send account confirmation email to specific customer group in magento2

texts:
I want to send an account confirmation email  to a specific customer group with specific customer domain @example.com

For that, I need to override the sendEmailConfirmation() function in my app/code module from file (vendor/magento/module-customer/Model/AccountManagement.php)

How can I achieve this?


texts: How to get a collection of Out Of Stock (including configurable) products

texts:
In my magento i have "Display out of stock products" -> No. (i needed like this).
I want to create a page with all out of stock products.
I have everything working, but cannot find the correct collection.
The products that must be included are: simple products that are out of stock AND configurable products with all of their simple out of stock.

Update Edit 1
There is one more important note. The solution must use query and not a new collection.

e.g this is the current code for filtering on "bestseller"

$select->joinLeft(array('stats' => new Zend_Db_Expr("(SELECT stats.product_id AS product_id, SUM(stats.qty_ordered - IFNULL(stats.qty_canceled, 0)) AS qty_ordered".
                " FROM {$res->getTableName('sales/order_item')} AS stats".
                " INNER JOIN {$res->getTableName('sales/order')} AS o ON".
                " (o.entity_id = stats.order_id AND".
                " (o.created_at BETWEEN '{$from}' AND '{$to}'))  AND o.state NOT IN ('pending_payment', 'new', 'canceled') AND".
                $db->quoteInto(" o.store_id = ?", Mage::app()->getStore()->getId()).
                " GROUP BY stats.product_id)")),
                "stats.product_id = e.entity_id", array('cat_index_position' => new Zend_Db_Expr('-stats.qty_ordered')));

        $this->_condition = 'stats.qty_ordered > 0';


texts: I'm looking to setup an integration token for the REST API. I understand the process for this, as well as the ability to specify the tokens access to different resources such as products or customers. What I am unsure about is how to only allow read access to one of these tokens. I do not want this integration to be able to create, change, or delete data. Is this possible using Magento's built in REST API?


texts:
I'm using magento 1.9.2.

I would like to change the invoice details like below
"Row total
Shipping and handling
Discount
Total
Tax
Grand Total"

to

"Row total
Discount
Total
Tax
Shipping and handling
Grand Total"

I would be happy if someone gives me tips.Thank you!


texts: value of specific group attributes of product

texts:
in manage attributes set say default i created a group say "my custom group" now i want to get value of all attributes under this group for current product how can i do this?..

$attributeValue = Mage::getModel('catalog/product')
                  ->load($this->getProduct()->getId());
                   echo "<pre>";
                   print_r($attributeValue->getData());
                   echo "</pre>";

show all attributes for product


texts: Undefined index for an attribute during csv import

texts: Why do i get undefined for only color attribute during import.


texts:
I'm using magento 2 and I'm trying to add the Google Tag Manager code (noscript and script parts) to my magento 2 installation , what's the best way to do it ?

I found this module to do it
https://github.com/magepal/magento2-googletagmanager

But once I enable it and add the code , when I go to my website I get a 404 error

  The page you requested was not found, and we have a fine guess why

And is the same even if i try to go to the admin panel , the only way to revert this is to disable the module from the database.

Does anyone has any idea why it acts like that ?


texts: While executing my magento file i am getting fatal error

texts:
Fatal error: Allowed memory size of 792723456 bytes exhausted (tried to allocate 1769107328 bytes) in D:\xampp\htdocs\magento_final\vendor\magento\framework\ObjectManager\Relations\Runtime.php on line 38

can u please give this sloution


texts: Turpentine Cache policy for product list page for customer group

texts:
i have Magento 1.9.1.0 and Varnish with the plugin Turpentine for caching.
I have different customer group. I defined a rule that some products are hidden for a specific customer group so each of them will view different "product list page"
My problem is that this page is cached so is always the same for each customer group. Is there a way to implement a esi cache policy for the product list page for customer group?

Thanks


texts:
What would be the steps and the proper way to call a 3rd party module that you cannot load via composer? Is there a acceptable method for doing this in Magento 2?

I am looking at implementing a 3rd party library into a store but the library is not open source or available on packagist.org.


texts: Magento : Upload .GIF image for a Product

texts:
I want to upload .GIF image for a product in magento. it should be animated in product detail page. i have uploaded GIF image for a product but it's look like a .JPG/.JPEG image. it's extension is .GIF but not working in product detail page.

any help will be appreciate.

thanks


texts: Display currency selected by user on top

texts:
please visit link , on top left you can see "currency" , once we mouse-over  we can see
list of store view names and currency assigned to each store.

what i want is if user select "Euro" ,

it should display the currency : [€] on top,

for US Dollar, it should display currency : [$]

<?php if(count($this->getStores())>1): ?>

    <ul id="select-language" title="<?php echo $this->__('Currency') ?>" class="dropDownMenu">

<?php echo $this->__('Currency') ?>

            <?php foreach ($this->getStores() as $_lang): ?>
                <?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' class="selected"' : '' ?>
                <li <?php echo $_selected ?>>
                <a href="<?php echo $_lang->getCurrentUrl() ?>"><?php echo $this->escapeHtml($_lang->getName()) ?>

            <?php endforeach; ?>

<?php endif; ?>


texts:
In the past few weeks, at least three customers have found that, at checkout, other people's details are showing up in their address book  (totally unrelated people...no similarity in name, email or location).
It is almost as if the details have been held on the server cache.
Has anyone had this issue before.   Needless to say the customers have been very concerned (and one even threatening!).  The whole of our Magento (all pages are SSL/https )


texts:
Hello guys can you please guide me how to migrate Magento 1.9 to 2.1.3
I can't find perfect solution for migrate from 1 to 2
any ready made extension available so please give me the extension URL
and how to migrate from Magento 1.9 to 2.1.3 Step by Step.


texts: Magento 2: Change order totals block sort order in order emails only

texts:
I want to add some changes in Magento 2 email order_totals.

I searched and found it

<tfoot class="order-totals">
        <?= $block->getChildHtml('order_totals') ?>
</tfoot>

Where do I change it? Please help me


texts: Simple Products Custom Options price sorting - magento 1.9.2

texts: magento 1.9.2 - how to get simple products custom options price for price slider sorting in sidebar and load product collection in the list page. by default magento not sorting custom options price


texts: Magento 2.3.5-p2 Image Uploader not Working

texts: When I attempt to upload an image to Magento 2, I click the option in the toolbar and when I attempt to browse for the file I am taken to a blank white screen and do not see any browser information to choose my file. I recently attempted to upgrade from Magento 2.3.5-p1 to 2.4. However when I realized I needed ElasticSearch 7 I then downgraded to 2.3.5-p2. I am not sure if this is related to my problem or no.


texts: Error message when placing order with only bundle products?

texts:
On my Magento 2.2.8 store I get the following error message when I place an order with bundle products that only have virtual products as bundled products.

{"message":"Auf dem Server ist ein Fehler aufgetreten. Bitte versuchen Sie die Bestellung erneut aufzugeben.","trace":"#0 \/html\/magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\\Checkout\\Model\\PaymentInformationManagement->savePaymentInformationAndPlaceOrder(6953, Object(Magento\\Quote\\Model\\Quote\\Payment\\Interceptor), Object(Magento\\Quote\\Model\\Quote\\Address))\n#1 \/html\/magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): Magento\\Checkout\\Model\\PaymentInformationManagement\\Interceptor->___callParent('savePaymentInfo...', Array)\n#2 \/html\/magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\\Checkout\\Model\\PaymentInformationManagement\\Interceptor->Magento\\Framework\\Interception\\{closure}(6953, Object(Magento\\Quote\\Model\\Quote\\Payment\\Interceptor), Object(Magento\\Quote\\Model\\Quote\\Address))\n#3 \/html\/magento2\/generated\/code\/Magento\/Checkout\/Model\/PaymentInformationManagement\/Interceptor.php(26): Magento\\Checkout\\Model\\PaymentInformationManagement\\Interceptor->___callPlugins('savePaymentInfo...', Array, Array)\n#4 [internal function]: Magento\\Checkout\\Model\\PaymentInformationManagement\\Interceptor->savePaymentInformationAndPlaceOrder(6953, Object(Magento\\Quote\\Model\\Quote\\Payment\\Interceptor), Object(Magento\\Quote\\Model\\Quote\\Address))\n#5 \/html\/magento2\/vendor\/magento\/module-webapi\/Controller\/Rest\/SynchronousRequestProcessor.php(95): call_user_func_array(Array, Array)\n#6 \/html\/magento2\/vendor\/magento\/module-webapi\/Controller\/Rest.php(244): Magento\\Webapi\\Controller\\Rest\\SynchronousRequestProcessor->process(Object(Magento\\Framework\\Webapi\\Rest\\Request\\Proxy))\n#7 \/html\/magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#8 \/html\/magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callParent('dispatch', Array)\n#9 \/html\/magento2\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\\Webapi\\Controller\\Rest\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#10 \/html\/magento2\/generated\/code\/Magento\/Webapi\/Controller\/Rest\/Interceptor.php(39): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callPlugins('dispatch', Array, Array)\n#11 \/html\/magento2\/vendor\/magento\/framework\/App\/Http.php(136): Magento\\Webapi\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#12 \/html\/magento2\/generated\/code\/Magento\/Framework\/App\/Http\/Interceptor.php(24): Magento\\Framework\\App\\Http->launch()\n#13 \/html\/magento2\/vendor\/magento\/framework\/App\/Bootstrap.php(257): Magento\\Framework\\App\\Http\\Interceptor->launch()\n#14 \/html\/magento2\/index.php(39): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http\\Interceptor))\n#15 {main}"}

The error means something like: There was an error on the server. Please try to replace your order. I can see savePaymentMethod in the trace, so maybe thats related? The order is placed anyway, I can see it in the order grid in admin, but on frontend it looks like it hasnt.

Thanks for any help!


texts: Remove Discount Coupon from Magento ver 1.9?

texts:
Does anyone know how i can disable/remove the Discount Coupon from Magento Shopping Cart Page v 1.9 ?

Thanks.


texts: Magento 2.2.3 CE unable to add/remove item from wishlist?

texts:
We are getting facing an error message when we add (or) remove item from wishlist in magento 2.2.3 CE can you please advise? ? we didn't write any custom code from custom module.

  Fatal error: Uncaught Error: Call to a member function getId() on
  boolean in
  /srv/public_html/vendor/dotmailer/dotmailer-magento2-extension/Observer/Customer/RemoveWishlistItem.php:52
  Stack trace: #0
  /srv/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72):
  Dotdigitalgroup\Email\Observer\Customer\RemoveWishlistItem->execute(Object(Magento\Framework\Event\Observer))

1 /srv/public_html/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\Framework\Event\Invoker\InvokerDefault->_callObserverMethod(Object(Dotdigitalgroup\Email\Observer\Customer\RemoveWishlistItem), Object(Magento\Framework\Event\Observer))
2 /srv/public_html/vendor/magento/framework/Event/Manager.php(66): Magento\Framework\Event\Invoker\InvokerDefault->dispatch(Array, Object(Magento\Framework\Event\Observer))
3 /srv/public_html/generated/code/Magento/Framework/Event/Manager/Proxy.php(95): Magento\Framework\Event\Manager->dispatch('wishlist_item_d...', Array)
4 /srv/public_html/vendor/magento/framework/Model/Abstract in /srv/public_html/vendor/dotmailer/dotmailer-magento2-extension/Observer/Customer/RemoveWishlistItem.php on line 52

https://prnt.sc/m23ybx


texts:
Hi i'm new at magento 2 and want to get orderId() using Observer on place order event.

    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <event name="sales_order_place_after">
        <observer name="place_order" instance="SussexDev\Extrato\Observers\Observers\PlaceOrder" shared="false" disabled="false"/>
    </event>
</config>

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Psr\Log\LoggerInterface;

class PlaceOrder implements ObserverInterface
{
    public function __construct(LoggerInterface $logger)
    {
        $this->logger = $logger;
    }
public function execute(Observer $observer)
{
    //$request = $observer->getEvent()->getOrder();
    //echo "Request id: ".$request->getId();
    $txt = "\n aaaaaa";
    $this->_logger->log('DEBUG', $txt);
    $this->logger->info('Observer Atingido2', $observer->debug());

}

}

I got the conclusion that i'm Observing the wrong event, i want to observer the event that happens when this button (Place Order) get clicked.

I realized that my problem is other, the Observer isn't called and i don't know why. I created another post please check here:  My Observer is not executing


texts: Magento2: How to add a small Icon image on product image in product view page in magento 2

texts:
I wish to add small icon image on the product image in magento 2.

From which template the product image is loaded in product view page.
Please provide me a solution.


texts: Upgrading compromised Magento from 1.7 to 1.9

texts:
I've been doing some research but there appears to be multiple solutions, and I want to get it right. I need to upgrade my Magento from 1.7.0.2 to the latest (1.9) being that our server was compromised and outgoing mail has been spammed.

I was told by out hosting provider to make sure the latest version of Magento is installed to help stop this.

My question though, is what's the best way to get this upgraded? I'm trying to avoid storing anything on my local machine since I don't want that to get harmed with the malicious files.

I was thinking of creating a folder titled 'OLD' on the server and moving all my magento files there and then install a fresh install of Magento 1.9. Once done, I can move over only the necessary files (themes etc) and then delete the 'OLD' folder.

Is this the best way to go about this? Do I need to do anything with my Database, other than amend the local.xml information?


texts: I spent the morning following instructions to remove the Footer Links, Contact Us, Search Terms, Advanced Search and Sitemap. I was able to remove all the links except Sitemap. I tried a variety of locations for the catalog.xml file but every time I commented out the section that was in the directions my product block disappeared for every product. As soon as I removed the comment it came back. I am flummoxed! Anyone have an experience with this?


texts:
Product SKU based AND PRODUCT NAME SEARCH Not working properly if SKU consists of a special character like (space, dot, etc) it results not giving the exact result.

Is there any solution for this? Please give your valid comments, please...


texts: Pictures enlarged on front end of Magento 2 store

texts:
Hi I am using Magento version 2.0.6

I have a live version of the site and a local version running on my pc which i use for testing. as i make changes to the local version i deploy it to the live site.

I'm having a problem on a project i'm working on. The store side images of the live site for products are displaying extremely large and somewhat blurry and i cant seem to find a solution.I need the live site to display the products like the local site.

The problem is that the pictures on the live version are blurry and enlarged
(see screenshot below of live site)

The product pictures on my local version are displaying fine (see screenshot below of local site)

Also note that on the live version its displaying 2 products per row and on the local its displaying 4 products per row.

I have compared all the settings in the admin panel for both the live and local sites and they all are the same.

I have did the following things:

I flushed and refreshed  all the magento 2 cache types
I cleared my browsers cache
I ran the command php bin/magento setup:upgrade
I ran the command php bin/magento setup:static-content:deploy
I ran the command php bin/magento indexer:reindex

My only conclusion is that it has to be a css or javascript setting?
is there a file i can navigate to and modify perhaps?

Please note that more than one person works on the site.


texts: Magneto2 : How to show related products to right side in product view page

texts:
How can I show related products to right side section of the product view page?

I want to show 3 related products in  right side section i wrote

      <referenceContainer name="right">
        <block class="Magento\Catalog\Block\Product\ProductList\Related" name="catalog.product.related" template="Magento_Catalog::product/list/items.phtml">
            <arguments>
                <argument name="type" xsi:type="string">related</argument>
            </arguments>
        </block>
      </referenceContainer>

but its not working


texts: How to get collection of invoices of a customer?

texts:
I am using below code but it is giving error please help.

$collection = Mage::getModel("sales/order_invoice")->getCollection()->addFieldToFilter('customer_id',$customerId);


texts: Is it possible to add child blocks to a block that has been defined in a static block?

texts:
In layout.xml you can define children like this

<block...><block... /></block>

Is the same possible if I add a block in a static block? I only know this notation:

{{block type="cms/block" block_id="your_block_id"}}

Background: I try to build a frame with the parent block that can use one ore more children.

Tricky: The parent and the children have multiple parameters to manage the template.


texts: Changing "Add to cart" button text in Magento 2.1.0 ( Overriding js file )

texts:
I have changed "Add to cart" text to "I want this" by overriding "vendor\magento\module-catalog\view\frontend\templates\product\list.phtml".
But, when I click on "I want this" (i.e. "Add to cart" ) button, the product is added to the cart and then again "Add to cart" text appears on the button.

I think product is added via ajax call, that is why a newly added text is not displaying after the ajax call and "Add to cart" text is displaying.

I have tried this :

I have created a custom extension Ved_Mymodule.

I have checked that extension is active.

After that I followed these steps:

app/code/Ved/Mymodule/view/frontend/requirejs-config.js:

var config = {
    map: {
        '*': {
            catalogAddToCart:'Ved_Mymodule/js/customCatalogAddToCart'
        }
    }
};

app/code/Ved/Mymodule/view/frontend/web/js/customCatalogAddToCart.js:

define([
    'jquery',
    'mage/translate',
    'jquery/ui'
], function($, $t) {
    "use strict";

$.widget('Ved_Mymodule.customCatalogAddToCart',$.mage.catalogAddToCart, {

    //Override function
    disableAddToCartButton: function(form) {
        var addToCartButtonTextWhileAdding = this.options.addToCartButtonTextWhileAdding || $t('Adding...');
        var addToCartButton = $(form).find(this.options.addToCartButtonSelector);
        addToCartButton.addClass(this.options.addToCartButtonDisabledClass);
        addToCartButton.find('span').text(addToCartButtonTextWhileAdding);
        addToCartButton.attr('title', addToCartButtonTextWhileAdding);
        console.log('Hello 1');
    },

    enableAddToCartButton: function(form) {
        var addToCartButtonTextAdded = this.options.addToCartButtonTextAdded || $t('Added');
        var self = this,
            addToCartButton = $(form).find(this.options.addToCartButtonSelector);

        addToCartButton.find('span').text(addToCartButtonTextAdded);
        addToCartButton.attr('title', addToCartButtonTextAdded);

        setTimeout(function() {
            var addToCartButtonTextDefault = 'heya..'; //self.options.addToCartButtonTextDefault || $t('Add to Cart..');
            addToCartButton.removeClass(self.options.addToCartButtonDisabledClass);
            addToCartButton.find('span').text(addToCartButtonTextDefault);
            addToCartButton.attr('title', addToCartButtonTextDefault);
        }, 1000);

        console.log('Hello 2');
    }

});

return $.Ved_Mymodule.customCatalogAddToCart;
});

I am trying to print dummy messages in the console.

After this:
I have run static content deploy.
Reindex the data.
Cache cleaned and flushed.

But changes are not appearing.


texts:
I am getting the following error when doing a curl request with a magento observer( after the user has entered all payment info etc). Ive already tried all the common remedies to these errors such as removing whitespaces before and after php tags, and explicitly, typecasting the foreach array...to no avail. for some reason its also showing the post paramaters on the user page itself( which it should not!)

A PHP Error was encountered

Severity: Warning

Message: Invalid argument supplied for foreach()

Filename: controllers/Api.php

Line Number: 68

Backtrace:

File: /home2/philip/public_html/collector/application/controllers/Api.php
 Line: 68
 Function: _error_handler

File: /home2/philip/public_html/collector/application/libraries/REST_Controller.php
 Line: 708
 Function: call_user_func_array

File: /home2/philip/public_html/collector/index.php
 Line: 315
 Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home2/philip/public_html/collector/system/core/Exceptions.php:272)

Filename: core/Common.php

Line Number: 568

Backtrace:

File: /home2/philip/public_html/collector/application/libraries/REST_Controller.php
 Line: 785
 Function: set_status_header

File: /home2/philip/public_html/collector/application/libraries/REST_Controller.php
 Line: 818
 Function: response

File: /home2/philip/public_html/collector/application/controllers/Api.php
 Line: 90
 Function: set_response

File: /home2/philip/public_html/collector/application/libraries/REST_Controller.php
 Line: 708
 Function: call_user_func_array

File: /home2/philip/public_html/collector/index.php
 Line: 315
 Function: require_once


texts: Newsletter: Passing subscriber email address to the custom block

texts:
I have a newsletter in my store and in the cms notation of the newsletter templates I have included a block to fill the content. I need to pass the subscriber email address to the block so that I can make changes in the content (based on the Customer).
I know that subscriber.getEmail will return the email address but how will I pass it to the block in cms page?

I tried -

{{block type="..." template="..." email="{{var subscriber.getEmail()}}" }}

But its not working as expected. How to pass the subscribers email to the template/block ?


texts:
I am trying to re apply user information to forms which they have incorrectly completed.

Current steps of the form:

1 - user is presented with form

2 - user enters data

3 - user submits data

4 - data is validated

data is unsuccessful

error message is set

error message is passed to session

error message is displayed above form

users inputted data is not reapplied to form

5 - data is saved

6 - user is passed to relevant page

The line in bold is what I need to change, I have been unable to work how to reapply the users data in to the fields. Do I need to change the block I am referencing, if so to what? I have tried a few options.

    <reference name="content">
        <block type="core/template" name="prefs_new" as="prefs_new" template="ps/prefs/new.phtml" />
    </reference>

In the phtml file I have tried $this->getSession() but returned an error, I have also var_dump() the model, but could not see the data in there, where am I going wrong. I know I need to apply the data to each field individually, I just cannot work out how to get the required data in the first place.


texts:
I need to duplicate the check payment method and I've followed this guidelines: http://www.magentocommerce.com/wiki/duplicating_money_order_payment_method_module

Everything works as expected but I had to modify core files as the guide stated and I want the website to be able to be updated without breaking this.

I had to edit for this the app/core/Mage/Payment files that follow:

-etc/config.xml
-etc/system.xml

and added copies of the checkmo.php files where they were needed.

I tried to replicate these changes inside app/code/local/Mage/Payment but with the same code I can't see the payment method now. I'm guessing this is not the right way to do this. How can it be done?


texts: Magento2 - After upgrading webshop redirects to localhost

texts:
I have just updated my magento website from version 2.1.7 to 2.1.8.

I have used the following commands:

composer require magento/product-community-edition 2.1.8 --no-update
(pass required update version number)

composer update
rm -rf var/di var/generation
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex

After the above commands were executed, the frontend and the backend are redirected to localhost.

I have checked the core_config_data in the database, all the base urls are set correctly...


texts: Our store has more than 30K products and most of them are child product and not visible individually. How can I prevent to add new url rewrite for these products? I mentioned how can we manage url rewrite proccess, e.g I want to not add url rewrite for a particular products, for example disabled, not visible, not categorized products? Anybody have some hints? Thanks.


texts: magento 1.9 soap api xml call to update product custom attribute

texts:
I am working on to update product msrp. Below code working for me:
$sku = 'AMC-2.0-10';
$update_data = array (
    'additional_attributes' => array (
        'single_data' => array (
            array ('key' => 'msrp', 'value' => 88)
        )
    )
);
$mage_url = 'http://mystore.com/api/v2_soap?wsdl';
$mage_user = 'user';
$mage_api_key = 'pass';
$soap = new SoapClient( $mage_url );
$session_id = $soap->login( $mage_user, $mage_api_key );
$update = $soap->catalogProductUpdate($session_id, $sku, $update_data);

but when i try it with postman i get the error that 'Product not exists'
Please check and advise whats wrong in this xml call.
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento">r
   <soapenv:Header/>r
   <soapenv:Body>r
      <urn:catalogProductUpdate soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">r
            <urn:sessionId xsi:type="xsd:string">48daca05f4e6432750199b6295509a24</urn:sessionId>
            <urn:sku xsi:type="xsd:string">AMC-2.0-10</urn:sku>
            <urn:productData>
                <urn:additional_attributes>
                    <urn:single_data>
                        <item>
                            <key>msrp</key>
                            <value>77</value>
                        </item>
                    </urn:single_data>
                </urn:additional_attributes>
            </urn:productData>
        </urn:catalogProductUpdate>
   </soapenv:Body>r
</soapenv:Envelope>


texts:
I've re-written wishlist controller Mage_Wishlist_IndexController's function _addItemToWishList()

and on product page added a button and called this function making an ajax call.

<input type="button" value="Click me" onclick="addToWishlist('<?php echo $this->helper('wishlist')->getAddUrl($product) ?>')"/>

In controller function

        protected function _addItemToWishList()
                {
                    $session = Mage::getSingleton('customer/session');
                    Mage::log("main()", null, 'wish.log', true);
                     if ($session->isLoggedIn()) {
                         // code snippet to add to wishlist which works fine and returns success msg
                     }
      else {
         Mage::log("inside else", null, 'wish.log', true);
         $response['message'] = "Please login to add product to wishlist";
         $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
        return;
       }

What I see is if I'm not logged in, my controller function is not being called and nothing is being printed in log. Why so?


texts: MAGENTO 2.3 API: Consumer is not authorized to access %resources Magento_Sales::actions_view

texts:
I have moved a website to another server with the same features and the same version of php but the api calls no longer work. The calls do not work for me neither in Postman nor in curl. And postman tells me the following error:
Consumer is not authorized to access %resources Magento_Sales::actions_view

What could be the problem?
Thanks!!


texts: Magento 2 - page.main.title below content

texts:
the page main title is below the content.

You can see the problem in the picture.

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

  Magento\Theme\Block\Html\Title

How can I fix that?
Thanks!


texts:
Site search results:

These cats are not needed to show here as they show in properly below them (in the attributes). I have made them 'non active' in the category sections all bar the product type, phone type and manufacturer as they are in the navigation menu. Is there a way to get rid of these 3 remaining cats from the side narrow down whilst keeping them the nav at the top of the site?

Thanks


texts:
I have to develop module for magento community edition.

Latest version at the moment is 1.9.0.1, released about two weeks ago. There is 1.7.0.0 available for download, but it seems outdated — a 2012 release.

I did not found any data about version fragmentation of existing magento installations.

So, I'm asking here: which versions should I target?


texts: Source model issue from system xml in Magento 2

texts:
I've created two dropdowns field in the system.xml , both of them have the same options, except that one has an extra option: None.
This is the xml:

        <field id="printing_option" translate="label" type="select" showInDefault="1" showInWebsite="0" showInStore="0" sortOrder="4">
            Printing option
            <source_model>Vendor\Module\Model\Config\Source\PrintingOption</source_model>
        </field>
        <field id="printing_option_2" translate="label" type="select" showInDefault="1" showInWebsite="0" showInStore="0" sortOrder="4">
            Printing option 2
            <source_model>Vendor\Module\Model\Config\Source\PrintingOption</source_model>
        </field>

and in my Vendor\Module\Model\Config\Source\PrintingOption I have:

namespace Vendor\Module\Model\Config\Source;
use Magento\Framework\Data\OptionSourceInterface;

class PrintingOption implements OptionSourceInterface
{
    /**
     * Printing options: automatic or manual
     *
     * @return array
     */
    public function toOptionArray() : array
    {
        return [
            // I want to add the none option for my second field
            ['value' => 2, 'label' => __('NONE')],
            ['value' => 1, 'label' => __('Automatic')],
            ['value' => 0, 'label' => __('Manual')]
        ];
    }
}

I want to add the NONE option only for my second dropdown. Is there a way to do this, instead of creating a new source model ? and to avoid duplicate codes ?

Thnx


texts:
Order email was working fine. Now it's not. I don't know what I changed and now it's not working. Only thing I changed in the meantime, was to add a few emails to send the order also.

Other emails are working. Like new customer or change password.

Also Is there a way to check all emails?


texts:
How to hide the category block in navigation on all pages if the user is not a login?

Also, if a user tries to navigate to a category via a link, it should be redirected to the login page.


texts: Adding new page layout like category page

texts:
I added a new page layout in my store and now when I want add another page layout it's replaced with the previously added layout.

Why does this happen? Can't I make more than one layout?

EDIT:
I added in app/code/local/Home/Page/etc/config.xml :

<?xml version="1.0"?>
<config>
  <modules>
    <Home_page>
      <version>0.1.0</version>
    </Home_page>
  </modules>
  <global>
    <page>
      <layouts>
        <homepage translate="label">
          <label>Home_page</label>
          <template>page/homepage.phtml</template>
          <layout_handle>home_page</layout_handle>
        </homepage>
        <!-- add more layouts here -->
      </layouts>
    </page>
  </global>
</config>

Also added app/etc/Home_page.xml:

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

And add this app/design/frontend/default/my-theme/template/page/homepage.phtml , that I use my layout in this page.


texts: Remove out of stock product from home Page in Magento 2

texts: I am using aloquick theme in Magento2. Some out of stock products are showing in Featured Products tab of Home Page. I would like to remove those out of stock product from Home Page.  My admin panel settings is like below


texts: What is the best way to import/create products , customers and orders in magento 2.x

texts:
I have a third party Soap API, I have to create products, customers, orders and other related data in Magento 2.x. periodically like every 24 hours.

There are around 15k products and orders.

What i am planning is to
 Create a new extension and use Magento 2 APIs to do so
something like this create a customer using api

Is there any other approach for the same. What will be the best way to do so?

If possible please share any helpful link or tutorial for the same.


texts:
In magento admin dashboard, the order id displayed is of the form #10001011. In the URL, I can see something similar to

http://ZZZ.com/index.php/admin/sales_order/view/order_id/17/key/42311084d2b66e35a64702bbe47d2901/

Note that order_id is 17 in the URL. How do I get that ID? what function in magento that will return the actual system id 17? I am trying to do some adjustment to an extension and for some reason it is using 17 instead of #10001011 to generate a download URL for the order.


texts: How to create widget programmatically in magento 2.x.x?

texts:
I have some widget in custom theme and that theme should be imported automatically.
-> after click on import button all the required widget, blocks and pages will be installed in back end. I had already done with block and pages but I need to do it for widget now.
Its really appreciated, If anyone can help me.
Thanks.


texts: html / code to add price in a specific block?

texts:
I've tried multiple snippets of code to add an item price to a specific block without success.

On the example item page : https://fixlcdscreens.com/default/catalog/product/view/id/10234/s/ACER-ASPIRE-V5-571-6868-15.6%22-Laptop-LCD-LED-Display-Screen/

I would like to add the product price in the right column block where I have put the text [INSERT PRICE HERE]

Can someone please help me achieve this in what you believe is the simplest way.

Thanks in advance for any help!


texts: Magento 2.3.4 Can you call a widget inside a widget

texts: Can you call a custom widget inside a custom widget?


texts: Magento 2.3: Not able to insert data using custom Patch

texts:
I have upgraded my Magento version from 2.2.7 to 2.3.2. I am working on a module where I have to create a table and insert some sample data.

As per the new conventions introduced in Magento 2.3.x, I created the table using app/code/[Packagename]/[Modulename]/etc/db_schema.xml. The table has been created successfully.

Now, I am trying to add data to the table using the patch file app/code/[Packagename]/[Modulename]/Setup/Patch/Data/InsertTemplates.php

The apply() function code is as follows:

public function apply()
{
    $data = array();
    $data[0]['template_name'] = __('Default Template 1');
    $data[0]['style_color'] = '#DC8C71';
    $data[0]['text_color'] = '#949392';
    $data[0]['caption'] = __('Gift Card');

    $data[1]['template_name'] = __('Default Template 2');
    $data[1]['style_color'] = '#DC8C71';
    $data[1]['text_color'] = '#636363';
    $data[1]['caption'] = __('Gift Card');
}

When I run the following commands:

php bin/magento setup:db-declaration:generate-whitelist --module-name=[Packagename]_[Modulename]

php bin/magento s:up

Both commands are running successfully, but the data is not being inserted into the table.

Can anyone help me understand, what can be the problem.


texts: How to deactivate the user automatically after 1 day Magento

texts: How to deactivate or inactive the user/customer automatically after one day in our website, Is that possible?


texts: Free shipping Coupon being accepted but shipping amount not deducted

texts: I have created a free shipping coupon in shopping cart price rule. The free shipping option is set to "For Shipments with Matching Items" in the "Action" tab. There are no conditions as it is applicable to all the Items and the coupon is being accepted but the shipping amount is not being deducted from the subtotal. Does anyone know what is the cause of this and how can I fix it?


texts:
With a paid extension that's out of it's support period I'm trying to move the Product FAQ below the Upsell Products so that the order of the blocks in the attached image becomes:

Product Tabs
Upsell Products
Product FAQ

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

The problem that I'm not solving is that both the tabs and FAQs are part of the product_additional_data include.

Am I better off trying to add it to the upsell_products block at the bottom or creating a new block to insert it myself.


texts: Magento2 CLI module:enable gives error "Unkown module(s)"

texts:
In Magento2 I've built a simple custom module and want to enable it by CLI:

bin/magento module:enable Vendorname_Modulename

But it is giving me the following error:

  Unknown module(s): 'Vendorname_Modulename'

The module and it's files do exist in app/code/Vendorname/Modulename/

Of course I've cleared/disabled caches, cleared generation, Memcache(d) not running...


texts: Test validity of a product for a store view transparently

texts:
There are a number of conditions that determine if a product can be displayed in a certain store view. From the top of my head, I know 3:

Is the product associated with the website?
Is the product configured as enabled/active for that website?
Does the product have a non-empty price field for that store view?

Background is that I have an external search function using a Solr server in the backend. That search function has been altered so that when a product number is entered into the search function and enter is pressed and there is a product matching that product number close to 100% (capitalization is ignored, but otherwise it needs to be a match), then it jumps directly to the product detail page, otherwise a normal search is performed.

Now, it dawned on me that I could in that way find a product that is not visible to the store view (see the conditions above). The result is that the URL is called correctly, but results in a 404.

Is there a transparent way of testing if a product could theoretically be viewed for a certain store view without finding and spelling out the exhaustive list as it currently is? I imagine something like

Mage::Helper('something')->canViewInStoreview($productId, $storeviewId)

would be right on the spot. If spelled out, the conditions in the next version could change, and I would not want to re-check with every update if the list is still complete.


texts:
I can't reindex catalog_category_flat index from web admin, I see an error message. But I can reindex it from the console by running

  php shell/indexer.php --reindex catalog_category_flat

without a problem. What could be the problem?


texts: Force-run module install script in Magento 2

texts:
I have added some install data to my module (EAV attributes), and it doesn't look like it's working. However, I don't seem to get any relevant errors in the logs, and am a bit lost on whether the install script ever ran in the first place. I tried two ways to run it:

  Disable/enable module
  Running setup:upgrade

Is there a way to force-run just my install script? If not, does setup:upgrade always run it, and if so, which log should I be looking at?

Edit: Here is the relevant part of the install data script:

$customerSetup->addAttribute(Customer::ENTITY, 'some_action_timestamp', [
        'type' => 'int',
        'label' => 'Some action timestamp',
        'input' => 'text',
        'required' => false,
        'visible' => false,
        'user_defined' => true,
        'sort_order' => 1000,
        'position' => 1000,
        'system' => 0,
    ]);

    $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, 'some_action_timestamp')
        ->addData([
            'attribute_set_id' => $attributeSetId,
            'attribute_group_id' => $attributeGroupId,
            'used_in_forms' => ['adminhtml_customer'],
        ]);

    $attribute->save();


texts: How to execute cron jobs automatically every week in magento 2 custom module?

texts:
I have created crontab.xml in vendor/module/etc directory

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<group id="default">
    <job name="get_carriers" instance="Vendor\Module\Cron\GetCarriers" method="execute">
        <schedule>* * * * *</schedule>
    </job>
</group>

And create GetCarriers.php in Vendor/Module/Cron/GetCarriers.php

namespace Vendor\Module\Cron;
     class GetCarriers {

     protected $_logger;

     public function __construct(\Psr\Log\LoggerInterface $logger) {
           $this->_logger = $logger;
     }

     public function execute() {
           $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/cron.log');
           $logger = new \Zend\Log\Logger();
           $logger->addWriter($writer);
           $logger->info(__METHOD__);

           return $this;
     }
}

Now if i execute php bin/magento cron:run --group="default" cron run but i want it to execute automatically every week.


texts: Magento boilerplate / blank / skeleton / naked themes for theme development

texts: Does anyone out there know of a good, clean boilerplate / blank / skeleton / naked theme (unsure of the proper term myself) besides the base/default? Not that it is bad, but sometimes another one may be more suited to a particular theme-cut job. It would be the Magento equivalent of this.


texts:
I am getting an error while updating a product

  Warning: trim() expects parameter 1 to be string, array given in
  D:\xampp-7.1.23\htdocs\indiahicks\vendor\magento\module-eav\Model\Entity\AbstractEntity.php
  on line 942

here is the video link as well


texts:
I have tried every suggestion that is out there but im still getting this error

In my config data they are figured as:

i have tried the solutions none of them are working im still getting the same error over and over.
I also have apache rewrite mode on as well.

I have tried:

Magento 2 CSS and JavaScript not loading from correct folder

https://stackoverflow.com/questions/34040496/magento-2-not-loading-css-and-javascript


texts:
My store has the following categories:

- Root
     - other category
     - another category
     - Home
         - Kitchen
             - Cabinets
             - Appliances
             - Accessories
         - Bedroom
             - Storages
             - Beds
             - Blinds
         - Bathroom
             - Fittings
             - Tiles
             - Flooring
         - Lounge
             - Seating
             - Electricals
             - Lighting

In a custom module i have a page which loads a collection of all my level 4 categories through the home category path like so:

public function __construct()
{
    parent::__construct();
    $home_id = 52;
    $root_id = Mage::app()->getStore()->getRootCategoryId();
    $path = '1/'.$root_id.'/'.$home_id.'/';

    $collection = Mage::getModel('catalog/category')->getCollection()
    ->addAttributeToFilter('level', 4)
    ->addAttributeToFilter('is_active', 1)
    ->addPathsFilter($path)
    ->addAttributeToSelect(array('name'))
    ->addNameToResult()
    ->addUrlRewriteToResult()
    ->setLoadProductCount(true);
    $this->setCollection($collection);

}

So the above successfully gets these categories in a collection:

             - Cabinets
             - Appliances
             - Accessories
             - Storages
             - Beds
             - Blinds
             - Fittings
             - Tiles
             - Flooring
             - Seating
             - Electricals
             - Lighting

Now i need to be able to filter these categories by their attributes - in the same way the layered navigation works on products. The filtering needs to be done on the categories themselves not the products within.

For one example all these categories have a custom attribute of section.
Only Lighting and Blinds have

section: lower

All the other categories have

section: upper

Is it possible to add layered navigation into the left sidebar so i can filter the categories by section (and others)?


texts: Magento 2: Dashboard Chart, Want custom Amount range on y axis?

texts:
I want to add custom Amount range on y-axis like 0,5000,10000,15000,20000 so on ...
how can I achieve this?


texts: Duplicates found in column names: array ( 0 => 'sku', 1 => 'store_view_code', 2 => 'attribute_set_code', 3 => 'product_type', 4 => 'categories', 5 => 'product_websites', 6 => 'name', 7 => 'description', 8 => 'short_description', 9 => 'weight', 10 => 'product_online', 11 => 'tax_class_name', 12 => 'visibility', 13 => 'price', 14 => 'special_price', 15 => 'special_price_from_date', 16 => 'special_price_to_date', 17 => 'url_key', 18 => 'meta_title', 19 => 'meta_keywords', 20 => 'meta_description', 21 => 'base_image', 22 => 'base_image_label', 23 => 'small_image', 24 => 'small_image_label', 25 => 'thumbnail_image', 26 => 'thumbnail_image_label', 27 => 'swatch_image', 28 => 'swatch_image_label', 29 => 'created_at', 30 => 'updated_at', 31 => 'new_from_date', 32 => 'new_to_date', 33 => 'display_product_options_in', 34 => 'map_price', 35 => 'msrp_price', 36 => 'map_enabled', 37 => 'gift_message_available', 38 => 'custom_design', 39 => 'custom_design_from', 40 => 'custom_design_to', 41 => 'custom_layout_update', 42 => 'page_layout', 43 => 'product_options_container', 44 => 'msrp_display_actual_price_type', 45 => 'country_of_manufacture', 46 => 'additional_attributes', 47 => 'configurable_variations', 48 => 'configurable_variation_label', 49 => 'qty', 50 => 'out_of_stock_qty', 51 => 'use_config_min_qty', 52 => 'is_qty_decimal', 53 => 'allow_backorders', 54 => 'use_config_backorders', 55 => 'min_cart_qty', 56 => 'use_config_min_sale_qty', 57 => 'max_cart_qty', 58 => 'use_config_max_sale_qty', 59 => 'is_in_stock', 60 => 'notify_on_stock_below', 61 => 'use_config_notify_stock_qty', 62 => 'manage_stock', 63 => 'use_config_manage_stock', 64 => 'use_config_qty_increments', 65 => 'qty_increments', 66 => 'use_config_enable_qty_inc', 67 => 'enable_qty_increments', 68 => 'is_decimal_divided', 69 => 'website_id', 70 => 'related_skus', 71 => 'related_position', 72 => 'crosssell_skus', 73 => 'crosssell_position', 74 => 'upsell_skus', 75 => 'upsell_position', 76 => 'additional_images', 77 => 'additional_image_labels', 78 => 'hide_from_product_page', 79 => 'bundle_price_type', 80 => 'bundle_sku_type', 81 => 'bundle_price_view', 82 => 'bundle_weight_type', 83 => 'bundle_values', 84 => 'bundle_shipment_type', 85 => 'associated_skus', 86 => '', 87 => '', )


texts: Magento2: Getting error in console Cannot instantiate abstract class Magento\Framework\Data\Collection\AbstractDb

texts:
I am getting an error in the console.

Fatal error:  Uncaught Error: Cannot instantiate abstract class Magento\Framework\Data\Collection\AbstractDb in /var/www/vhost/abc/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111
Stack trace:
#0 /var/www/vhost/abc/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory-&gt;createObject('Magento\\Framewo...', Array)
#1 /var/www/vhost/abc/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled-&gt;create('Magento\\Framewo...')
#2 /var/www/vhost/abc/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled-&gt;get('Magento\\Framewo...')
#3 /var/www/vhost/abc/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled-&gt;create('Grazitti\\Mkt\\Mo...')
#4 /var/www/vhost/abc/vendor/magento/framework/Obj in /var/www/vhost/abc/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111

Here is my code:

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Store\Model\StoreManagerInterface;

class Abc extends \Magento\Framework\Model\AbstractModel
{

    protected $_objectManager;
    protected $_resourceCollection;

    public function __construct(
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
        \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
        \Magento\Framework\ObjectManagerInterface $objectmanager,
        array $data = []
    ) {
        $this->_objectManager = $objectmanager;
        $this->_resourceCollection = $resourceCollection;

        parent::__construct($context,$resource, $resourceCollection, $data);
    }

Please suggest, how to reslove?


texts: How to edit my-account-link in Magento2?

texts:
I'm using Magento 2. I tried to edit the my-account-link element ("My Account" link in the top bar), I just want to change the text with an icon but I can't find the phtml file to edit!

I've tried to enable the path hints but doesn't take me to the proper file to edit.


texts: Extension that is listening on Order status change

texts:
I'm using Magento 1.9.0.1.

I'm trying to create a very simple extension that is listening for a order status change.

Here is what i have done so far:

File: /VivasIndustries/SmsNotification/etc/config.xml:

<?xml version="1.0"?>
<config>
  <modules>
    <VivasIndustries_SmsNotification>
      <version>0.1.0</version>
    </VivasIndustries_SmsNotification>
  </modules>
  <global>
    <events>
        <sales_order_save_after>
            <observers>
                <vivasindustries_smsnotification>
                    <class>smsnotification/observer</class>
                    <method>orderSaved</method>
                </vivasindustries_smsnotification>
            </observers>
        </sales_order_save_after>
    </events>
  </global>

File: /VivasIndustries/SmsNotification/Model/Observer.php:

<?PHP
class VivasIndustries_SmsNotification_Model_Observer
{
    public function orderSaved(Varien_Event_Observer $observer)
    {
        Mage::log("Test")
    }
}

File: /app/etc/modules/VivasIndustries_SmsNotification.xml:

<?xml version="1.0"?>
<config>
  <modules>
    <VivasIndustries_SmsNotification>
      <active>true</active>
      <codePool>community</codePool>
      <version>0.1.0</version>
    </VivasIndustries_SmsNotification>
  </modules>
</config>

I've done everything by this guide: http://www.danielhanly.com/blog/observing-order-status-changes-magento/

The problem is that when i check out my system.log file there is no line or text with "Test". It seems it is not inserting this text in the log file that makes me think it is not recognizing when i change order status/save order.

Can you please point me where is my mistake and help me out resolve this problem.

Thanks in advance!


texts:
My default Head block is like this

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
         <link src="//fonts.googleapis.com/css?family=Raleway:400,600,600italic,500italic,500" src_type="url" />
        <css src="css/bootstrap.min.css" />
         <css src="css/custom-gw.css" />
        <css src="css/fetch_gw.css" />
        <css src="css/styles-m.css" />
        <css src="css/styles-l.css" media="screen and (min-width: 768px)"/>
        <css src="css/print.css" media="print" />

    </head>
</page>

it generates output like this in page source

<link  rel="stylesheet" type="text/css"  media="all" href="http://localhost:8080/mac/pub/static/frontend/GWtheme/GW/en_US/css/styles-m.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="http://localhost:8080/mac/pub/static/frontend/GWtheme/GW/en_US/css/bootstrap.min.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="http://localhost:8080/mac/pub/static/frontend/GWtheme/GW/en_US/css/custom-gw.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="http://localhost:8080/mac/pub/static/frontend/GWtheme/GW/en_US/css/fetch_gw.css" />
<link  rel="stylesheet" type="text/css"  media="screen and (min-width: 768px)" href="http://localhost:8080/mac/pub/static/frontend/GWtheme/GW/en_US/css/styles-l.css" />
<link  rel="stylesheet" type="text/css"  media="print" href="http://localhost:8080/anthony/pub/static/frontend/GWtheme/GW/en_US/css/print.css" />
<link  href="//fonts.googleapis.com/css?family=Raleway:400,600,600italic,500italic,500" />

but when i apply Raleway font on body its not working
I can however see this in fire bug but its not appying

body {
    color: #6d4d3d;
    font-family: "Raleway",sans-serif;
    font-size: 16px;
    line-height: 1;
}


texts: Is it safe to have composer in production?

texts: Is it safe/ok to have composer in production on a server hosting Magento?


texts: Failure reason: 'Unable to unserialize value, string is corrupted.' after upgrade magento 2.1.5 to magento 2.2.6

texts:
I have upgraded Magento 2.1.5 to Magento 2.2.6 but after that I am getting error in running upgrade command:

  Error converting field value in table quote_item_option where
  option_id=85330 using
  Magento\Framework\DB\DataConverter\SerializedToJson. Fix data or
  replace with a valid value. Failure reason: 'Unable to unserialize
  value, string is corrupted.'

I have followed this link to fix the issue but still it doesn't work.

What I do to fix? can anyone suggest the solution?


texts: Add custom block to admin order create page load

texts:
what I was trying:  add custom discount box in admin order create page.

here is my adminhtml layout xml  : fee.xml
 what should be reference name ??

      <adminhtml_sales_order_create_index>
        <reference name="root">
            <block type="adminhtml/sales_order_totals_item" template="fee/sales/order/tab.phtml" name="fee" />
        </reference>
    </adminhtml_sales_order_create_index>
    <adminhtml_sales_order_create_load_block_data>
        <reference name="content">
            <block type="adminhtml/sales_order_totals_item" template="fee/sales/order/tab.phtml" name="fee" />
        </reference>
    </adminhtml_sales_order_create_load_block_data>


texts:
I added two lines to eav_attribute_label that look like this:

attribute_id: 10,
store_id: 1
value: Address Number

attribute_id: 10,
store_id: 3
value: Address Number

This was an attempt to change the label of the lastname attribute in the customer_address entity type. This works fine in the front-end, and in form validation errors, etc.

However, now when I try to add a new address during checkout, I get this:

Item (Mage_Customer_Model_Attribute) with the same id "10" already exist

#0 \lib\Varien\Data\Collection\Db.php(576): Varien_Data_Collection->addItem(Object(Mage_Customer_Model_Attribute))
#1 \lib\Varien\Data\Collection.php(741): Varien_Data_Collection_Db->load()
#2 \app\code\core\Mage\Eav\Model\Form.php(263): Varien_Data_Collection->getIterator()
#3 \app\code\core\Mage\Eav\Model\Form.php(360): Mage_Eav_Model_Form->getAttributes()
#4 \app\code\core\Mage\Checkout\Model\Type\Onepage.php(541): Mage_Eav_Model_Form->extractData(Object(Mage_Core_Controller_Request_Http))
#5 \app\code\local\Forix\Custom\Model\Checkout\Type\Onepage.php(14): Mage_Checkout_Model_Type_Onepage->saveShipping(Array, '')
[...]

Any idea why this would act like I'm trying to create a new attribute, just because I changed the label of that attribute in the database? (The same database approach works for catalog_product attributes.)


texts: Install vs_ajax Extenstion in Magento it will display fatal error

texts:
When click on to add to cart in Magento theme it will display error:

  Fatal error: Call to a member function toHtml() on a non-object in
  ..\app\code\community\VS\Ajax\controllers\IndexController.php on line
  55

public function addAction()
{
    $cart   = $this->_getCart();
    $params = $this->getRequest()->getParams();
    if($params['isAjax'] == 1){
        $response = array();
        try {
            if (isset($params['qty'])) {
                $filter = new Zend_Filter_LocalizedToNormalized(
                array('locale' => Mage::app()->getLocale()->getLocaleCode())
                );
                $params['qty'] = $filter->filter($params['qty']);
            }

            $product = $this->_initProduct();
            $related = $this->getRequest()->getParam('related_product');

            /**
             * Check product availability
             */
            if (!$product) {
                $response['status'] = 'ERROR';
                $response['message'] = $this->__('Unable to find Product ID');
            }

            $cart->addProduct($product, $params);
            if (!empty($related)) {
                $cart->addProductsByIds(explode(',', $related));
            }

            $cart->save();

            $this->_getSession()->setCartWasUpdated(true);

            /**
             * @todo remove wishlist observer processAddToCart
             */
            Mage::dispatchEvent('checkout_cart_add_product_complete',
            array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())
            );

            if (!$cart->getQuote()->getHasError()){
                $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));
                $response['status'] = 'SUCCESS';
                $response['message'] = $message;
                //New Code Here
                $this->loadLayout();
            //  $toplink = $this->getLayout()->getBlock('top.links')->toHtml();

                $sidebar_block = $this->getLayout()->getBlock('cart_sidebar');
                Mage::register('referrer_url', $this->_getRefererUrl());
                $sidebar = $sidebar_block->toHtml();
                $response['toplink'] = $toplink;
                $response['sidebar'] = $sidebar;
            }
        } catch (Mage_Core_Exception $e) {
            $msg = "";
            if ($this->_getSession()->getUseNotice(true)) {
                $msg = $e->getMessage();
            } else {
                $messages = array_unique(explode("\n", $e->getMessage()));
                foreach ($messages as $message) {
                    $msg .= $message.'<br/>';
                }
            }

            $response['status'] = 'ERROR';
            $response['message'] = $msg;
        } catch (Exception $e) {
            $response['status'] = 'ERROR';
            $response['message'] = $this->__('Cannot add the item to shopping cart.');
            Mage::logException($e);
        }
        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));
        return;
    }else{
        return parent::addAction();
    }
}


texts: Magento 2 can not find sales_quote_merge_after event

texts:
Magento 2 i can not find sales_quote_merge_after event for merge cart.

anyone have idea ?


texts: Import problem: What is the importance of the table 'importexport_importdata', can i truncate it and what is it good for anyhow?

texts:
i have a problem with a clients Magento DB while trying to replicate it on my computer.

Needless to say that i was not able to export the DB via the Magento Backend (using 1.6 Community version), that crashed the customers page somehow blocking some DB tables (never figured out what exactly happened, gave me 1205 errors on the *log_visitor* table when trying to login, but after some DB maintenance it worked again). So i finally managed to export the whole db with the great Adminer script (in chunks, exporting the logs and product tables separately).

So the current situation:

Export via Adminer works like a charm.

Import gives me an error while trying to import the mentioned 'importexport_importdata' table which only has one entry but with a size of ~2.5 MB ! So while i was able to work around the huge size of the clients log and product tables (between ~250k and ~800k entries) by exporting them separatedly, i just can't import that table because its only entry is simply to big to import in one chunk.

I could cut the import of this entry to smaller pieces and simply append them to the entry, but i read on one page that this table could be truncated which i would prefer todo. The problem is that i haven't found much information about this table at all and am reluctant to truncate it without having more information about it.

QUESTION is it really save to truncate this table and what purpose does the data stored in it serve?


texts:
I am getting the wrong URL in an admin template. The URL should be the same URL that the user is on, but with parameters added. Why is the code returning what seems like the base URL? How do I retrieve the proper URL?

Current page URL example:
    https://admin.example.com/index.php/admin/admin/ggproduct/index/key/1234567891011abcdefg/?store=2

function switchStore(obj) {
  var storeParam = obj.value ? '?store=' + obj.value : '';
  setLocation('<?php echo $this->getUrl('*/*') ?>' + storeParam); // Wrong URL
  return true;
}

Code rendered in the JavaScript code:

function switchStore(obj) {
  var storeParam = obj.value ? '?store=' + obj.value : '';
  setLocation('https://www.example.com/en-US/admin/ggcategory/index/key/1234567891011abcdefg/' + storeParam);
  return true;
}

Expected code (with correct URL):

function switchStore(obj) {
  var storeParam = obj.value ? '?store=' + obj.value : '';
  setLocation('https://admin.example.com/en-US/admin/ggcategory/index/key/1234567891011abcdefg/' + storeParam);
  return true;
}


texts:
I used sudo php bin/magento setup:upgrade command but get

[InvalidArgumentException]
  There are no commands defined in the "deploy:mode" namespace.

after that tried list command but get We're sorry, an error occurred. Try clearing the cache and code generation directories. By default, they are: var/cache, var/di, var/generation, and var/page_cache.

[CredisException]
  Connection to Redis failed after 2 failures.Last Error : (111) Connection refused

Used rm -rf var/cache var/di var/generation var/page_cache but still have error. no command works.


texts: How Magento 2(Any website) will transfer order details to payment Gateway

texts:
Today I just went around Magento 2 payment page. To know how the website will transfer order details from Magento 2 to payment Gateway page. But here I can see only the radio buttons and other stuff like text boxes, labels etc...

I know how the payment process will done functionally.
And what are all the form tag contains like form tag, text boxes, form key,.. etc?

But how the website will transfer the order details to payment gateway?

looking for the brief answer?


texts: How to call Observer in magento ( Observer not fuctioning )?

texts:
I have set an event-observer in my custom module but observer is not getting called. i have enabled my log and i am getting this warning :

2013-08-14T11:17:48+00:00 ERR (3): Warning: include(Mage/CompanyName/ModuleName/Model/Observer.php): failed to open stream: No such file or directory  in /var/www/nyp/lib/Varien/Autoload.php on line 93
2013-08-14T11:17:48+00:00 ERR (3): Warning: include(): Failed opening 'Mage/CompanyName/ModuleName/Model/Observer.php' for inclusion (include_path='/var/www/nyp/app/code/local:/var/www/nyp/app/code/community:/var/www/nyp/app/code/core:/var/www/nyp/lib:.:/usr/share/php:/usr/share/pear')  in /var/www/nyp/lib/Varien/Autoload.php on line 93

Code in my config.xml to attach event and observer :

<global>
    <events>
        <sales_order_place_after>
            <observers>
                <CompanyName_ModuleName_Observer>
                    <type>singleton</type>
                    <class>CompanyName_ModuleName/observer</class>
                    <method>methodName</method>
                </CompanyName_ModuleName_Observer>
            </observers>
        </sales_order_place_after>
    </events>
 <global>

Code in my CompanyName/ModuleName/Model/Observer.php :

<?php

class CompanyName_ModuleName_Model_Observer
{
    public function __contruct()
        {

        }

    public function methodName(Varien_Event_Observer $observer)
    {

    }
}

Thanks,


texts: How to rewrite Js widget which doesn't have return $.mage.widgetName

texts:
I'm trying to rewrite JS widget using mixin but getting error Uncaught TypeError: base is not a constructor.
If at the end of this widget add return $.mage.widgetName, everything works fine.
Can I fix this without rewriting widget file?


texts: Paypal issue: PayPal gateway has rejected request. Payment has already been made for this InvoiceID (#10412: Duplicate invoice)

texts:
In Magento 2.2.5 using Paypal payment.

I am getting the below error:

  PayPal gateway has rejected request. Payment has already been made for this InvoiceID (#10412: Duplicate invoice).


texts: Magento 2 Override third party module block file

texts:
I am working a Magento2 project and I have installed a third party module magefan/module-blog which is used for manage Blog/post.This module is installed in Magento Vendor folder.

path is magento/vendor/magefun/module-blog .

I have a custom requirement and some changes/updated in block files.Since module is exist in Magento vendor folder so we can't directly changed in this module.Hence we require to override file

  /var/www/html/magento2/vendor/magefan/module-blog/Block/Category/view.php

in

  /var/www/html/magento2/app/code

folder.I don't have idea how to override particular that file.

if anyone know about it.Please help me.


texts: How to upload images to magic 360 extension by script

texts:
I installed magic 360 extension which is working fine but I have difficulty to upload images for 10,000 products, here I want script to upload images based on product SKU,

Exampe: SKU Images P1001 36 P2002 36 P3003 38


texts: Loading collection of products from a Category with admin filters

texts:
I am currently working on a project where it loads a collection of products with a CategoryFilter.

$category = $this->categoryFactory->create()->load($categoryId);
    $collection = $this->_productCollectionFactory->create();
    $collection->addAttributeToSelect('*');
    $collection->addCategoryFilter($category);
    $collection->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH);
    $collection->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);

    return $collection;

From administration panel (Catalog -> Categories), you can choose "manual sorting" or "automatic sorting" from "Display Settings".

But this option seems to not work.

Can someone explain me, what I am suppose to load the collection with admin filters ?

Thanks you.


texts: Magento 2.1 Multiple shipping Templates modification

texts:
I want to change magento 2.1 multiple shipping option templates. I want to find the location of the templates.

thanks


texts: How to Filter Attribute Set, Attribute option value and filter by manufacture in product export

texts:
Change into app/code/local/Mage/ImportExport/Model/Export/Entity/Product.php on
  line 647 in funtion export()

$collection = $this->_prepareEntityCollection(Mage::getResourceModel('catalog/product_collection'));

  Replace code in above code

$collection = $this->_customprepareEntityCollection(Mage::getResourceModel('catalog/product_collection'))
                ->addAttributeToFilter('price', array('gt' => 0))
                    //Filter by product name//
                ->addAttributeToFilter('name', array('nlike' => '%T-shirts%'))
                ->addAttributeToFilter('name', array('nlike' => '%Mobile%'))
                ->addAttributeToFilter('name', array('nlike' => '%Watch%'))

                 //Filter by product option value like manufacture attribute have some option//

                ->addAttributeToFilter('manufacturer',
                array(
                    'nlike' => Mage::getResourceModel('catalog/product')
                    ->getAttribute('manufacturer')
                    ->getSource()
                    ->getOptionId('Sony')
                ))
                ->addAttributeToFilter('manufacturer',
                array(
                    'nlike' => Mage::getResourceModel('catalog/product')
                    ->getAttribute('manufacturer')
                    ->getSource()
                    ->getOptionId('Microsoft')
                ))
                ->addAttributeToFilter('manufacturer',
                array(
                    'nlike' => Mage::getResourceModel('catalog/product')
                    ->getAttribute('manufacturer')
                    ->getSource()
                    ->getOptionId('LG')
                ))

                  //Filter by particular attribute set like default attribute set id is 4 //

                ->addAttributeToFilter('attribute_set_id',
                array('eq' => 4));


texts: Magento 2.1 - Title Prefix/Suffix doesn't show

texts: I've set my webshop Titles prefix/suffixes in Content > Design: Configuration > HTML Head for every level (from global to website to store) and I haven't overwritten the head.phtml in my theme. Still the <title> tags only show the page- or categorynames. I've seen this behaviour on several Magento2 sites. Is this a bug?


texts: Magento 2: custom page for downloadable product

texts: In Magento 2 is it possible to edit the product page only for downloadable products? For example hidden some block or move block in other location.