texts: Magento 2 preference not working for Magento\Checkout\Block\Onepage

texts:
I am trying to override Magento\Checkout\Block\Onepage and it's display blank page

Here is my Mymodule/Test/etc/di.xml

<?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
        <preference for="Magento\Checkout\Block\Onepage" type="Mymodule\Test\Block\Onepage" />
    </config>

Mymodule/Test/Block/Onepage.php

<?php
    namespace Mymodule\Test\Block;
    class Onepage extends \Magento\Checkout\Block\Onepage
    {

    }

?>

system.log is

[2016-12-06 05:28:57] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_59779d713e3fbb1543956771d12cf7164 and handles default, checkout_index_index: Please correct the XML data and try again.  [] []
[2016-12-06 05:28:57] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_5177627f91af678a9b03e993f1a91917f and handles checkout: Please correct the XML data and try again.  [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'header.panel.wrapper' element cannot be added as child to 'header.container', because the latter doesn't exist [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'header-wrapper' element cannot be added as child to 'header.container', because the latter doesn't exist [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'navigation.sections' element cannot be added as child to 'page.top', because the latter doesn't exist [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'top.container' element cannot be added as child to 'page.top', because the latter doesn't exist [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'breadcrumbs' element cannot be added as child to 'page.top', because the latter doesn't exist [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'footer' element cannot be added as child to 'footer-container', because the latter doesn't exist [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'footer-top' element cannot be added as child to 'footer-container', because the latter doesn't exist [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'footer-center' element cannot be added as child to 'footer-container', because the latter doesn't exist [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'header.panel.wrapper' tries to reorder itself towards '', but their parents are different: 'header.container' and '' respectively. [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'navigation.sections' tries to reorder itself towards '', but their parents are different: 'page.top' and '' respectively. [] []
[2016-12-06 05:28:57] main.CRITICAL: Broken reference: the 'footer-center' tries to reorder itself towards 'footer-top', but their parents are different: 'footer-container' and '' respectively. [] []
[2016-12-06 05:28:58] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_56f1b068ec7ccf4878f9284dd1137afd1 and handles catalog_product_prices: Please correct the XML data and try again.  [] []
[2016-12-06 05:28:58] main.CRITICAL: Invalid template file: 'onepage.phtml' in module: 'Mymodule_Test' block's name: 'checkout.root' [] []


texts: Magento CMS page continuously loading with blank page

texts:
Magento EE 1.14 contentiously loading with blank page but all html script available in view source.

Is any one have the solution for this


texts:
It code from */*/sql/*_setup/install-1.0.0.php

$installer = $this;

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();

$setup->addAttribute('catalog_product', 'product_label_attribute', array(
'group'         => 'Product labels',
'input'         => 'select',
'type'          => 'int',
'label'         => 'Labels',
'source'        => 'productlabels/source_labels',
'visible'       => true,
'visible_on_front' => true,
'required'      => false,
'user_defined'  => true,
'searchable'    => true,
'filterable'    => true,
'comparable'    => true,
'used_in_product_listing' => true,
'visible_on_front' => true,
'visible_in_advanced_search'  => true,
'is_html_allowed_on_front' => false,
'unique'        => false,
'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));

Why when after create attriute i  got

Why all attributes selected 'No'?


texts: Where should this JS go? re: Remove price from select field on product page

texts:
Following up on Magento 2.2.3 - Remove price from select field on product page

From the accepted answer by Remco, where should I put this JS code?

$('select.product-custom-option').change(function(){
    $('option').each(function(){
        var selectedOption = $(this).text();
        if (selectedOption.indexOf('+€') > -1) {
            selectedOption = selectedOption.substring(0, selectedOption.indexOf('+€'));
            $(this).text(selectedOption);
        } else if (selectedOption.indexOf('-€') > -1) {
            selectedOption = selectedOption.substring(0, selectedOption.indexOf('-€'));
            $(this).text(selectedOption);
        }
    });
});


texts: Loading the customer add address form in a phtml file in Magento 2 issue

texts:
I would like to load the add customer address form in a phtml file. My phtml file looks like:
.........

      echo $this->getLayout()
            ->createBlock(
                "Magento\Customer\Block\Address\Edit",
                "customer_address_edit",
                [
                    'data' => [
                        'attribute_data' => \Magento\Customer\Block\DataProviders\AddressAttributeData::class,
                        'post_code_config' => \Magento\Customer\Block\DataProviders\PostCodesPatternsAttributeData::class,
                        'view_model' => \Magento\Customer\ViewModel\Address::class
                    ]
                ]
            )
            ->setTemplate('Magento_Customer::address/edit.phtml')
            ->toHtml();

.......

I saw that the way how it is loaded in Magento is:
<referenceContainer name="content">
    <block class="Magento\Customer\Block\Address\Edit" name="customer_address_edit" template="Magento_Customer::address/edit.phtml" cacheable="false">
        <arguments>
            <argument name="attribute_data" xsi:type="object">Magento\Customer\Block\DataProviders\AddressAttributeData</argument>
            <argument name="post_code_config" xsi:type="object">Magento\Customer\Block\DataProviders\PostCodesPatternsAttributeData</argument>
            <argument name="view_model" xsi:type="object">Magento\Customer\ViewModel\Address</argument>
        </arguments>
    </block>
</referenceContainer>

So I tried to do same way (xml way) in php, but I run into this error message:
Error: Call to a member function getFrontendLabel() on string in /var/www/html/nestle/vendor/magento/module-customer/view/frontend/templates/address/edit.phtml:16

On line 16 I have the following:
<?php $_country_id = $block->getAttributeData()->getFrontendLabel('country_id'); ?>
Can you tell me please, what am I doing wrong ? Thank you


texts: No Category hierarchy only root catalog when changing product information

texts:
I am working on a webshop in Magento.
When I try to change an existing configurable product to another category, I only get to see Root Catalog:

This is kind of awkward. As I CAN choose other categories when adding a new product.

I found it quite difficult to find any solutions for this.
Does anyone have any advice, suggestions or solutions for this?
I am willing to code in PHP if I had to... But I'd like to do as less as possible changes to core files.
Thanks in advance.

UPDATE

I am using the following extensions:

Afterpay
ImaClean
FlatShipping5
Moneybookers?
Deleteorder from Raveinfosys
Exporter from Raveinfosys
Zopim livechat
MyParcel

And some functions from the SNS Toronto theme:

Ajaxcart
Ajaxfilter
ProductList
Producttabs
Quickview
RevolutionSlider
Slider
Toronto
Twitter

UPDATE 1

I noticed that when I am adding a new product, I can select the categories, but when I want to update a product, it seems to have this problem. Regardless if imported or not.


texts: Inventory not decrementing after the order is placed - Magento 2.1 upgraded from Magento 2.0

texts:
We have recently upgraded our website from Magento 2.0.2 to Magento 2.1. We are having strange issue with stock management.

When an order is placed, product quantity is not auto decremented. I tried changing website id from cataloginventory_stock_item and cataloginventory_stock_status as I thought it might be a problem with website association.

This had no effect though. I checked for the bug and found an reported issue on git https://github.com/magento/magento2/issues/5945

Does anyone else face the same issue? It would be helpful if someone can provide an insight on this.


texts:
I am trying to setup magento 2 on ubuntu 14.04.

But when it reaches the database setup it gives me an error

  Recoverable Error: Argument 1 passed to
  Magento\Framework\DB\Adapter\Pdo\Mysql::__construct() must be an
  instance of Magento\Framework\Stdlib\String, instance of
  Magento\Framework\Stdlib\StringUtils given, called in
  /var/www/magento2/lib/internal/Magento/Framework/Model/ResourceModel/Type/Db/Pdo/Mysql.php
  on line 74 and defined in
  /var/www/magento2/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php
  on line 194

I have searched everywhere but unable to find the answer.Please help me.


texts: Move search box in magento 2 to right side of menubar and add a div tag immediate next line of menu without any space or padding between

texts:
I wanted to add the search box to right of the menu bar. I also wanted to add division tag immediate below of the menu bar without any white space or padding.! How can I do this.? Thank you in advance.

Update: default.xml

 <!--  Moving block elements and rearranging to have in order of logo,toplinks , minicart , top navigation menu and search bar  -->
   <move element="header.panel" destination="header.panel.wrapper"/>
   <move element="logo" destination="header.panel"/>
   <move element="top.links" destination="header.panel" after="logo" before="minicart"/>
   <move element="minicart" destination="header.panel" before="-"/>
   <move element="top.search" destination="page.top" after="catalog.topnav" before="-"/>
    <move element="top.search" destination="catalog.topnav" after="-"/>
 <!-- Remove default elements -->
   <referenceBlock name="advanced-search-link" remove="true"/>

 <!-- Adding logo -->
     <referenceBlock name="logo">
             <arguments>
                 <argument name="logo_file" xsi:type="string">images/logo.png</argument>
                <argument name="logo_img_width" xsi:type="number">400</argument>
                 <argument name="logo_img_height" xsi:type="number">200</argument>
             </arguments>
         </referenceBlock>
 <!--adding blocks below main nav -->

 <referenceContainer name="page.top">
         <container name="belowNav" as="belowNav" label="Below Nav" htmlTag="div" htmlClass="belowNav">
             <block class="Magento\Framework\View\Element\Template" name="div-below1.nav"  template="Magento_Theme::testtry.phtml"></block>

         </container>
          </referenceContainer>


texts:
I am trying to override sales_order_create_index.xml to remove the custom payment method but getting this error
1 exception(s): Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'Custom_Module:order/create/billing/method/info.phtml' in module: 'Magento_Sales' block's name: 'order_create_billing_form'
sales_order_create_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="order_create_billing_form">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Custom_Module::order/create/billing/method/info.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

Template Path:


texts: Magento2 : Change Customer name Prefix to Radio button from Dropdown on Checkout page, cant be at the Osc for mageplaza billing address

texts:
need to the Change Customer name Prefix to Radio button from Dropdown on the checkout page
I followed this solution
Magento2 : Change Customer name Prefix to Radio button from Dropdown on Checkout page

and it solved the shipping address but the billing address at the Mageplaza_Osc cant be change to the radio

can anyone help me with this
thanks


texts: Problem with javascript : url redirects http to https

texts:
I am using Magento ver. 1.9.1.0 and theme is ShopShark ver.1.7.4.5 -> Milano

site adding ssl

In the theme file path add in one javascript

app/code/local/ShopShark/ThemeConfig/etc/config.xml

I change to http to https but not working https in the link

What is the problem and how should I solve this?


texts: Magento 2 Adminhtml Grid Create like Magento 1

texts:
I am new to Magento 2. I want to create a simple Grid where will be 3 columns, ID, Full Name, Email. How can I do that?

As a new comer i found its lil hard for me to create grid using UI Components & XML Layout. I want to create the grid like magento 1, I am familiar with Magento 1.

Can anyone help me with any tutorials??
Thanks in Advance.


texts: Having multiple store views share the same order increment_id number range

texts:
Can Magento be configured in a way, that multiple store views of the same website can share the same order increment_id number range? And if so, how?

For example, with a multistore setup like this in core_store:

store_id        code    website_id    group_id
       0       admin             0           0
       1       alpha             1           1
       2       bravo             2           2
       3     charlie             2           2

Now a new store view delta is added:

store_id        code    website_id    group_id
       4       delta             1           1

Assuming alpha's last order increment id currently is 1000123, how to achieve:

next sell    order number
    alpha         1000124
    delta         1000125
    delta         1000126
    alpha         1000127

Same question goes for multiple store views sharing the same invoice increment_id number range, and/or sharing the same creditmemo increment_id number range.

Does Magento support this out-of-the-box?


texts:
How can I sort orders by newest? Currently I'm filtering by complete and canceled status and I want to sort results by latest ordered date or by latest order ID. Now it show to me by the first ID lets say 10000001 but i want it to be 1000010

$collection = Mage::getModel('sales/order')->getCollection()
    ->addFieldToFilter('status', array('nin' => array('canceled','complete')))
    ->addFieldToFilter('state',Array('eq'=>Mage_Sales_Model_Order::STATE_NEW))
    ->addAttributeToSelect('*');


texts:
I am trying to add items to my cart by using the magento 2 Rest API.

Is it possible to get the Customer token by using the customer session?
I have looked into this and tried to implement a mix of a few ways to get the results i require.

public function getCustomerToken(){
  $result = "null";

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

  if($customerSession->isLoggedIn()) {
    $customerToken = $this->tokenModelFactory->create();
    $tokenKey = $customerToken->createCustomerToken($customerSession->getCustomer()->getId())->getToken();
    $result = $tokenKey;
  }
  else{
    $result = "null";
  }
  return $result;
}

This is what i have so far. This is currently throwing an error

Undefined property: Vendor\Module\Block\Index\Index::$tokenModelFactory

To add the items to the cart I need 3 things, the product sku, the quantity and the QuoteID.

to get the quote ID, i must create a cart for the user and to do this i need the customers token.

This is the article I have been learning from:
http://devdocs.magento.com/guides/v2.1/get-started/order-tutorial/order-create-quote.html

Is it possible to do what i am trying to?

Thanks


texts:
I need a fast way to resave all 75.000 products in my Magento 1.9 store.
Currently I use the following code, but that is not very fast.

Is there a better and faster way to resave all products?

CODE:

<?php
set_time_limit(0);

// require magento core
require_once 'app/Mage.php';

// execute on admin store
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

$products = Mage::getModel('catalog/product')->getCollection();
foreach($products as $product) {
    echo $product->getData('sku') . '<br/>';
    // save the product
    $product->save();
}
?>


texts: mini cart pushes the header down, pulls wrong item render sidebar/default.phtml, instead of mini-cartpro/default.phtml?

texts:
So The theme has a mini cart feature... It works, and updates the cart via ajax on addItem and remove item. When your NOT logged in, the feature works exactly how I want. The user add a product to the cart , the cart updates with out refreshing the page. When your logged in, when you add something to the cart, it uses the sidebar/default.phtml to show the updated mini cart, ( image with the header pushed down) refresh the page , and it shows as expected. I can not figure out what is telling mini-cart.phtml to use sidebar/default.phtml as the item renderer.

So The theme has a mini cart feature... It works, and updates the cart via ajax on addItem and remove item. When your NOT logged in, the feature works exactly how I want. The user add a product to the cart , the cart updates with out refreshing the page. When your logged in, when you add something to the cart, it uses the sidebar/default.phtml to show the updated mini cart, ( image with the header pushed down) refresh the page , and it shows as expected. I can not figure out what is telling mini-cart.phtml to use sidebar/default.phtml as the item renderer.

cartpro.xml

<reference name="header">
        <block type="cartpro/cart_cartpro" name="mini-cartpro" as="mini-cartpro" template="sm/cartpro/checkout/cart/mini-cartpro.phtml">
            <action method="setData"><name>template_item_renderer</name><value>sm/cartpro/checkout/cart/mini-cartpro/default.phtml</value></action>
            <action method="setData"><name>product_image_width</name><value>80</value></action>
            <action method="setData"><name>product_image_height</name><value>80</value></action>
            <action method="createSessionDataByName"><session_name>minicart</session_name></action>
        </block>

    </reference>

</default>

<customer_account translate="label">
    <remove name="cart_sidebar"/>
     <reference name="left">
        <block type="cartpro/cart_cartpro" name="cart_sidebar_clone" template="sm/cartpro/checkout/cart/sidebar.phtml" before="-">
            <action method="setData"><name>template_item_renderer</name><value>sm/cartpro/checkout/cart/sidebar/default.phtml</value></action>
            <action method="setData"><name>product_image_width</name><value>50</value></action>
            <action method="setData"><name>product_image_height</name><value>50</value></action>
            <action method="createSessionDataByName"><session_name>sidebar</session_name></action>
        </block>
    </reference>

Any help at all would be greatly appreciated , this is my first question, Im sure I did things all kinds of wrong , I will reformat or update anything that does not meet question standards. Thanks Guys!


texts: Magento 2 is not reading my requirejs-config.js

texts:
I am trying to add slick.js to my website. I started by following this tutorial- http://inchoo.net/magento-2/magento-2-slick-carousel/

I have my slick.min.js here- >app/design/frontend/vendor/theme/web/js/slick.min.js.

I created a requirejs-config.js at app/design/frontend/vendor/theme/web/
(after looking at the comments on the tutorial it mentions to move the file to app/design/frontend/vendor/theme/, so I did all of these steps at both locations.)

I pasted this code in the new requirejs-config.js file-

var config = {
   paths: {
    slick:        'js/slick'
},
shim: {
    slick: {
        deps: ['jquery']
    }
  }
};

I cleaned and flushed the cache, and ran php bin/magento setup:static-content:deploy(I am in developer mode so I do not believe it does anything).

I started researching and came across this answer- Magento2 not reading my requirejs-config.js

I deleted the requirejs-config.js here- >pub/static/_requirejs/frontend/Namespace/Theme/en_US/requirejs-config.js

After that, I ran

 php bin/magento cache:clean
 php bin/magento cache:flush
 php bin/magento setup:upgrade
 php bin/magento setup:di:compile

Still can't get that code to show up in require.js. Please advise on what I can try next.


texts: Magento 2.3 PWA Studio How to Setup Locally?

texts:
Magento 2, How to setup locally pwa studio for testing purpose only and please describe the pwa steps.I have used xampp with php 7.2.19 version.

Thanks.


texts: Wrong Base URLs only on Order Success Page with Multi Stores in Magento 2.3.1

texts:
I have created multi stores website with multi locales. Everything is working fine except the base URL on the order success page is wrong and showing the URLs of the default store in the navigation links, logo, and custom links using the function getBaseUrl or getUrl.

Even though we are getting console errors like
Access to font at 'http://blizz-relaunch.local/pub/static/version1572514278/frontend/Venedor/galabau/de_DE/fonts/Blank-Theme-Icons/Blank-Theme-Icons.woff' from origin 'http://galabau-relaunch.local' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Please help me to rectify this error.


texts: Custom attribute values Not showing while compare the product in magento2

texts:
I have issue in not showing Custom attribute values in while compare the products

I have added some custom attribute and Set Yes to Comparable on Storefront in Admin side. After check Compare Products, Custom Attributes are Showing fine, But value show N/A ,  But All custom attribute value showed in Product Details tab in product details page. Only not viewing compare Product.

Reference:

Suggest me What is the problem and How to resolve this problem.


texts: Calling site theme Function instead of related theme function

texts:
We called function setproductlogin in app/design/frontend/rwd/Theme/template/catalog/product  list.phtml :

 <div onclick="setproductlogin('<?php echo $_product->getEntityId()?>');setrequestlogin();">
   like

and function setproductlogin script code is present in

app/design/frontend/rwd/Theme/template/productlike - index.phtml

app/design/frontend/rwd/Theme/layout/productlike.xml :

<reference name="before_body_end">
            <block type="core/template" name="ajaxlogin">
                <action method="setTemplate"><template>productlike/index.phtml</template></action>
            </block>
</reference>

We used same function in another theme [ Theme6] file  app/design/frontend/rwd/Theme6/template/aitcg - js_styles1.phtml

<button onclick="return setproductlogin(\'<?php echo Mage::registry("current_product")->getId()?>\', event);setrequestlogin();"  id="submit-editorApply-{{rand}}" >
SAVE DESIGN
</button>

we included same function code in same theme file as

app/design/frontend/rwd/Theme6/template/example/index.phtml ,

but still when we click "save design" button, its calling javascript function present in main theme [Theme] instead of related theme Theme6

layout file :

<reference name="content">
<block type="example/list" name="examplelist" template="example/index.phtml" />
</reference>


texts: Create Widget not listed under Widget Instances

texts:
I have a functioning widget that displays under Admin > CMS > Pages > Content > Add Widget, and that's great. But it also displays under Admin > CMS > Widgets > Add New Widget Instance, and I'd like it to not do so.

Is there a way to deactivate it on this page?

Thanks.


texts: Magento 2: Overriding a protected function that implements another interface

texts:
I want to override the addDefaultAttributes function in /vendor/magento/framework/View/Page/Config/Renderer.php to remove the type="text/javascript" it inserts into the js meta tags. I have tried to do this using preference in a custom module but the changes do not apply after running upgrade/deploy. The original class uses implements RendererInterface. I have tried extending as well as keeping the implement class and both seem to not work. How do I account for this?

what I have:

/app/code/ME/framework/registration.php

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
            \Magento\Framework\Component\ComponentRegistrar::MODULE,
            'ME_framework',
            __DIR__
        );

/app/code/ME/framework/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
   <preference for="magento\framework\View\Page\Config\Renderer" type="ME\framework\View\Page\Config\Renderer" />

</config>

/app/code/ME/framework/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="ME_framework" setup_version="2.1.0" active="true" />
</config>

/app/code/ME/framework/View/Page/Config/Renderer.php

<?php

namespace ME\framework\View\Page\Config;

class Renderer implements \magento\framework\View\Page\Config\RendererInterface
{

    protected function addDefaultAttributes($contentType, $attributes)
    {
        switch ($contentType) {
            case 'css':
                $attributes = ' rel="stylesheet" type="text/css" ' . ($attributes ?: ' media="all"');
                break;
        }
        return $attributes;
    }
}

UPDATE: working code below using the public fuction renderHeadContent. I also had to change

<preference for="magento\framework\View\Page\Config\Renderer" type="ME\framework\View\Page\Config\Renderer" />

in di.xml to:

<preference for="Magento\Framework\View\Page\Config\Renderer" type="ME\framework\View\Page\Config\Renderer" />

Even though the directory structure had them lowercase.

Updated /app/code/ME/framework/View/Page/Config/Renderer.php

<?php

namespace ME\framework\View\Page\Config;

class Renderer extends \Magento\Framework\View\Page\Config\Renderer
{
    public function renderHeadContent()
    {
        $result = '';
        $result .= $this->renderMetadata();
        $result .= $this->renderTitle();
        $this->prepareFavicon();
        $result .= preg_replace('/  type\=\"text\/javascript\" /', '', $this->renderAssets($this->getAvailableResultGroups()));
        $result .= $this->pageConfig->getIncludes();
        return $result;
    }
}


texts: Magento 1 - how to set a single product for free shipping?

texts: I want to give the specific product for free shipping and I tried "Attribute" rules and it doesn't work.


texts:
I try to save a value into a custom Magento 2 cache.

This is my code for the custom cache under Model/Cache/Type.php:

class Type extends \Magento\Framework\Cache\Frontend\Decorator\TagScope
{

const TYPE_IDENTIFIER = 'cache_tag';

const CACHE_TAG = 'CACHE_TAG';

/**
 * @param \Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool
 */
public function __construct(\Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool)
{
    parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG);
}

}

and this is the etc/cache.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Cache/etc/cache.xsd">
<type name="xxx_cache" translate="label,description" instance="XXX\XXX\Model\Cache\Type">
    <label>XXX Cache type</label>
    <description>XXX cache description.</description>
</type>

Now, I try to save and load data to this custom cache with:

$this->cache->save(serialize("Data"), md5("Identifier"));

$data = $this->cache->load(md5("Identifier"));

$this->logger->debug("Data: " . print_r(unserialize($data)), true);

This is the logger output:

[2017-08-07 09:37:08] main.DEBUG: Data:  {"is_exception":false} []

Why don't I get the string "Data" back?


texts: Magento 2: Need customer Sign-In/registraion form in checkout page

texts:
When a user who is not logged in (anonymous) clicks Proceed to checkout, I want them the be taken to the login page. Then, after they've logged in or registered, they should be taken back to the checkout page.
check several link like  Magento2: Add login form in checkout page.
but did not get any exact clearification.


texts: JQuery how to remove tr in table which are display none in CSS

texts: how to remove tr in a table which is display:none in CSS


texts: Styles.css seems VERY large in the new rwd theme

texts:
I've finally upgraded to 1.9 and am starting on a new responsive theme for my store based on the 1.9 rwd theme. It looks like eric and the llamas have done a great job.

I took a look at the styles.css file and it seems huge (11350 lines!) i currently have compass set to expanded and production. The old styles was somewhere around 1500 lines so i'm really asking 2 questions

is this expected? have i just made a big mistake on my compass config?
is this size style sheet really acceptable for a e-comm store?

and yes, i know thats techincally 3 questions :-)

TIA


texts: Optimize Magento code : taking too much time to load data using google API and Magento collection

texts:
I am using Google location (longitude/latitude api) to search location based on user input (longitude/latitude,country,city,location_id) so for that first I am loading Magento collection and iterating collection data and based on data i am sending request to google Api.
But it is taking too time to get result (around 15-20 sec).

$mapviewCollection = Mage::getModel("location/store")->getCollection();
            if (isset($country_id) && $country_id !== 'NULL') {
                $mapviewCollection->addFieldToFilter('website_id',    $country_id);
            }
            if (isset($city_id) && $city_id !== 'NULL') {
                $mapviewCollection->addFieldToFilter('city_id', $city_id);
            }
            if (isset($location_id) && $location_id !== 'NULL') {
                $mapviewCollection->addFieldToFilter('location_id', $location_id);
            }
            if (isset($brand_id) && $brand_id !== 'NULL') {
                $mapviewCollection->addFieldToFilter('id', $brand_id);
            }

        /* mapview of store within selected Kilometers */

        if (isset($area_km) && $area_km !== 'NULL') {

    $mapviewCollection->addFieldToSelect(array('id','store_name','latitude','longitude' ));
            $mapviews = $mapviewCollection->getData();

            if ($mapviews) {
                foreach ($mapviews as $mapview) {

                    if ($mapview['latitude'] != null && $mapview['longitude'] != null) {

                        $source = $latitude . ',' . $longitude;
                        $destination = $mapview['latitude'] . ',' . $mapview['longitude'];

                        $apikey = Mage::getStoreConfig('testapi/testapi_group/google_mapapi_key');
                        $url = "https://maps.googleapis.com/maps/api/distancematrix/json?origins=" . $source . "&destinations=" . $destination . "&mode=driving&language=en-US&key=" . $apikey;

                        $string = file_get_contents($url);
                        $json_a = json_decode($string, TRUE);
                        $distance = $json_a['rows'][0]['elements'][0]['distance']['value']; // distance in meters km = m / 1000.0
                        $distance = (float) ($distance / 1000);
                        if ($distance <= $area_km) {
                            $mapviewarr['test_id'] = $mapview['id'];
                            $mapviewarr['test_name'] = Mage::helper('mobileapi')->translate($mapview['store_name'], $locale);
                            $mapviewarr['latitude'] = $mapview['latitude'];
                            $mapviewarr['longitude'] = $mapview['longitude'];
                            $data[] = $mapviewarr;
                        }
                    }
                }

I have tried by writing simple mysql query also and found no change. Seems the time it is taking because of foreach loop.
Please help me how i can decrease the response time for time. Please give your suggestion ASAP.


texts: save data from a module if save config buton is click in admin configuration

texts:
save data from a module in database if save config button is click in admin configuration. Basically I want to disabled a module if disabled from admin. Actually disable functionality is not working. So I trying disabled module pro grammatically I have created a controller with update query but this works when I hit the controller in front end. Basically My query disable module from general but my query will disable from advance/advance.

Path of controller - Vendor/Module/Controller/index/index.php

function in controller that I trying to update :-

public function execute()
{
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager
        $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
        $connection = $resource->getConnection();
        $tableName = $resource->getTableName('core_config_data');
   echo $isEnabled = $this->helperData->isEnable();

   if ($isEnabled==1) {
        //gives table name with prefix

        //Select Data from table
        echo $sql = "Update " . $tableName . " Set value = 0 where path ='advanced/modules_disable_output/Vendor_Module'";
        $connection->query($sql);

        }

        //return $result->setData($methods);

    else {
        echo $sql = "Update " . $tableName . " Set value = 1 where path ='advanced/modules_disable_output/Vendor_Module'";
        $connection->query($sql);

        }
}


texts:
I want to create a new directive to allow dynamic content to be added to CMS pages in Magento 2.1

I've found this article for Magento 1.7:

Add new custom CMS template directive {{cdnmedia}}

Can anyone tell me how the procedure varies from this for 2.1?


texts:
In my category listing page, I want to show 'Add to Cart',Add to Wishlist,Add to Compare on product hover. Any idea to show an icon on product hover in list page.Please help .Thanks in advance.

http://i.prntscr.com/042f9bda611d489ea4d188c41607e147.png


texts: Have no any image and data after install magento 2.3

texts:
I have cloned Magento 2.3 from this link to develop code and create new item
enter link description here
But when I install finished, the home page looks like this

I fixed the code in folder \lib\internal\Magento\Framework\View\Element\Template\File\Validator.php like this

$realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));

But it does not have any change, still no data, no image.
If anyone can have me this problem, it will very useful for me! Please


texts: Magento2: Aws CloudFront Product Image cache issue

texts:
I have integrated Aws CloudFront in our Magento 2 site.

Product image not showing in our site.

How to solve product cache issue.
When I used CloudFront CDN URL. All images stored in the S3 bucket
so why is creating a folder again in the media folder.


texts:
I know that it is possible to create dropdowns using the EAV strategy used in Magento, yet I was not able find any information over creating a dropdown in an entity without using EAV.

Does someone have an example somwhere, either online or in the core magento code?

I am working on magento ce 1.9.2.1
Thanks


texts: What study material required for Magento 2 Professional Developer Exam?

texts: Can anyone suggest me which pdf,tutorial or need to buy some practice test papers to the Magento 2 Professional Developer exam.


texts: How to get attribute values for products in Magento 1.9

texts:
Can anyone suggest me how to get the attribute value for products in magento, and where to use the coding in backend. I'm totally new to this concept. please post the exact codings.

$attribute= Mage::getResourceModel('catalog/product')->getAttributeRawValue($product_id, 'attribute_code', $storeId);

The above is the coding which i tried. Instead of $product_id i gave the number for the particular product id. How to check, where it is working


texts:
Is Magento giving any default REST API for retrieving configuration (system.xml) data ?.

If yes then share URL.
Else share the best approach for retrieving configuration data via REST API.


texts:
New to Magento, and reading the documentation, but I am trying to start  off with a simple landing page for a new product. I could easily make this thing in html/css/js in a matter of hours, but I am completely lost as to what approach to take with Magento.

Should I be overriding a template? Inheritting from a theme and then creating files that will extend some layout? Should I be editing phtml files to do this?

I know the visual that I am trying to execute, and aside from a contact us about the product form there is nothing about the page that needs to be tied into the backend even.

I noticed you can input HTML into the content field. Is this an antipattern? I would really appreciate even a tiny answer saying: 'try reading about this.' or 'Oh, you might just need to create a blank template and then add some static files', etc.

Edit here's what I've done so far (and it seems to be working):

1) created a new page under content > pages.

2) created a new storefront theme (following these frontend developer guide instructions) extending Magento Blank (seems Blank is important, couldn't just extend Luma for some reason)

3) to get the html content that I wanted, I went to content > pages and clicked edit on the page I had created. I then went to content, selected the HTML format (little button on the toolbar) and pasted in my HTML content.

4) In order to get my custom styles to apply, I had to extend the default_head_blocks.xml file:

app/design/frontend/<company>/<theme>/Magento_Theme/layout/default_head_blocks.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/framework/Module/etc/module.xsd">
  <head>
    <css src="css/usfrienbr.css"/>
  </head>
</page>

Don't forget to apply your custom theme to the page!

What do you Magento veterans think? Is this an antipattern? Would there have been a better way to create this landing page?


texts: How to check a checkbox dynamically Knockout js Magento 2

texts:
I am not able to check my checkbox dynamically in knockoutjs.

<input type="checkbox" class="checkbox" name="giftoptions" id="printedCard" data-bind="checked: getObservable('printedCard')()"/>

The checkbox only gets checked after reloading the page.
How to check the checkboxes without reloading the page?

On the contrary, textboxes are getting updated

<input type="text" class="input-text" data-bind="value: getObservable('sender'), attr: { id: 'gift-message-whole-from-' + index }"  placeholder="From (Optional)"/>

After the post-call when I call the  getObservable('sender') on the other HTML page it shows me the recent typed values


texts: Best seller sort order pagination query string not working correctly

texts:
our website having two sort order. one is position and another is best seller.
but when i select the best seller sort order that time showing all the best seller products. but problem  when select category under best seller and going to 2 page or 3 page pagination that time 1st page is showing. not working pagination when select the best seller.

when select position sort order and category then url look like and pagination working correct

 www.website.com/kit/kit-faucet.html?p=1&cat=555
 www.website.com/kit/kit-faucet.html?p=2&cat=555

when select bestseller sort order and category then url look like and cat query string not display in url

www.website.com/kit/kit-faucet.html?p=1
 www.website.com/kit/kit-faucet.html?p=2


texts:
I want to know where Magento handle the filter of admin grid

For example, when you search something in the grid, how it handled the search and reload the grid?

Thank you very much.


texts: How can I remove the block "stock status" from product page via xml?

texts:
I need to remove a block which is called in catalog.xml:

<PRODUCT_TYPE_simple translate="label" module="catalog">
    Catalog Product View (Simple)
    <reference name="product.info">
        <block type="catalog/product_view_type_simple" name="product.info.simple" as="product_type_data" template="catalog/product/view/type/default.phtml">
            <block type="core/text_list" name="product.info.simple.extra" as="product_type_data_extra" translate="label">
                Product Extra Info
            </block>
        </block>
    </reference>
</PRODUCT_TYPE_simple>

I tried it in my own local.xml with following code. But both don't work:

<?xml version="1.0" encoding="UTF-8"?>
<layout>
<PRODUCT_TYPE_simple>
<reference name="product.info">
<remove name="product.info.simple"/>
</reference>
</PRODUCT_TYPE_simple>
</layout>

<?xml version="1.0" encoding="UTF-8"?>
<layout>
<catalog_product_view>
<reference name="product.info">
<remove name="product.info.simple"/>
</reference>
</catalog_product_view>
</layout>

Thank you for your help!


texts: Magento 2: How to call helper function in Controller

texts:
How to call helper function in controller:-

I have use below code:-

class Index extends \Magento\Framework\App\Action\Action
{
    protected $helperData;

    public function __construct(
         ....
        \{Vendor}\{Module}\Helper\Data $helperData,
        ....
    ) {
        ....
        $this->helperData = $helperData;
        ....
    }

    public function execute()
    {
        $this->helperData-><functionName>();
        return;
    }
}

this code give me error as below:-

Uncaught TypeError: Argument 2 passed to {Vendor}\{Module}\Controller\Callforprice\Index::__construct() must be an instance of {Vendor}\{Module}\Helper\Data, none given, called in


texts: Full page reload whenever I change category or product - Why?

texts:
Instead of loading the relevant portion of the page,  the full page reloads when I change categories, product or any other part of the page.
This results in  bad browsing experience and eyes ache...
Any idea of how to prevent it?


texts: I am getting an issue anytime I try to use the magento 2 CLI:


texts: Magento2 - Admin panel loader keep loading don't stop

texts:
I installed Magento on localhost and login in admin panel but admin panel loader keeps loading. Admin panel did not load properly.

I have attached the screen shot here.


texts: Configurable products not showing after price indexing

texts:
After migrating my Magento DB to 1.14, configurable products are not showning anymore in product category list.

On Indexing, the child products are indexed into catalog_product_index_price, but not the configurable product.

The reason why is that Magento Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable::_applyConfigurableOption() delete product where parent_id is NULL before moving it from catalog_product_index_price_final_tmp to the catalog_product_index_price table

Mage_Catalog_Model_Resource_Product_Indexer_Price_Configurable (line 234)

        $select = $write->select()
        ->from($table)
        ->join(
            array('e' => $this->getTable('catalog/product')),
            'e.entity_id = i.entity_id',
            array())
        ->joinLeft(
            array('coa' => $coaTable),
            'coa.parent_id = i.entity_id',
            array())
        ->where('e.type_id = ?', $this->getTypeId())
        ->where('coa.parent_id IS NULL');

    $query = $select->deleteFromSelect('i');
    $write->query($query);

If I comment out this code, configurable products would show up on the frontend after the price re-index.

Any body knows why this configurable products cleanup was added in price reindex ?


texts:
i have system.xml as follow:

                    <export translate="label">
                        <label>Export</label>
                        <frontend_model>velajne_adminhtml/system_config_form_field_exportjne</frontend_model>
                        <sort_order>80</sort_order>
                        <show_in_default>0</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>0</show_in_store>
                    </export>

and config.xm as follows:

    <models>
        <velajne>
            <class>Vela_Jne_Model</class>
            <resourceModel>velajne_mysql4</resourceModel>
        </velajne>
        <velajne_adminhtml>
            <class>Vela_Jne_Model_Adminhtml</class>
        </velajne_adminhtml>
        <velajne_shipping>
            <class>Vela_Jne_Model</class>
            <resourceModel>velajne_mysql4</resourceModel>
        </velajne_shipping>

Why does it produce errors like this

Warning: include(Mage\Velajne\Adminhtml\Block\System\Config\Form\Field\Exportjne.php): failed to open stream: No such file or directory  in D:\WWW\Domains\magentodev.local\htdocs\lib\Varien\Autoload.php on line 93

It seems that it can't resolve velajne_adminhtml correctly.
if i use just velajne or velajne_shipping it resolved correctly.


texts: Magento Catalog price including tax is showing wrong calculation

texts:
Magento catalog price showing price excluding tax but all the settings are inclusive of tax.
My product price is Inclusive of Taxes; Say 1000
In Calculation Settings -> Catalog Price = Including Tax
In Price Display Settings -> Display Product Prices In Catalog = Inclusive Tax
But the price in catalog shows deducting tax amount from the price mentioned in Product from admin panel.
Very strange, if I choose to show inclusive and exclusive both. I get both prices as same on frontend.
Also, if I choose, In Calculation Settings -> Catalog Price = Exclusive.
Frontend shows price as correct as 1000 but within few hours if I visit the page again. It shows 1000 - taxes.
I these steps when I try, I am cleaning the cache properly, even generating static files again.


texts: Reorder does not set previous selected option of product in Magneto 2

texts: When I am trying to reorder in magneto 2.4 ,if any product have custom option in it ,it does not set that option while reorder that item. How can I set previous option while reorder.


texts: How to solve "Setup version for Namespace_Module is not specified issue"

texts:
I have been trying to install ultimo theme and after installation, I am getting this error:

1 exception(s):
Exception #0 (UnexpectedValueException): Setup version for module 'Infortis_Infortis' is not specified

Exception #0 (UnexpectedValueException): Setup version for module 'Infortis_Infortis' is not specified
#0 /var/www/html/quitling/vendor/magento/framework/Module/DbVersionInfo.php(56): Magento\Framework\Module\DbVersionInfo->isModuleVersionEqual('Infortis_Infort...', '2.0.0')
#1 /var/www/html/quitling/vendor/magento/framework/Module/DbVersionInfo.php(79): Magento\Framework\Module\DbVersionInfo->isSchemaUpToDate('Infortis_Infort...')
#2 /var/www/html/quitling/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(55): Magento\Framework\Module\DbVersionInfo->getDbVersionErrors()
#3 /var/www/html/quitling/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#4 /var/www/html/quitling/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#5 /var/www/html/quitling/vendor/magento/module-page-cache/Model/App/FrontController/VarnishPlugin.php(55): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#6 /var/www/html/quitling/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\PageCache\Model\App\FrontController\VarnishPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#7 /var/www/html/quitling/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#8 /var/www/html/quitling/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(68): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#9 /var/www/html/quitling/vendor/magento/framework/Interception/Interceptor.php(142): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#10 /var/www/html/quitling/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#11 /var/www/html/quitling/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#12 /var/www/html/quitling/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#13 /var/www/html/quitling/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#14 {main}

I have checked, module.xml is fine and have tried several references of stackexchange but none of them worked. Database has proper entry of it.

Here is my module.xml file:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
  <module name="Infortis_Infortis" setup_version="2.0.0"/>
</config>

Please help to solve.


texts: Magento 2 Programatically created customer login is not working

texts:
I have created customer using following links:

https://meetanshi.com/blog/create-customers-programmatically-in-magento-2/   OR
How to add a customer programmatically in Magento 2?

The customer is created and I can see it in the customers list using admin account.

But I am unable to login into the storefront using the provided credentials which I used during programatically creation process. When I try to login, I get following error:

  The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.

I have a clue when I checked the database, but I could not find the actual issue. The clue is for the customer entry in customer_entity table:

store_id & website_id is 0 while normal customers have non-zero value.
created_in column value is "Admin" while customer has value "Default store view".
rp_token and rp_token columns contains NULL value while normal customer have some values.

I am unable to trace the exact issue. And suggest what should be the solution..

Thanks in advance!


texts:
I am trying to Filter the products based on vendorid with attribute_set_id.
if i use print_r in the collection i am getting the result like below

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $productCollectionFactory = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');
    $collection = $productCollectionFactory
        ->create()
        ->addAttributeToSelect('*')
        ->addFieldToFilter('vendor_id', $vendorId)
        ->addFieldToFilter('attribute_set_id', array('neq' => '11'))
        ->addFieldToFilter('attribute_set_id', array('neq' => '12'))
        ->load();

     echo "<pre>";print_r($collection->getData());exit();

Output :

Array
(
    [0] => Array
        (
            [entity_id] => 508
            [attribute_set_id] => 4
            [type_id] => simple
            [sku] => simple-shop4-1
            [has_options] => 0
            [required_options] => 0
            [created_at] => 2019-08-29 09:46:36
            [updated_at] => 2019-08-29 09:46:36
            [vendor_id] => 36
            [is_salable] => 1
        )

)

The above result is true. but when i execute i am getting the below error like

  SQLSTATE[42S22]: Column not found: 1054 Unknown column
  'e.attribute_set_id' in 'where clause', query was: SELECT
  FLOOR((ROUND((e.min_price) * 1, 2)) / 10) + 1 AS range, COUNT(*) AS
  count FROM catalog_product_index_price AS e  INNER JOIN
  catalog_product_entity_int AS at_vendor_id ON
  (at_vendor_id.entity_id = e.entity_id) AND
  (at_vendor_id.attribute_id = '166') AND (at_vendor_id.store_id
  = 0)  INNER JOIN cataloginventory_stock_status AS stock_status_index ON e.entity_id = stock_status_index.product_id
  INNER JOIN catalog_category_product_index_store1 AS cat_index ON
  cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND
  cat_index.visibility IN(2, 4) AND cat_index.category_id=2 WHERE
  (at_vendor_id.value = '36') AND (e.attribute_set_id != '11') AND
  (e.attribute_set_id != '12') AND (stock_status_index.stock_status
  = 1) AND (at_vendor_id.value = '36') AND ( e.website_id = '1' ) AND ( e.customer_group_id = 0) AND (e.min_price IS NOT NULL) GROUP BY
  FLOOR((ROUND((e.min_price) * 1, 2)) / 10) + 1 ORDER BY
  (FLOOR((ROUND((e.min_price) * 1, 2)) / 10) + 1) ASC

Anyone have any idea about this.
Thanks in Advance.


texts: Calling a JS function from a widget from a different widget?

texts:
How can I call giveAlert() function that's in newsletter.js from within landingpage.js?
landingpage.js
define([
    "jquery",
    "Ignite_Orgbf/js/js.cookie",
    "Ignite_Orgbf/js/newsletter",
    "domReady!",
    "magnificpopup"
], function($,Cookies, newsletter){
    "use strict";

    $.widget('custom.mbLandingPage', {
        _create: function() {
            newsletter.giveAlert();
            // DOESN'T WORK
...
...
...
    return $.custom.mbLandingPage;

newsletter.js
define([
    "jquery",
    "Ignite_Orgbf/js/js.cookie",
    "domReady!",
    "magnificpopup"
], function($,Cookies){
    "use strict";

    $.widget('custom.mbNewsPopup', {
        giveAlert: function(){
            alert("TEST");
        },
...
...
...
    return $.custom.mbNewsPopup;


texts: `getLastPageNumber()` returning wrong number of pages

texts:
For some reason, using $collection->getLastPageNumber() is returning the wrong number of pages.

For example:

$collection->addFieldToFilter('visibility', Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE);
$collection->getSelect()->joinLeft(array('link_table' => 'catalog_product_super_link'),'link_table.product_id = e.entity_id',
            array('product_id','parent_id')
        );
$collection->getSelect()->group('link_table.parent_id');

I'm not quite sure what the issue might be. I'm using joinLeft and group on my collection, as seen above. As far as I can tell, it's the only thing 'out of the ordinary' that I'm doing.

When I debugged the query, it returned, for example, 625 rows. But, using a pagelimit of 10, and then calling getLastPageNumber() returns a total of 325 pages, instead of 62 pages!

What might be causing such an issue?

EDIT:
The query is:

  SELECT e.*, IF(at_visibility.value_id > 0, at_visibility.value, at_visibility_default.value) AS visibility, link_table.product_id, link_table.parent_id, color_t1.attribute_id, color_t1.value, color_t1.store_id, at_stock_status.stock_status, price_index.price, price_index.tax_class_id, price_index.final_price, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS minimal_price, price_index.min_price, price_index.max_price, price_index.tier_price FROM catalog_product_entity AS e
   INNER JOIN catalog_product_entity_int AS at_visibility_default ON (at_visibility_default.entity_id = e.entity_id) AND (at_visibility_default.attribute_id = '102') AND at_visibility_default.store_id = 0
   LEFT JOIN catalog_product_entity_int AS at_visibility ON (at_visibility.entity_id = e.entity_id) AND (at_visibility.attribute_id = '102') AND (at_visibility.store_id = 1)
   LEFT JOIN catalog_product_super_link AS link_table ON link_table.product_id = e.entity_id
   LEFT JOIN catalog_product_entity_int AS color_t1 ON color_t1.entity_id = e.entity_id AND color_t1.store_id = 0 AND color_t1.attribute_id = 92
   LEFT JOIN cataloginventory_stock_status AS at_stock_status ON (at_stock_status.product_id=e.entity_id) AND (at_stock_status.stock_id=1)
   INNER JOIN catalog_product_index_price AS price_index ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = '1' WHERE (IF(at_visibility.value_id > 0, at_visibility.value, at_visibility_default.value) = '1') GROUP BY link_table.parent_id,
          color_t1.value


texts: Magento2 - How to reorder my account sidebar nav link?

texts:
How to reorder my account sidebar nav link  in Magento2

ACCOUNT DASHBOARD
MY ORDERS
ADDRESS BOOK
ACCOUNT INFORMATION
MY PRODUCT REVIEWS
NEWSLETTER SUBSCRIPTIONS

How to Re arrange the nav links.


texts: ACL working but checkboxes not selected in role edit form

texts:
I have coded a module with 3 features (and 3 menupoints). Then i copied the menu-section and edited it so it is useable as ACL resource.

It looks like this (adminhtml.xml):

<config>
    <menu>
        <MyModule translate="title" module="MyModule">
            <title>MyModule</title>
            <sort_order>99</sort_order>
            <children>
                <feature1 translate="title" module="MyModule">
                    <title>F1</title>
                    <sort_order>1</sort_order>
                    <action>MyModule/index/feature1</action>
                </feature1>
                <feature2>
                    <title>F2</title>
                    <sort_order>2</sort_order>
                    <action>MyModule/index/feature2</action>
                </feature2>
                <feature3>
                    <title>F3</title>
                    <sort_order>3</sort_order>
                    <action>MyModule/index/feature3</action>
                </feature3>
            </children>
        </MyModule>
    </menu>
    <acl>
        <resources>
            <admin>
                <children>
                    <MyModule translate="title" module="MyModule">
                        <title>MyModule</title>
                        <sort_order>99</sort_order>
                        <children>
                            <feature1 translate="title" module="MyModule">
                                <title>F1</title>
                                <sort_order>1</sort_order>
                            </feature1>
                            <feature2>
                                <title>F2</title>
                                <sort_order>2</sort_order>
                            </feature2>
                            <feature3>
                                <title>F3</title>
                                <sort_order>4</sort_order>
                            </feature3>
                        </children>
                    </MyModule>
                </children>
            </admin>
        </resources>
    </acl>
</config>

now the strange thing is, it is working, but in magento if I edit the the roles it doesnt show up as checked its always unchecked in role resources.
I even checked the database and it saved the correct value (allow/deny).


texts:
I am currently patching Magento with the latest patches and wondered whether it is worth applying the patches or upgrading to the latest version?

As far as I can tell the only changes seem to be the patches being included in the Magento files? Or should I just upgrade from 1.9.1.1 to 1.9.2.1?


texts: How to display front end custom block to admin order view page

texts:
I want to echo the following block to admin order view page.

echo $this->getLayout()->createBlock('compatibility/compatibilityblock')->setTemplate('tm/compatibility/savequote.phtml')->tohtml();

I have tried the following way but not worked.

echo $block = Mage::app()->getLayout()
->createBlock('compatibility/compatibilityblock')
->setData('area','frontend')
->setTemplate('tm/compatibility/savequote.phtml')->tohtml;


texts:
I'm trying to add a product to a quote in admin (programmatically), the model of the quote is sales/quote, as seen in sales_order_place.

Problem is the quote will not accept products which are out of stock, even though I've called Mage::helper('catalog/product')->setSkipSaleableCheck(true);?

I want to have the ability to add products to the quote regardless of their stock status.

Any ideas?


texts:
This is the header of my website

How to get my account to a file phtml


texts: Unable to redirect to cart page from observer?

texts:
Here is the code, please review and advise.

  Demo/Test/etc/frontend/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="layout_generate_blocks_before">
        <observer name="Demo_check_for_vision_user_session" instance="Demo\Test\Observer\CheckForTestUserSession" />
    </event>
</config>

  Demo/Test/Observer/CheckForTestUserSession.php

<?php

namespace Demo\Test\Observer;

use Psr\Log\LoggerInterface;
use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Session\SessionManagerInterface;
use Magento\Framework\App\Request\Http;
use Magento\Framework\UrlInterface;
use Magento\Framework\App\ResponseFactory;
use Magento\Framework\App\Response\RedirectInterface;
/**
 * Class CheckForTestUserSession
 * @package Demo\Test\Observer
 */
class CheckForTestUserSession implements ObserverInterface
{
    /**
     * @var SessionManagerInterface
     */
    private $coreSession;

    /**
     * @var LoggerInterface
     */
    private $logger;

    /**
     * @var Http
    */
    protected $request;

    /**
    * @var UrlInterface
    */
    protected $url;

    /**
    * @var ResponseFactory
    */
    protected $responseFactory;

    /**
    * @var RedirectInterface
    */
    protected $redirect;

    /**
     * constructor
     */
    public function __construct(
        LoggerInterface $logger,
        SessionManagerInterface $coreSession,
        Http $request,
        UrlInterface $url,
        ResponseFactory $responseFactory,
        RedirectInterface $redirect

    ) {
        $this->logger = $logger;
        $this->coreSession = $coreSession;
        $this->request = $request;
        $this->url=$url;
        $this->responseFactory = $responseFactory;
        $this->redirect = $redirect;

    }

    /**
     * Vision redirects a customer
     *
     * @param Observer $observer
     */
    public function execute(Observer $observer)
    {
        $action = $observer->getEvent()->getFullActionName();
        $SID= $this->request->getParam('SID');
        //$layout = $observer->getEvent()->getLayout();
        //$custId = $this->getRequest()->getParam('id');
        $writer = new \Zend\Log\Writer\Stream(BP.'/var/log/magento11.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        if($SID){

        $controller = $observer->getControllerAction();
        $this->redirect->redirect($controller->getResponse(), 'checkout/cart');
        }
    }

}


texts:
I have several grouped products and cannot determine what is determining the sort order of them in the catalog view.
Here are 3 examples:

ID      SKU                         Description                                                 Price       type
6899    PUBINSURANCEESSENTIALS      Insurance Essentials                                                    grouped
6900    PUBINSESS2011               Insurance Essentials (Print)                                $65.00      simple
6901    EPUBINSESS2011              Insurance Essentials (eBook - PDF Format)                   $45.00      downloadable

ID      SKU                         Description                                                 Price       type
11317   PUBHISTORY                  A Tedious Brief History of Insurance                                    grouped
11316   EPUBHIST1EPB                A Tedious Brief History of Insurance (eBook - EPUB Format)  $15.00      downloadable
11315   EPUBHIST1PDF                A Tedious Brief History of Insurance (eBook - PDF Format)   $15.00      downloadable
11314   PUBHISTORY2015              A Tedious Brief History of Insurance (Print)                $25.00      simple

ID      SKU                         Description                                                 Price       type
8062    PUBNETINCOMERISKMANAGEMENT  Net Income Risk Management                                              grouped
8063    PUBNETRISKMGT12             Net Income Risk Management (Print)                          $45.00      simple
8064    EPUBNETRISKMGT              Net Income Risk Management (eBook - PDF Format)             $35.00      downloadable

But, they show like this:

I'm not sure what it is that is causing them to be sorted the way they are. I'd like them to all be sorted the same way. Any ideas?

Magento v1.4.0.1


texts: Override admin block file issue in magento2

texts:
I am trying to override block file of adminhtml of sales module.

Below is the code of my di.xml

 <?xml version="1.0"?>
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
   <preference for="Magento\Sales\Block\Adminhtml\Order\Create\Form\Address" type="Vendor\Module\Block\Adminhtml\Order\Create\Form\Address" />

</config>

I have used the Address.php file from this path

  Magento\Sales\Block\Adminhtml\Order\Create\Form

and moved
into my module , but the block file is not overrided,

here is the code of my block file

  <?php

   namespace Vendor\Module\Block\Adminhtml\Order\Create\Form;

   use Magento\Backend\Model\Session\Quote;
   use Magento\Framework\App\ObjectManager;
   use Magento\Framework\Data\Form\Element\AbstractElement;
   use Magento\Framework\Pricing\PriceCurrencyInterface;
   use Psr\Log\LoggerInterface;

   class Address extends \Magento\Sales\Block\Adminhtml\Order\Create\Form\Address
{
public function __construct(
    \Magento\Backend\Block\Template\Context $context,
    \Magento\Backend\Model\Session\Quote $sessionQuote,
    \Magento\Sales\Model\AdminOrder\Create $orderCreate,
    PriceCurrencyInterface $priceCurrency,
    \Magento\Framework\Data\FormFactory $formFactory,
    \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor,
    \Magento\Directory\Helper\Data $directoryHelper,
    \Magento\Framework\Json\EncoderInterface $jsonEncoder,
    \Magento\Customer\Model\Metadata\FormFactory $customerFormFactory,
    \Magento\Customer\Model\Options $options,
    \Magento\Customer\Helper\Address $addressHelper,
    \Magento\Customer\Api\AddressRepositoryInterface $addressService,
    \Magento\Framework\Api\SearchCriteriaBuilder $criteriaBuilder,
    \Magento\Framework\Api\FilterBuilder $filterBuilder,
    \Magento\Customer\Model\Address\Mapper $addressMapper,
    array $data = []
) {
    parent::__construct(
        $context,
        $sessionQuote,
        $orderCreate,
        $priceCurrency,
        $formFactory,
        $dataObjectProcessor,
        $directoryHelper,
        $jsonEncoder,
        $customerFormFactory,
        $options,
        $addressHelper,
        $addressService,
        $criteriaBuilder,
        $filterBuilder,
        $addressMapper,
        $data
     );
  }

  public function getAddressCollection()
   {
    //echo $this->getCustomerId();exit;
    if ($this->getCustomerId()) {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $customerObj = $objectManager->create('Magento\Customer\Model\Customer')->load($this->getCustomerId());
        $customerMasterId = $customerObj->getMasterId();
        $filter = $this->filterBuilder
            ->setField('parent_id')
            ->setValue($customerMasterId)
            ->setConditionType('eq')
            ->create();
        $this->searchCriteriaBuilder->addFilters([$filter]);
        $searchCriteria = $this->searchCriteriaBuilder->create();
        $result = $this->addressService->getList($searchCriteria);
        return $result->getItems();
    }
    return [];
  }
}

Anywhere i am wrong? Its not overriding into my module. Please anybody help me. Thanks


texts: I have a question about m2 preferences (overwriting core modules). Whenever I overwrite a core module, do I have to inject all the classes the same way original class does? Also what should I extend? The class that I'm trying to overwrite or the class that the overwritten class is extending?


texts: Magento 2 - How to update grand total when shipping method is changed?

texts:
How can I update the grand total value when shipping method is changed to reflect new calculation?

When you change the shipping method here,

It must reflect the new calculation in TOTAL section.


texts: Main menu not redirect to url in mobile view

texts:
How can I change this in fresh Magento?

In mobile view, On click of the arrow, i want to open sub menu list.

In mobile view, On click of the main menu tab, I want to open main menu tab URL.


texts: How do I stop the Magento cache increasing image filesize?

texts:
This problem is specific to already well compressed jpegs.  When Magento is re-saving them to the cache, it increases the file size.  In some cases almost doubling the size compared to the original.  Obviously, the bigger the image, the greater the problem in absolute terms (of lost bandwidth/ performance).

This is somewhat infuriating!  How can I stop Magento messing with my images; and why on earth is it adding pixel data?!

I’m only allowed to post links to one example.  However, I could pick any image, it is increasing them all:

Original Image  - https://www.logsdirect.co.uk/media/catalog/product/p/e/peat-pallet-french-bottom_1.jpg (75 KB)

Cached version  -  https://www.logsdirect.co.uk/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/p/e/peat-pallet-french-bottom_1.jpg  (137 KB)


texts: How to send an array of objects in email in magento 2?

texts:
I need a way to send an array of objects in email, So I can iterate those and create a table in email. I have tried creating email handle but no success.

Any help is much appreciated!

Thanks


texts: How can use {{ block ... }} for a phtml file

texts:
I want to use {{block type="blog/blog" name="blog" alias="list_blog" template="aw_blog/bloghome.phtml"}} in phtml file, but I don't know how, because this code useable for cms page but I need output of this line in a phtml file.

How can I do it?


texts: Customer address problems after migration from Magento 1.9.2.3 to Magento 2.3.3

texts:
I have checked the eav_attribute_set and I do not have any attribute set with entity id 2,
I checked many solutions but has no luck till now, Please help me to out from this problem,


texts: How to sort product collection by sales in Magento 2

texts:
I need to sort products on catalog page by ordered quantity.

What is the best way to do it?

I know that table sales_order_item contains this data, but I think direct SQL queries is bad practice (like SELECT SUM(qty_ordered) FROM sales_order_items WHERE product_id = {$product id} and then sort it).

So I want to find good solution.

Thanks!


texts: Image from BO template are not displaying in email

texts:
I call my email template from my controller and send variables to it so I don't need to rewrite the entire template (header & footer) especially because they might change during time.
So, I'm using this function in my execute() controller :
.....
$transport = $this->_transportBuilder
                ->setTemplateIdentifier(132)
                ->setTemplateOptions(
                    [
                        'area' => 'frontend',
                        'store' => $this->storeManager->getStore()->getId()
                    ]
                )
                ->setTemplateVars([
                    'email' => $email,
                    'result' => $this->resultText(
                        $result_acuity,
                        $result_astigmatism,
                        $result_contrast,
                        $result_vision_lecture,
                        $result_vision_colors,
                        $result_colors,
                        $result_DLMA
                    )
                ])
                ->setFrom($sender)
                ->addTo($email, $name)
                ->addTo($sentToEmail,$sentToName)
                ->getTransport();

            $transport->sendMessage();
....

Inside of it, I call my template with the id number from my BO :
->setTemplateIdentifier(132)

I receive the email correctly except for the media. Those are stored in BO wysiwyg and are correctly displaying when I do the preview temmplate (they are called in the template, not in controller)
Is there something I need to know for it to work ?


texts: Magento2 - Price Layered Navigation Issue

texts:
When a product price is more than 100,000 . The price filter showing only two options

13,000 - 100,000
100,000 - 130,000

As filterable options , When i disabled the product which is having price more than 100,000. It is displaying following filter options.

10,000 - 20,000
20,000 - 30,000
30,000 - 40,000
40,000 - 50,000
50,000 - 60,000
60,000 - 70,000
70,000 - 80,000
80,000 - 90,000

Why the layered navigation displaying like this? Why it is not displaying other product price filter options if the product price is more than 100,000. Any settings needs to be changed?


texts: How can I add the available quantity per product on catalog on Magento 2.3?

texts:
On a category page, I try to display the available quantity per product but I cannot succeed.
On the admin interface, as described in the manual, I have enabled for the attribute called quantity_and_stock_status the Storefront Property -> Used in Product Listing.

On the code part, I override the list.phtml file on my custom theme(luma child), on path app\design\frontend\Vendor_name\Theme_name\Magento_Catalog\templates\product. I know it is a valid file as other modifications work.
In there I call $_product_stock = $_product->getQty() but I get just 0.
I also tried $_product->getExtensionAttributes()->getStockItem()->getQty() with no luck either.

Should I make a module for that or there is a configuration I am missing?

Thank you very much in advance for your help!


texts:
I just installed Magento 2.1.9 on CentOS 7.4.  I have configured MySql 5.7.17.  I am using the web-based Setup Wizard.

On the step for 'Add a Database' I get the error

  SQLSTATE[HY000] [2002] Permission denied

My MySql server is on a separate host from my Magento2.  I am able to connect to the MySql server using command line from the Magento2 server.

How can I get past this error in the web-based Setup Wizard?

mysql> SHOW GRANTS FOR CURRENT_USER;
+------------------------------------------------------+
| Grants for magento@%                                 |
+------------------------------------------------------+
| GRANT USAGE ON *.* TO 'magento'@'%'                  |
| GRANT ALL PRIVILEGES ON `magento`.* TO 'magento'@'%' |
+------------------------------------------------------+
2 rows in set (0.01 sec)


texts:
I'm just started playing with magento2 frontend dev tools so I'm wondering if there is some configuration we can make in order to help PhpStorm to resolve the less variables like colours, sizes etc.

I'm talking about that:

I also found some missing definitions in that case:

Maybe I'm wrong and PhpStorm Isn't the right tool to work with less in magento, so if someone have any suggestion about another tool to use, we'll be appreciated too.


texts: Event "customer_register_success" not working in Magento1.9.2.4

texts:
Here  is the code-

app/etc/modules/Ds_Customerlog.xml -

<?xml version="1.0"?>
<config>
  <modules>
    <Ds_Customerlog>
      <active>true</active>
      <codePool>local</codePool>
      <version>0.1.0</version>
    </Ds_Customerlog>
  </modules>
</config>

app/code/local/Ds/Customerlog/etc/config.xml -

<?xml version="1.0"?>
<config>
  <modules>
    <Ds_Customerlog>
      <version>0.1.0</version>
    </Ds_Customerlog>
  </modules>
  <global>
    <helpers>
      <customerlog>
        <class>Ds_Customerlog_Helper</class>
      </customerlog>
    </helpers>
    <models>
      <ds_customerlog>
        <class>Ds_Customerlog_Model</class>
    </ds_customerlog>
    </models>
    <events>
      <customer_register_success> <!-- identifier of the event we want to catch -->
          <observers>
            <customer_register_success_handler> <!-- identifier of the event handler -->
              <class>Ds_Customerlog_Model_Observer</class> <!-- observers class alias -->
              <method>observer</method>  <!-- observer's method to be called -->
            </customer_register_success_handler>
          </observers>
        </customer_register_success>
    </events>
  </global>
</config>

app/code/local/Ds/Customerlog/Model/Observer.php -

<?php
class Ds_Customerlog_Model_Observer
{

    public function observer(Varien_Event_Observer $observer)
    {
        die("sfs");
        $customer = $observer->getEvent()->getCustomer();
        Mage::log($customer->getFirstname(), null, 'customer.log');
    }

}

Here die("sfs") not being executed on customer registration on both frontend and backend.
Any help would be appreciated.


texts: Change the default value of Custom Text box using plugin

texts:
I need to set default value for text box custom options based on some conditions. So that I used after plugin like below in di.xml of my module

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Block\Product\View\Options\Type\Text">
        <plugin name="set_default_custom_options_text" type="Company\Modulename\\Plugin\Block\ConfigurableProduct\Product\View\Options\Type\Text" sortOrder="1"/>
    </type>
</config>

and Text.php

<?php
namespace Company\Modulename\Plugin\Block\ConfigurableProduct\Product\View\Options\Type;
use \Magento\Catalog\Block\Product\View\Options\AbstractOptions;
Class Text {
    protected $_storeManager;
    public function __construct(
        \Magento\Store\Model\StoreManagerInterface $storeManager
    )
    {
        $this->_storeManager = $storeManager;
    }
    public function afterGetDefaultValue( \Magento\Catalog\Block\Product\View\Options\Type\Text $subject, $result )
    {
        if( $this->getOption()->getTitle() == 'munit' )
            $result = 1;

        return $result;
    }
}

In the above code if condition is not working, page just stop by displaying the option title.
Can you anyone help to find the issue?


texts:
I would like to override shipping method template of the progress block in checkout page. Below is the code I've tried but its not working. Any help would be appreciated.

<checkout_onepage_progress>
     <!-- Mage_Checkout -->
        <remove name="right"/>
        <remove name="left"/>

         <block type="checkout/onepage_progress" name="root" output="toHtml" template="checkout/onepage/progress.phtml">
             <action method="setInfoTemplate"><method></method><template></template></action>
             <block type="checkout/onepage_progress" name="shippingmethod.progress" template="newfolder/progress/shipping_method.phtml"></block>
        </block>
    </checkout_onepage_progress>
      <checkout_onepage_progress_shipping_method>
        <!-- Mage_Checkout -->
        <remove name="right"/>
        <remove name="left"/>

        <block type="checkout/onepage_progress" name="root" output="toHtml" template="newfolder/progress/shipping_method.phtml">
            <action method="setInfoTemplate"><method></method><template></template></action>
        </block>
    </checkout_onepage_progress_shipping_method>


texts: Duplicate meta titles / descriptions for review pages

texts:
Consider the following example:

KHAKI BOWERY CHINO PANTS

If you inspect page source, you'll notice:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Khaki Bowery Chino Pants - Pants &amp; Denim - Men</title>
<meta name="description" content="Straight leg chino. Back pockets with button closure. 14&quot; leg opening. Zip fly. 100% cotton." />
<meta name="keywords" content="Khaki Bowery Chino Pants" />
<meta name="robots" content="INDEX,FOLLOW" />

However, if you view the reviews page for said product (note the different URL /newstore/review/product/list/id/456/category/17/):

KHAKI BOWERY CHINO PANTS (All reviews page)

The same meta information exists in the page source:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Khaki Bowery Chino Pants - Pants &amp; Denim - Men</title>
<meta name="description" content="Straight leg chino. Back pockets with button closure. 14&quot; leg opening. Zip fly. 100% cotton." />
<meta name="keywords" content="Khaki Bowery Chino Pants" />
<meta name="robots" content="INDEX,FOLLOW" />

Using Google's Webmaster Tools, you can access the HTML Improvements section. Google is complaining about my review pages having identical values for meta descriptions & meta titles between the main product page & the review page.

Is there any way to resolve this, programmatically? Surely if Google is listing it here it requires being addressed?

I read this article - Search Engine Journal - 5 Duplicate Content Issues for Magento which mentions:

  3) Duplicate content from Review Pages
  Blockquote

  Review pages are interesting, because the issues can vary depending on
  how you structure your website and the plugin you’re using. We faced a
  duplicate content issue when we were displaying review content on
  product pages, but had a separate page for the same content—but I know
  that this is not always the case.

  So, for the scenario that we faced, we removed the extra pages (one
  for each product), which looked like this:

  /review/product/list/id/6585/

  In order to remove these pages, we simply disallowed the /review/
  directory in the robots.txt file and then submitted a removal request
  for the folder.

  Once again, review pages would only cause duplicate content issues if
  you’ve structured your website in the same way as we did, where you
  can go to a specific page to read product reviews, as well as on the
  product pages themselves.

It seems like natively, this issue exists with Magento (unless I'm mistaken - in which case please correct me).

So would that be the solution - to use your robots.txt file to disallow Google access to the /review/ directory?

The article mentions

  ...and then submitted a removal request for the folder.

I don't see the ability to use regular expressions on the Remove URLs page using Google Webmaster Tools though?

Edit: Apparently another solution could possibly be to use Canonical URLs on the review pages, though apparently Google can still persist and index the review page.

Source: Comments


texts: How to do work with custom module Admin Panel

texts:
I want to attach my template and block to custom module but how to manage it? I want to just print simple hello there with proper layout in admin panel
these are my files.

  app\code\local\Matrid\Feedmanager\etc\config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Matrid_Feedmanager>
      <version>0.1.0</version>
    </Matrid_Feedmanager>
  </modules>
  <frontend>
    <routers>
      <feedmanager>
        <use>standard</use>
        <args>
          <module>Matrid_Feedmanager</module>
          <frontName>feedmanager</frontName>
        </args>
      </feedmanager>
    </routers>
  </frontend>
<admin>
  <routers>
    <feedmanager>
     <use>admin</use>
     <args>
      <module>Matrid_Feedmanager</module>
      <frontName>admin_feedmanager</frontName>
     </args>
    </feedmanager>
  </routers>
</admin>
<global>
  <helpers>
    <feedmanager>
      <class>Matrid_Feedmanager_Helper</class>
    </feedmanager>
  </helpers>
</global>
<adminhtml>
 <layout>
        <updates>
      <matrid>
          <file>feedmanager.xml</file>
         </matrid>
     </updates>
    </layout>
 <menu>
 <catalog>
 <children>
   <feedmanager module="feedmanager">
     <title>Matrid_Feedmanager</title>
     <sort_order>31</sort_order>
    <children>
      <feedmanager module="feedmanager">
        <title>Manager_Items</title>
        <sort_order>2</sort_order>
        <action>admin_feedmanager/adminhtml_index</action>
      </feedmanager>
    </children>
   </feedmanager>
   </children>
   </catalog>
 </menu>
</adminhtml>
</config>

  app\code\local\Matrid\Feedmanager\controller\adminhtml\IndexController.php

 <?php

    class Matrid_Feedmanager_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action {
     protected function _isAllowed()
        {
            return true;
        }

      public function indexAction() {

            $this->loadLayout();
            $this->renderLayout();

      }

    }

  app\code\local\Matrid\Feedmanager\controller\IndexController.php

class Matrid_Feedmanager_IndexController extends Mage_Core_Controller_Front_Action{

    public function indexAction()
    {
        $this->loadLayout ();
        $this->renderLayout ();
    }
    public function anotherAction()
    {
        echo 'test mamethode';
    }
}

  app/design/frontend/default/electronics/layout/feedmanager.xml

<layout version="0.1.0">
    <default>
        <reference name="content">
        </reference>
    </default>
    <test_index_index>
        <reference name="content">
            <block type="feedmanager/mydata" name="feed_mydata" template="feedmanager/index.phtml" />
        </reference>
    </feedmanager_index_index>
</layout>


texts: How to prepare for Magento Developer Certification exam in 2 days?

texts: I have been developing for Magento for the last 6 months at my job, and I've created quite a few modules and fixed quite a few bugs. My employee booked an exam on Monday, they have the client coming on Tuesday and to impress them more, they want me to pass the exam. How should I prepare for it fast? Please don't close it, I really need help.


texts: Magento 2:- How to upload image in custom module in admin panel

texts:
Change the mode, then not working image preview got an error 404 image-preview.html

Developer mode working fine, but production mode not working form page

<field name="recipes_image">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">string</item>
            <item name="source" xsi:type="string">recipe</item>
            <item name="label" xsi:type="string" translate="true">Image</item>
            <item name="visible" xsi:type="boolean">true</item>
            <item name="formElement" xsi:type="string">fileUploader</item>
            <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
            <item name="previewTmpl" xsi:type="string">Dac_Recipes/image-preview</item>
            <item name="required" xsi:type="boolean">false</item>
            <item name="uploaderConfig" xsi:type="array">
                <item name="url" xsi:type="url" path="recipes/test/upload"/>
            </item>
            <item name="sortOrder" xsi:type="number">6</item>
        </item>
    </argument>
</field>


texts: quote item price information missing in checkout_cart_product_add_after event

texts:
I have implemented an observer for checkout_cart_product_add_after. I am retrieving the quote item by

$item = $observer->getEvent()->getQuoteItem();

However, I noticed, that any of the functions to retrieve the item's current price simply return NULL. I can't even access its ID!

On further inspection I see that the quote item only has the following data attributes set:

quote_id
store_id
product
product_id
product_type
sku
name
weight
tax_class_id
base_cost
is_recurring
is_qty_decimal
is_nominal
qty_to_add
qty
qty_options

Attributes like price, base_price, custom_price etc. are completely missing.

I am also observing the checkout_cart_update_items_after event, where I get the quote item in a different way:

$cart = $observer->getEvent()->getCart();
$data = $observer->getEvent()->getInfo();

foreach( $data as $itemId => $itemInfo )
{
    if( $item = $cart->getQuote()->getItemById( $itemId ) )
    {
        $item = $item->getParentItem() ?: $item;
        …
    }
}

In this case, all the relevant data is present.

Can anyone tell me, why the price data is missing for quote items in the checkout_cart_product_add_after event?


texts: Magento 2: How do I track configurable product inventory with intangible attributes?

texts:
I'm on Magento 2.2.3, and created some configurable product with multiple attributes and I would like to track my inventory.

Magento treats each variation as a simple product with it's own inventory, but I would like to track only the configurable parent product quantity itself since the attributes are either intangible or unlimited(such as added labor cost).

I've searched everywhere without success and I'm new to Magento. It's hard to imagine this is not possible to configure, I must've missed something.


texts: How to add Unsubscribe link at the bottom of transaction email footer?

texts: I'm trying to set up "unsubscribe link" to my email footer to my newsletter subscriber.  But, I cannot find any section regarding unsubscribe link or unsubscribe page.


texts:
I'm wondering if I can disable an extension for a particular store?

I am developing on a Magento install that has several existing stores and my new store is inheriting an Auto Search Complete extension and hijacking the default Magento search.

If I disable this extension for that store in System > Configuration > Advanced then it removes the custom search but does not enable the default search.

If I disable the extension globally via app/etc/modules/Mirasvit_SearchAutocomplete.xml by changing

<config>
    <modules>
        <Mirasvit_SearchAutocomplete>
            <active>true</active>
            <codePool>local</codePool>
        </Mirasvit_SearchAutocomplete>
    </modules>
</config>

to

<config>
<modules>
    <Mirasvit_SearchAutocomplete>
        <active>false</active>
        <codePool>local</codePool>
    </Mirasvit_SearchAutocomplete>
</modules>

then the default Magento search is reactivated (which is what I'm trying to achieve).

Can I do this only for my store view?


texts: REST API get result page count, or last page

texts:
I am sure I am missing something obvious today, as I just cannot work this out.

I am doing a REST call, to get all customers, paged at 100 results per page (forced limitation of max allowed per page = 100, ref: Mage_Api2_Model_Resource::PAGE_SIZE_MAX = 100)

so simple enough to fetch each page using a page filter. ref: Get All customers from Magento using rest API

All good and well, but how do you know how many pages there are, or know when you have reached the last page?

I did a test, and when I reach the last page + 1, the result just seems to be the last page results.

Surely the test is not to check:

if current results == previous results = last page reached

Any thoughts appreciated.


texts: Creating configurable products programmatically - pricing_value not saved

texts:
I have a custom xml file and I make a massive import of the products. I have some simples products under configurables ones. All is working well, configurable products are created with the simple products the "associated products" tab but one last thing still doesn't work : the price of each product.

Actually, Each simple product has its own price and the correct value is well saved in its attribute but in the "super product attribute configuration" panel, the values are empty.

When I fill the price fields manually, it works but it obviously must be done by the script, programmatically.

Here is my function to create the configurable product :

protected function createConfigurableProductFromSimpleProduct($product, $flagshipID)
{
    $configurableProduct = $product->duplicate();
    $configurableProduct->getResource()->save($configurableProduct);
    $configurableProduct= Mage::getModel('catalog/product')->load($configurableProduct->getId());

    $configurableProduct->setTypeId(Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE)
                     ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)
                     ->setSku($flagshipID)
                     ->setDefRef($product_id)
                     ->getTypeInstance()->setUsedProductAttributeIds(array($this->getAttributeId('root_colors'))); //attribute ID of attribute 'root_colors' in my store

    $configurableProduct->setName($configurableProduct->getName());
    $configurableProduct->setStatus(1);
    $configurableProduct->setStockData(array(
        'is_in_stock' => 1
    ));
    $configurableProduct->setUrlKey($configurableProduct->getName());
    $configurableProduct->save();

    return $configurableProduct;
}

And here is the code for linking simple products to this configurable product :

protected function linkSimpleProductsToConfigurableProduct($simpleProducts, $configurableProduct)
{
    $configurableProductsData = array();
    foreach ($simpleProducts as $_product) {
        $_product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE);
        $_product->getResource()->save($_product);
        $configurableProductsData[$_product->getId()] = array( //[id] = id of a simple product associated with this configurable
            '0' => array(
                'label'         => $this->getAttributeRawValue($this->getAttributeId('root_colors'), $_product->getRoot()), //attribute label
                'attribute_id'  => $this->getAttributeId('root_colors'), //attribute ID of discriminator attribute in my store
                'value_index'   => $_product->getColor(),
                'pricing_value' => $_product->getPrice(),
                'is_percent'    => '0'
            )
        );
    }
    $configurableAttributesData = $configurableProduct->getTypeInstance()->getConfigurableAttributesAsArray();
    $configurableProduct->setCanSaveConfigurableAttributes(true);
    $configurableProduct->setConfigurableAttributesData($configurableAttributesData);
    $configurableProduct->setConfigurableProductsData($configurableProductsData);
    var_dump('saving configurable product after having link some simple products');
    $configurableProduct->save();
}

Any help is welcome, thank you !


texts: Magento 2: Customer group price quantity

texts: When I add a different price for a customer group, I need to insert the quantity, but what does that mean?


texts: Magento 2 - Add link using cms block in PWA venia theme

texts:
I am trying to add link using cms block in pwa venia theme. But issue is when I click on link it reloads the whole page, which does not happen when I add link using js file. Does any have any idea how can I solve this isse?
Thanks in advance


texts: "Success page" text translation on success page

texts:
I can't find anywhere, where I can translate "Success Page" text -
https://www.dropbox.com/s/vsfwyysmts4h4by/Screenshot%202018-03-13%2007.25.45.png?dl=0

Can anyone help me?


texts: Magento 2 is adding tax value twice in AMT sent to Paypal

texts:
While placing an order using Paypal as payment, Magento 2 is adding the total tax twice to the AMT (amount) sent to PayPal.

Here is what is sent to paypal :

'AMT' => 134.10,  // should be 114.10
'SHIPPINGAMT' => 5.00,
'ITEMAMT' => 89.10,
'TAXAMT' => 20.00,

Here is Paypal's error:

PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts (#10413: Transaction refused because of an invalid argument. See additional error messages for details).

The quote tax is set via a plugin :

<preference for="Magento\Tax\Model\Sales\Total\Quote\Tax" type="Vendor\Module\Model\Sales\Total\Quote\Tax"/>

Class :

class Tax extends \Magento\Tax\Model\Sales\Total\Quote\Tax{
    public function __construct(
        \Magento\Tax\Model\Config $taxConfig,
        \Magento\Tax\Api\TaxCalculationInterface $taxCalculationService,
        \Magento\Tax\Api\Data\QuoteDetailsInterfaceFactory $quoteDetailsDataObjectFactory,
        \Magento\Tax\Api\Data\QuoteDetailsItemInterfaceFactory $quoteDetailsItemDataObjectFactory,
        \Magento\Tax\Api\Data\TaxClassKeyInterfaceFactory $taxClassKeyDataObjectFactory,
        CustomerAddressFactory $customerAddressFactory,
        CustomerAddressRegionFactory $customerAddressRegionFactory,
        \Magento\Tax\Helper\Data $taxData ) {
        $this->setCode('tax');
        parent::__construct($taxConfig, $taxCalculationService, $quoteDetailsDataObjectFactory, $quoteDetailsItemDataObjectFactory, $taxClassKeyDataObjectFactory, $customerAddressFactory, $customerAddressRegionFactory, $taxData
        );
    }

    public function collect(
        \Magento\Quote\Model\Quote $quote,
        \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment,
        \Magento\Quote\Model\Quote\Address\Total $total ) {
        $total->setTotalAmount('tax', 20);     //set fixed value for testing
        $total->setBaseTotalAmount('tax', 20); //set fixed value for testing
        return $this;
    }

}

When the payment is "Check / Money order" the Order's totals and tax are correct.

I have been trying to solve this issue over the last week but without any success.
Our Magento 2.3 instance doesn't have any other module and this is the only place the quote has been modified or even used.

Thanks


texts: How to get the order details of the guest user in magento

texts:
I want to get the order details of the customer. For logged in customer i have no problem. But how to get the order details for the guest users.

Thanks!.