texts: Magento 2 - Save custom entity data failed

texts:
I followed this post to create my custom entity.
Now I registered an observer on the "customer_register_success" event and tried to save additional data in my custom entity. That doesn't work and I get the following error message:

  Fatal error: Call to undefined method
  Magento\Customer\Api\Data\CustomerExtension::save()

What is wrong?

Here is my code of the observer:

public function __construct(
        \Psr\Log\LoggerInterface $logger, //log injection
        \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
        \Magento\Customer\Api\Data\CustomerExtensionFactory $customerExtensionFactory
) {

    $this->_logger = $logger;

    $this->_logger->debug('AfterCustomerSaveObserver_Constructor_Begin');

    $this->_customerRepository = $customerRepository;
    $this->_customerExtensionFactory = $customerExtensionFactory;

    $this->_logger->debug('AfterCustomerSaveObserver_Constructor_End');
}

public function execute(\Magento\Framework\Event\Observer $observer) {

    $this->_logger->debug('AfterCustomerSaveObserver_Execute_Begin');

    try {

        //Get Customer object
        $event = $observer->getEvent();
        $customer = $event->getCustomer();

        //Get Controller
        $controller = $event->getAccountController();

        //Get Additional Data from Controller
        $userName = $controller->getRequest()->getParam("user_name", "");

        //Create Customer Extension object
        $model = $this->_customerExtensionFactory->create(['customer_id' => $customer->getId()]);

        //Set User Name
        $model->setUserName($userName);

        //Save Customer Extension object
        $model->save();
    }
    catch(\Exception $e)
    {
        $this->_logger->critical($e);
        $this->_logger->debug('exception');
    }

    $this->_logger->debug('AfterCustomerSaveObserver_Execute_End');
}


texts: Magento: send New Order Email only with cronjobs

texts:
How can I send The new order Emails using:

$order->sendNewOrderEmail();

only from a cronjob used in My custom Module.

Thanks for help.


texts: The undefined / null data comes in the shipping field

texts:
On the second step of the checkout, there is delivery data on the right, null data comes to the name of the type shipping.

I also use the module Shipping Table Rates by Amasty 1.6.4
After turning on the module, the data does not come null but undifined

for what reason can it be and where can I find the cause of the error?


texts: Date format changes when saving admin config twice

texts:
I have implemented a date selection field in my admin config using this Block as a frontend model:

<?php
class Jurgis_Twilio_Block_Adminhtml_System_Config_Date extends Mage_Adminhtml_Block_System_Config_Form_Field
{
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        $date = new Varien_Data_Form_Element_Date();
        $format = Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);

        $data = array(
            'name'      => $element->getName(),
            'html_id'   => $element->getId(),
            'image'     => $this->getSkinUrl('images/grid-cal.gif'),
        );
        $date->setData($data);
        $date->setValue($element->getValue(), $format);
        $date->setFormat(Mage::app()->getLocale()->getDateFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT));
        $date->setForm($element->getForm());

        return $date->getElementHtml();
    }
}

The functionality is working fine, but when I initially select a date, it displays it as:
After I click "save config" it changes to:   but the value of that field is still "07/11/2017" and only after I save the config the second time it changes to "7/11/2017".

I don't really care which format, but I need it to be constant and final, after the first save. Can I add something in the Block to fix this?


texts: Why is my custom class file being included but not being used?

texts:
I'm currently working on this question: How can I add category IDs as a class on the top menu?

So far, I have set up a new class file that extends Mage_Page_Block_Html_Topmenu

I've included the toHtml and _toHtml functions, and am just trying to return a simple string from those functions to make sure it works. I have also included a simple string saying "HTML Test" outside of the php tags, to check whether or not the file is being included.

Now, I can see "HTML Test" at the top of the page, so my new class file IS being included, but my functions toHtml and _toHtml are not being used.

Here's the details:

My new class file is /app/code/local/Coffeesh0p/Topmenuclasses/Block/Html/Topmenu.php

I have created a config.xml here: /app/code/local/Coffeesh0p/Topmenuclasses/etc/config.xml

config.xml contains the following:

<config>
<modules>
    <Coffeesh0p_Topmenuclasses>
        <version>1.0</version>
    </Coffeesh0p_Topmenuclasses>
</modules>
<global>
    <blocks>
        <page>
            <rewrite>
                <html_topmenu>Coffeesh0p_Topmenuclasses_Block_Html_Topmenu</html_topmenu>
            </rewrite>
        </page>
    </blocks>
</global>

And finally, my new Topmenu.php contains the following:

HTML Test

<?php

class Coffeesh0p_Topmenuclasses_Block_Html_Topmenu extends Mage_Page_Block_Html_Topmenu
{

    public function getHtml($outermostClass = '', $childrenWrapClass = '')
    {

        return "TEST1";

    }

    protected function _getHtml(Varien_Data_Tree_Node $menuTree, $childrenWrapClass)
    {

        return "TEST2";

    }
}

?>

So, why is this file being included but my functions are not being called?

EDIT - I'm using Ultimo theme, and it turns out they use their own menu instead of the default topmenu, so that's why nothing was happening.

Oh well, at least I have learned something about module creation and from the resulting discussion!


texts: setShowAddressFields in custom extension layout doesn't work

texts:
I wanted to display customer address fields in register form. I have a custom extension, so I created the layout file in etc/config.xml:

<frontend>
    <layout>
        <updates>
            <[myextension]>
                <file>[myextension].xml</file>
            </[myextension]>
        </updates>
    </layout>
</frontend>

I followed this instruction: https://magento.stackexchange.com/a/53585/4276 and added the following line in app/design/frontend/base/default/layout/[myextension].xml

<customer_account_create>
    <reference name="customer_form_register">
        <action method="setData"><key>show_address_fields</key><value>1</value></action>
    </reference>
</customer_account_create>

But the address fields didn't show up. I tried following lines too with no luck:

<customer_account_create>
    <reference name="customer_form_register">
        <action method="setShowAddressFields">
            <param>true</param>
        </action>
    </reference>
</customer_account_create>

I'm using Magento CE 1.9.3.4. What should I do?

UPDATE

I looked into app/design/frontend/[mypackage]/[mytheme]/template/persistent/customer/form/register.phtml and the line if ($this->getShowAddressFields()): was there.


texts: Magento 1.9.3.1 customer_flowpassword doesn't exist

texts:
Got an error with "reset password" in 1.9.3.1?

Run this sql to create the missing database table "customer_flowpassword". Magento maybe did not create the table after your update to 1.9.3.1.

Make sure to correct the "'"


texts: How to add "contact us for shipping quote" for certain items?

texts:
I have a heap of shipping rules set up, based on weight which accounts for 95% of the stock on the site, but there are a handful of items which are large, and unusual sizes, so would need to have their shipping calculated manually.

How can I add an option, where the weight is say 0, to show "please contact us for shipping quote" instead of adding a shipping option, and disable the online purchase option?


texts: Magento2: How to add new column in admin_user table?

texts: How to add a new column in admin_user table Magento 2 ?


texts:
Tried via checkout_index_index.xml to add validation on city field in 2.2.6 still now working

<item name="city" xsi:type="array">
   <item name="validation" xsi:type="array">
   <item name="required-entry" xsi:type="boolean">true</item>
   </item>
</item>


texts: magento 2.2.7 configurable products don't show up shipment address in checkout

texts:
when configure product's child product purchase at time shipping address missing in checkout

  my database side catalog_product_entity table

  1.when i run reindex command then 2-3 days working fine after same
  issue is coming
  2.if child product add weight then working good


texts: How to handle products URL's when exporting/importing products into Magento 2?

texts:
I have a small shop (less than 300 products) on Magento 1.7.2 and I want to move to Magento 2.

Since I dont have many products, I think it would be easier to export the products (using CSV files) and importing them into the new Magento 2 installation than using the Data Migration Tool (which still has many bugs).

I'd like to know whether doing this (exporting/importing) will keep the original products URL's in the new Magento 2 installation since I receive good search traffic for some niche products that I wouldn't like to lose because of URL changes.


texts:
Hey guys,
I want to add a field to the product categories. I created an EAV attribute and added the field, but the value of the field is not saved (It's not persistent).
I think the problem is that the field is not linked to the EAV attribute.
The code is as follows, Please show me the missing puzzle.
Thank you for your helps in advance :-)

category_form.xml:

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">

    <fieldset name="general">

        <field name="showall_label">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">32</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="label" xsi:type="string" translate="true">"Show All" Label</item>
                </item>
            </argument>
        </field>

    </fieldset>

</form>

InstallData.php:

<?php

namespace Amaj\MegaMenu\Setup;

use Magento\Framework\Module\Setup\Migration;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Catalog\Setup\CategorySetupFactory;

/**
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface
{
    /**
     * Category setup factory
     *
     * @var CategorySetupFactory
     */
    private $categorySetupFactory;

    /**
     * Init
     *
     * @param CategorySetupFactory $categorySetupFactory
     */
    public function __construct(CategorySetupFactory $categorySetupFactory)
    {
        $this->categorySetupFactory = $categorySetupFactory;
    }

    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $installer = $setup;
        $installer->startSetup();

        $categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);
        $entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Category::ENTITY);
        $attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);

        //$categorySetup->removeAttribute(\Magento\Catalog\Model\Category::ENTITY, 'my_attribute' );

        $categorySetup->addAttribute(
            \Magento\Catalog\Model\Category::ENTITY,
            'showall_label',
            [
                'type'         => 'varchar',
                'label'        => '"Show All" Label',
                'group'        => '',
                'input'        => 'text',
                'global'       => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
                'visible'      => true,
                'required'     => false,
                'user_defined' => false,
                'sort_order'   => 100
            ]
        );

        $installer->endSetup();
    }
}

Results:

EAV attr is being created in the DB and the field is being shown in the admin panel:

But when the field is filled and "save" is pressed, everything would be saved except for my field.


texts: Magento 2 knockout js translation is not working

texts:
I'm using Magento 2.3.4

I'm looking at the translation issue for the last few days but I didn't get any answer.

I have used mageplaza one step checkout module.

Very recently I have upgraded the magento version to 2.3.4. previously I have 2.3.3.

Now the js translation on the checkout page is not working. But my custom phtml and php via translation were working fine. But only the knockout js translation is not working.

See the below screen.

I have checked the js translation file from pub/static/frontend/Fillme/default/de_CH/js-translation.json

On this file, the translation was reflected perfectly.
Eg : "Shipping Address":"Lieferadresse",

But in the frontend, it showing like Shipping Address.

There was an i18n translation available in one step checkout module itself and in my custom language package also.

Can anybody help on this issue


texts: How to add custom config in custom module to role user admin in magento 1

texts: I created a module and use it in the config, but when set role user, it does not show, please help me!


texts:
I use this to display the quantity of my products.

<?php if ($_product->isAvailable()): ?>

<?php echo $this->__('Qty Available:') ?> <?= (int) Mage:: getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty()?>

<?php else: ?>

<?php echo $this->__('Availability:') ?> <?php echo $this->__('Out of stock') ?>

<?php endif; ?>

It works perfectly but, I want to display it only "if" it's a specific store.

Any idea?


texts:
I need to change the Links to which those buttons in the cart sidebar redirect.

I can't find the file to edit them.
I have marked in a red box the buttoms to edit

My version of Magento is 2.1.6


texts:
I have implemented the BX slider to one of my module. After implementing the BX slider, I can see the script and CSS for BX-slider have loaded when i look into the developer tools. However, the Bx slider is not visible and also the functionality is not working on the frontend.

I want to display like below:

But I'm getting as below:

Below are the code I'm using:

Template file:

                        <input type="hidden" class="compare-item-id" data-bind="value: id"/>
                        <a href="#" data-bind="attr: {'data-post': remove_url}" title="<?= /* @escapeNotVerified */ __('Remove This Item') ?>" class="action delete cancelclose remove-slide" >
                            <?= /* @escapeNotVerified */ __('&times;') ?>

$29,999.99

Script:

jQuery(document).ready(function() {
        jQuery('.bxfrcmp').bxSlider({
            minSlides: 3,
            maxSlides: 3,
            slideWidth: 960,
            pager: false,
            moveSlides: 1,
            touchenabled:true,
            infiniteLoop: false,
        });
    });

Any help will be appreciated!

After tried as suggested by Ben Crook:


texts: Mass delete action in one step not in loop magento 2

texts:
I have custom module with mass delete action feature. how to do mass delete action in one step without loop. Because i got WARNING | Model LSD method delete() detected in loop when i check my module in MEQP 2.

Below is the code  used in my module

foreach ($collection as $block)
{

 $block->delete();

}

After searching the mass action in the MAGE2 core file they too use the same method.
i refered the following path file is vendor/magento/module-cms/Controller/Adminhtml/Block/MassDelete.php

from line no 51 to 53

foreach ($collection as $page)
{
    $page->delete();
}

i appreciate any one help on this.


texts: How to add product from one store to another store in magento2?

texts:
I have two store

Store A
-Store B

I have one configurable product SKU-test123.
Now I want to display it to StoreA's one CMS page
for example: www.storeA.com/testcms (using catalog product widget)
Note:It's display perfectly.
When anybody click on the addtocart button it shoud be submit to the StoreB instead of StoreA.
Is there anyway to doing this?
I have try to replace from action of url from storeA to storeB but it's give me CORS header error.
Thanks for your help in advance.


texts: Migrating Magento website to different URL (Cause issues with extensions?)

texts:
I have a website www.example.com running on Magento 1.7 and I plan on making a Test website on another server.

Basically moving files and database on example.com and place it under different URL, let say "www.secondsite.com Will there be a problem with Magento extension?

I heard if you move website to a different URL, Magento extension will send information to Extension creator server and it will block them from working on BOTH sites (Test site- www.secondsite.com) and my live website www.example.com"


texts: Customer Groups and impact on performance

texts:
Is there a maximum amount of groups? Also, how big impact will it have a on a performance of the store if you make around 1000 groups?

I have wholesale customers shopping on my site and plan to create a customer group for each of my wholesale customer. Just looking for positives and negatives.


texts: Magento 2.2.1 Error(Item (Magento\SalesRule\Model\Rule) with the same ID "33" already exists)

texts:
I got an error in log like

  main.CRITICAL: Item (Magento\SalesRule\Model\Rule) with the same ID
  "33" already exists. {"exception":"[object] (Exception(code: 0): Item
  (Magento\SalesRule\Model\Rule) with the same ID \"33\" already
  exists. at vendor/magento/framework/Data/Collection.php:404)"} []

How can I resolve this? Any quick solution


texts: Data not pulling through on Magento Dashboard e.g. lifetime sales and charts

texts:
I'm using Magento 1.9.3.0

The problem is that Lifetime sales and charts in dashboard are not displaying any information, the only value that is displayed is £0.00.

I've placed orders and there's still nothing. I've also enabled charts in

System > Configuration > Admin > Dashboard > Enable Charts

Can anyone please help me with this problem?


texts: Get selected Custom Options from configurable product

texts:
the following observer script looks for selected configurable options, to work out the qty needed and adds a simple product (#9236) to the cart.

However, it only works for simple products.
How can I get it to also get configurable products selected custom options?

class My_Observer
{
    public function add_product_qty(Varient_Event_Observer $obs)
    {
        $quote = $obs->getEvent()->getQuote();
        $getquoteitems = $obs->getQuoteItem();

        $custom = $obs->getQuoteItem();
        if ($custom->getParentItem()) {
            $custom = $custom->getParentItem();
        }
        $product_id=$custom->getProductId();

        $helper = Mage::helper('catalog/product_configuration');
        $optionList = $helper->getCustomOptions($getquoteitems);
        if (!empty($optionList[1])) {
            //Custom Options
            $qty = 0;
            $Onelogo = '1x Logo (Setup Required)';
            $Twologo = '2x Logo (Setup Required)';
            $Threelogo = '3x Logo (Setup Required)';

            if (in_array($Onelogo, $optionList[1])) {
                $qty = 1;
            }
            if (in_array($Twologo, $optionList[1])) {
                $qty = 2;
            }
            if (in_array($Threelogo, $optionList[1])) {
                $qty = 3;
            }
            if ($qty > 0) {
                // Mage init
                require_once(Mage::getBaseDir().'/app/Mage.php');
                umask(0);
                Mage::app('default');
                Mage::getSingleton('core/session', array('name' => 'frontend'));

                // Get customer session
                $session = Mage::getSingleton('customer/session');

                // Get cart instance
                $cart = Mage::getSingleton('checkout/cart');
                $cart->init();

                // Add a product (simple); id:12,  qty: 3
                $cart->addProduct(9236, $qty);
                $session->setCartWasUpdated(true);
            }
        }
    }
}


texts: Read a category attribute from title.phtml in Magento 2.3

texts:
I have found a lot of examples on how to create an extra attribute for the categories. I want to create a text field for adding a different H1 - instead of using the category name as the headings, on the category pages.

But how can I fetch the attribute from the title.phtml file?

(\app\design\frontend\Vendor\Theme\Magento_Theme\templates\html\title.phtml)

I have this to check if on a category page in title.phtml:

<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$request = $objectManager->get('Magento\Framework\App\Action\Context')->getRequest();
/*
 * Check if on product page
 * ------------------------
 */
if ($request->getFullActionName() == 'catalog_category_view') {
...
}
?>


texts: One Of the Category Url redirected to home page in Magento 1.9

texts:
I checked in Catalog Url Managment https://www.websiteName.com/wall-hanging.html

i checked wall-hanging.html  in target path and in Request Path also but there is no entry for this .

Any suggestion.


texts: File copy between two environments in magento cloud

texts: Is there way to copy / sync files (media) from one environment to another environment in magento cloud ( ex: staging to production )


texts: How to make blocks of sub categories or make them organized in magento 2

texts:
I want to make sub categories in navigation bar to display in organized blocks. How can i achieve it through coding.

Like the one in
http://rashmian.com/
http://alothemes.com/demo/supermarket/index.php/?___store=english_2

Where category having long sub categories are organized well.

In first link they have used megamenu extension. However if I want any free extension or want to achieve it by coding.


texts: Skip import row, is not valid value "" for field "type" magento via Dataflow Profile error

texts:
Why does my import csv through Import->Dataflow profiles throw the below error?

Skip import row, is not valid value "" for field "type"

The same product csv uploads via System->Import/Export->Import, but not with Dataflow profiles.

1) My catalog_product_entity table is empty

2) I have _type as a column in csv


texts: How to remove Connect With Us block in footer

texts:
I want to remove the Connect With Us block from footer using local.xml. How can this be done? I know how to remove the other blocks from footer using:

<reference name="footer">
        <remove name="footer_links"/>
        <remove name="footer_links2"/>
        <remove name="cms_footer_links"/>
    </reference>

Also how can I remove the block containing

  © 2014 Madison Island. All Rights Reserved

using local.xml?
  Basically I just want my footer to contain the ABOUT US column.
  All help will be greatly appreciated.


texts:
How do I use unserialize method instead of json_decode,
by inject vendor/magento/framework/Serialize/Serializer/
 foreach ($results as $result) {
            $incrementId = $result['increment_id'];
            $additionalInformation = $result['additional_information'];
            $additionalInformationArr = json_decode($additionalInformation);
            $addressVerificationJson = $additionalInformationArr->shipping_address_verification;
            $addressVerificationArr = json_decode($addressVerificationJson);
            $postalCode = $addressVerificationArr->postal_code;
}


texts: How to access custom options of a product in magento from observer event?

texts: For two custom options text fields associated with a product called Location To and Location From, I have set up a Module that has an Observer for checkout_cart_add_product_complete with a method called getLocationCoords, how would I get access to these two fields from the event object that passed to my method.


texts: Error 404 - Can't access backend after moving to new server

texts:
I have moved my website on a new server (domain name is the same). Frontend is working properly but the admin login page gives a 404 Not Found error.

Most posts about this issue suggest the solutions mentioned on this post Transferring Magento website, admin panel URL gives 404

I've tried all of them but nothing worked. Is there something else I could do to fix this?


texts: How can I extend a UI component JavaScript in Magento 2?

texts:
I know there is already a topic about this, as well as a documentation, but I just can't get it to work:

How can I extends a UI Components' JavaScript in Magento 2?

I'm trying to extend Magento_Ui/js/form/form (located in vendor/magento/module-ui/view/base/web/js/form/form.js). So I added requirejs-config.js In my modules' view/base-folder:

var config = {
    map: {
        '*': {
            "Magento_Ui/js/form/form": "Vendor_Module/js/form/form"
        }
    }
};

And in my file base/web/js/form/form.js:

define([
  "Magento_Ui/js/form/form"
], function(FormComponent){
  "use strict";

  /**
   * Rewrite original UI Component:
   */
  return FormComponent.extend({});
});

But for some reason, FormComponent is not the UI Component I'm trying to extends, but undefined.

According to the documentation, this should work, but it doesn't. So what am I missing here?


texts: Adding "view all" subcategory to all top menu's categories

texts:
I'm working in a default/default theme in Magento 1.9.3.2.
I would like to make a custom module that adds to categories of products(placed at the top menu) new subcategory called "View All" that displays all products from a given category, i.e.:
Category: Woman
Before:
    Subcategories: New Arrivals, Tops & Blouses, Pants & Denim, Dresses &
    Skirts
    After:Subcategories: View all, New Arrivals, Tops & Blouses,
    Pants & Denim, Dresses & Skirts.

I have got a very similar problem to this one: How to make "view all" link in topmenu with sub categories but I don't really know how to approach this problem anyway.
What steps (starting from scratch) should I take to achieve my goal? I would be grateful for any help.


texts: Sales Order Grid Record Count is Broken when GROUP BY used to add Products to Grid

texts:
I have extended my sales order grid in a custom module (my first ever!) to add product names, skus and various other fields to the grid and it all works fine EXCEPT that the total number of records always shows 1 and the pagination doesn't work.

I know that to fix this I have to override the function getSelectCountSql() in the class Mage_Sales_Model_Resource_Order_Collection with the following code (found elsewhere on this site):

public function getSelectCountSql()
{
    $this->_renderFilters();
    $countSelect = clone $this->getSelect();
    $countSelect->reset(Zend_Db_Select::ORDER);
    $countSelect->reset(Zend_Db_Select::LIMIT_COUNT);
    $countSelect->reset(Zend_Db_Select::LIMIT_OFFSET);
    $countSelect->reset(Zend_Db_Select::COLUMNS);

    // Count doesn't work with group by columns keep the group by
    if(count($this->getSelect()->getPart(Zend_Db_Select::GROUP)) > 0) {
        $countSelect->reset(Zend_Db_Select::GROUP);
        $countSelect->distinct(true);
        $group = $this->getSelect()->getPart(Zend_Db_Select::GROUP);
        $countSelect->columns("COUNT(DISTINCT ".implode(", ", $group).")");
    } else {
        $countSelect->columns('COUNT(*)');
    }
    return $countSelect;

}

and if I replace the core code everything works fine.

BUT how do I do this properly in my custom module??  I have the following in my config.xml

<models>
   <salesordergrid>
         <class>MyCompany_SalesOrderGrid_Model</class>
         <resourceModel>salesordergrid_resource</resourceModel>
    </salesordergrid>
    <salesordergrid_resource>
        <class>MyCompany_SalesOrderGrid_Model_Resource</class>
    </salesordergrid_resource>
    <sales_resource>
        <rewrite>
             <order_collection>MyCompany_SalesOrderGrid_Model_Resource_Order_Collection</order_collection>
        </rewrite>
    </sales_resource>
</models>

and the following custom class:

class MyCompany_SalesOrderGrid_Model_Resource_Order_Collection
    extends Mage_Sales_Model_Resource_Collection_Abstract
{
    public function getSelectCountSql() {
        //code as above..
    }
}

But it doesn't work.  Please can somebody tell me where I am going wrong?


texts: SQLSTATE[42S02]: Base table or view not found: 1146 Table error but table exists

texts:
Here's the complete error, the table exists and I'm able to run this query from myphpadmin

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'Booomchik.mage_rating_option_vote_aggregated' doesn't exist, query was: DELETE FROM `mage_rating_option_vote_aggregated` WHERE (entity_pk_value = 63) AND (rating_id IN('1', '2', '3'))

This happens when I delete products. They delete but with this error.
So the product does get deleted from Mage_catalog_product_entity table and then I guess tries to delete some relates records in other tables and can't find this table though it does exist.

Yesterday I created a new database, imported all my tables there and changed the prefix. I'm new to magento and web, I know this was a bad way of doing it but I was afraid to just rename, wanted to be able to fall back if something went wrong.
Changed it in local.XML file too, so I don't think this is thr problem.

Deleted the var\cache directory, as suggested on a diff question.

Edit. Here's a screenshot of me running the query


texts:
All of a sudden I'm getting the following error.

  There has been an error processing your request SQLSTATE[42S02]: Base
  table or view not found: 1146 Table '.core_resource' doesn't exist

Trace:
#0 /lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /lib/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('INSERT INTO `co...', Array)
#4 /lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('INSERT INTO `co...', Array)
#5 /lib/Zend/Db/Adapter/Abstract.php(576): Varien_Db_Adapter_Pdo_Mysql->query('INSERT INTO `co...', Array)
#6 /app/code/core/Mage/Core/Model/Resource/Resource.php(133): Zend_Db_Adapter_Abstract->insert('core_resource', Array)
#7 /app/code/core/Mage/Core/Model/Resource/Setup.php(423): Mage_Core_Model_Resource_Resource->setDbVersion('core_setup', '1.6.0.4.1.2')
#8 /app/code/core/Mage/Core/Model/Resource/Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.6.0.4.1.2')
#9 /app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#10 /app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#11 /app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#12 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#13 /index.php(87): Mage::run('', 'store')
#14 {main}

After a while the above error is replaced by

Fatal error: Cannot access property Mage_Core_Model_Resource_Website_Collection::$_model in /app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php on line 430

What could be causing this and how can it be fixed?
This has happened before, and it resolved itself, after clearing cache.
I've deleted cache and locks, doesn't help.


texts: Extending community extensions - Helper/Data.php

texts:
I'm planning to extend a community extension by creating relevant files in app/code/local/myname/myext. The community extension has multiple files that I want to customise but let's start simply. How would I implement the local equivalent of Helper/Data.php, even just to show it's working?

For example the community extension is like

class Compasser_Diogenes_Helper_Data extends Mage_Payment_Helper_Data
{
    //
    public function startDiogenes($cId, $stId, $shId, $mCode)
    {
        // working code is here, can output to log files

My local file is just trying to prove it's getting called. app/code/local/Kaska/Diogenesext/Helper/Data.php

include_once 'Compasser/Diogenes/Helper/Data.php';
// I also tried require_once Mage::getConfig()->getModuleDir('Helper', 'Diogenes') . '/Data.php';

class Kaska_Diogenesext_Helper_Data extends Compasser_Diogenes_Helper_Data
{

    public function startDiogenes($cId, $stId, $shId, $mCode)
    {

        Mage::log('test', null, 'test.log');

This is app/code/local/Kaska/Diogenesext/etc/config.xml

<?xml version="1.0"?>
<config>
<modules>
    <Kaska_Diogenesext>
        <version>0.0.1</version>
    </Kaska_Diogenesext>
</modules>
<global>
    <helpers>
        <kaska_diogenesext>
            <rewrite>
                <data>Kaska_Diogenesext_Helper</data>
            </rewrite>
        </kaska_diogenesext>
    </helpers>

This is the what's in the app/etc/modules/Kaska_Diogenesext.xml file. It's showing as enabled in admin.

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

In my log files I just see the community extension working, there's nothing from the local extension, nothing in test.log and no errors either. Cache not enabled but flushed anyway.


texts: Prevent Magento from auto-completing orders

texts:
We have a scenario where we fulfill orders via an API. Previously the logic has been tied to the invoicing process, so that when an invoice is created, the fulfillment logic is executed. If there were API errors, an order attribute was set which would then display a column in the order grid indicating that an API error occurred during fulfillment.

After refactoring and cleaning up this messy code, we got rid of "API Error" column. We were hoping to set the order status to "Pending Fulfillment" or similar when starting the fulfillment process, and having the order stay in that status in case of an error to indicate to our customer service department that the order had an error and needs manual intervention to attempt fulfillment again.

We attempted to programmatically hold the order in a "Fulfillment Failed" status, but that also did not work due to Magento completing the order. The "Fulfillment Failed" status gets set when we encounter an API error, but Magento still completes the order. Since our fulfillment function is listening for the event sales_order_invoice_pay I'm assuming this is because the invoice has already been created, and Magento thinks the order is now complete even though there were API errors.

The question is: how do we get Magento to stop completing the orders and leave them in the "Fulfillment Failed" status, so they can be manually reviewed?

So far, here are some ideas we've come up with:
+ Partially invoice each order item as its fulfillment succeeds (not really sure how to accomplish this)
+ Programmatically change the status AFTER Magento has completed it. Unfortunately, this also doesn't seems possibly after the order is Complete. If I can't change its status to HOLDED after it's complete manually, I'm guessing we won't be able to do it programmatically either.
+ Bring back the API Errors column

I'm hoping that we're overlooking something and that there may be a much simpler to implement solution for our scenario.


texts: Add custom filter in frontent product catalog

texts:
I've been looking for a few days to add a filter to the display of products in a category. This filter is a date and should not be visible to users.
I managed to do it in version 2.3 but with version 2.4 and elasticsearch, it doesn't work anymore.
Thanks for helping me...


texts: Why does Magento 1.9.2 "loadLayout" start to load products?

texts:
Does someone know why Magento likes to load products when being asked to just load the layout ?

I just are walking through some Magento code from 1.9.2.
And i have writen a controller with just: loadLayout en renderLayout.
So i tought that i could change blocks between the two functions, but it turns out that is not the case for most of the 'core' blocks. For example in this block filling in the HTML Header is done if you say: "loadLayout".

Does anyone have experience with removing blocks that already 'changed' the global Magento world ?

For example: Mage_Catalog_Block_Product_View

/**
 * Retrieve current product model
 *
 * @return Mage_Catalog_Model_Product
 */
public function getProduct()
{
    if (!Mage::registry('product') && $this->getProductId()) {
        $product = Mage::getModel('catalog/product')->load($this->getProductId());
        Mage::register('product', $product);
    }
    return Mage::registry('product');
}
/**
     * Add meta information from product to head block
     *
     * @return Mage_Catalog_Block_Product_View
     */
    protected function _prepareLayout()
    {
        $this->getLayout()->createBlock('catalog/breadcrumbs');
        $headBlock = $this->getLayout()->getBlock('head');
        if ($headBlock) {
            $product = $this->getProduct();
            $title = $product->getMetaTitle();
            if ($title) {
                $headBlock->setTitle($title);
            }
            $keyword = $product->getMetaKeyword();
            $currentCategory = Mage::registry('current_category');
            if ($keyword) {
                $headBlock->setKeywords($keyword);
            } elseif ($currentCategory) {
                $headBlock->setKeywords($product->getName());
            }
            $description = $product->getMetaDescription();
            if ($description) {
                $headBlock->setDescription( ($description) );
            } else {
                $headBlock->setDescription(Mage::helper('core/string')->substr($product->getDescription(), 0, 255));
            }
            if ($this->helper('catalog/product')->canUseCanonicalTag()) {
                $params = array('_ignore_category' => true);
                $headBlock->addLinkRel('canonical', $product->getUrlModel()->getUrl($product, $params));
            }
        }

        return parent::_prepareLayout();
    }

This is my test:

<?php
include_once('../initMage.php');
initMage();

$controller = initController('Gn_Test_IndexController');
$product = Mage::getModel('catalog/product')->load(1);
Mage::register('product', $product);
$controller->loadLayout();


texts: Are catalog rules completely broken in Magento 1 with flat tables enabled? Or, how can these SQL queries ever work as intended?

texts:
I've discovered that some of the SQL queries Magento is using to generate catalogrule discounts are completely nonsensical, leading to products receiving discounts even though they should not. This appears to only happen when flat tables are enabled, as a different process is used when flat tables aren't enabled.

Here are some examples of what I mean:

One such rule was configured to exclude various products based on their SKUs containing a specific string like so:

When Magento writes an SQL query to match against this condition, the query looks like:

SELECT 1, `cg`.`customer_group_id`, `p`.`entity_id`, 3, 0, 0, 'by_percent', 25, 0, 0, '', 0
FROM   `catalog_product_entity` AS `p`
       INNER JOIN `catalog_product_flat_1` AS `cpf` ON cpf.entity_id = p.entity_id
       LEFT JOIN `catalog_category_product` AS `ccp` ON ccp.product_id = p.entity_id
       LEFT JOIN `customer_group` AS `cg` ON cg.customer_group_id IN ( '0', '1', '2', '3' )
WHERE  (( `cpf`.`sku` NOT LIKE 'this-should-have-percent-signs' ))
       AND ( `p`.`entity_id` >= '1' )
       AND ( `p`.`entity_id` < 1000001 )

Notice that even though the condition says "contains", Magento is not adding percent signs to indicate to MySQL that the string should be matched as such. When flat tables are not enabled, Magento does matching using the PHP stripos() function, so the flat-table and eav implementations are functionally different.

Another example can be found in the is-not-one-of condition:

In this case, the resulting WHERE condition looks like:

WHERE  ((     NOT Find_in_set('sku1', `cpf`.`sku`)
           OR NOT Find_in_set('sku2', `cpf`.`sku`)
           OR NOT Find_in_set('sku3', `cpf`.`sku`) ))

This method of comparison can never work because, if the SKU is sku1, it will match OR NOT Find_in_set('sku2', `cpf`.`sku`) even if it doesn't match NOT Find_in_set('sku1', `cpf`.`sku`). The end result is that all 3 of these SKUs will be matched by the rule, and therefore the exclusion will never happen.

This same issue is also present when excluding products by category ID. In that case, it might make sense to use find_in_set(), but there is no GROUP BY clause on the query, so that column will never be a set to begin with.

These proof-of-concept rules were tested against a fresh install of Magento 1.9.3.6, with no 3rd party modules installed.

Is there a solution to this? Perhaps some way to force Magento to use the non-SQL-driven process of applying rules, even when flat tables are enabled?


texts:
I need to update the mini cart subtoal after removing the item through observer.
The event I used to remove item is checkout_cart_save_after

Removing the item(s) works, but updating the mini-cart subtotal does not.

observer code:

public function removeItems(Varien_Event_Observer $observer){
$configSkuValue = 'test'; //product SKU need to be removed
$cart = $observer->getCart();
$quote = $observer->getCart()->getQuote();
foreach ($quote->getAllItems() as $items) {
    $sku = $items->getSku();
    if($sku == $configSkuValue && $quote->getSubtotal() < 35){
        $cart->removeItem($items->getId())->save();
        $data = Mage::getSingleton('checkout/session');
        $data->getQuote()->setTotalsCollectedFlag(false)->collectTotals();
        session_write_close();
    }
}
}

If the quantity is reduced via mini-cart, then the product is deleted if the condition meet's but subtotal is not updating . It's updating only after page load

Can anyone suggest me the way to update subtotal without page load


texts: 500 after install - Class Magento\Framework\App\ResourceConnection\Proxy does not exist

texts:
I installed Magento2 successfully through the commandline, but when i try to access the website, i get a Server Error 500.

The server runs on Ubuntu 14.04

I have no idea what is wrong, or what i am doing wrong.
I used a script to install Magento2 so i expect it to be correct

PHP Errors:

  [Wed Mar 02 17:03:18.718890 2016] [:error] [pid 2292] [client 192.168.56.1:62335] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class Magento\Framework\App\ResourceConnection\Proxy does not exist' in /var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php:19\nStack trace:\n#0 /var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\\Framewo...')\n#1 /var/www/html/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Framewo...')\n#2 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(71): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\\Framewo...')\n#3 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')\n#4 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')\n#5 /var/ww in /var/www/html/vendor/magento/framework/Code/Reader/ClassReader.php on line 19

and this multiple times

  [Wed Mar 02 17:03:18.718739 2016] [:error] [pid 2292] [client 192.168.56.1:62335] PHP Warning:  include(): Failed opening '/var/www/html/var/generation/Magento/Framework/App/ResourceConnection/Proxy.php' for inclusion (include_path='/var/www/html/var/generation:/var/www/html/lib/internal:/var/www/html/var/generation:/var/www/html/lib/internal:/var/www/html/vendor/phpseclib/phpseclib/phpseclib:/var/www/html/vendor/magento/zendframework1/library:/var/www/html/vendor/phpunit/php-file-iterator:/var/www/html/vendor/phpunit/phpunit:/var/www/html/vendor/symfony/yaml:.:/usr/share/php:/usr/share/pear') in /var/www/html/vendor/magento/framework/Code/Generator/Io.php on line 158

and

  [Wed Mar 02 17:03:18.718377 2016] [:error] [pid 2292] [client 192.168.56.1:62335] PHP Warning:  include(): Failed opening '/var/www/html/var/generation/Magento//Framework/App/ResourceConnection/Proxy.php' for inclusion (include_path='/var/www/html/var/generation:/var/www/html/lib/internal:/var/www/html/var/generation:/var/www/html/lib/internal:/var/www/html/vendor/phpseclib/phpseclib/phpseclib:/var/www/html/vendor/magento/zendframework1/library:/var/www/html/vendor/phpunit/php-file-iterator:/var/www/html/vendor/phpunit/phpunit:/var/www/html/vendor/symfony/yaml:.:/usr/share/php:/usr/share/pear') in /var/www/html/vendor/composer/ClassLoader.php on line 412

Also, this is the core_config_data from the magento database

Any idea what i could try?


texts: Magento 2 custom email template background image

texts:
I'm working on a custom email .html file, I need to  insert a background image to the Table, image is in /theme/web/images/ folder.
I've search for it, there are solutions but not found what I'm exactly lookig.

How can I add the table background image?


texts: Magento 1.9.0.2 migration to 2.0.7 clean install error: "composer.json" cannot be found

texts:
When I issue this command on bash shell (Copied directly from this here):

composer config repositories.data-migration-tool git https://github.com/magento/data-migration-tool

I get the following error

  "File "composer.json" cannot be found in the current directory"

I've included the path of composer.json in the $PATH but still get the above error

I am migrating from Magento 1.9.0.2 to a clean install of Magento 2.0.7 from a bitnami AWS AMI Ubuntu 14.x server. Running the command on Mac OS X. I've updated composer.


texts: Get Category name from Products when adding to Shopping Cart

texts:
Using Magento 1.8v.

In my customization when customer adding products to cart.
Some products qty should not be changeable (i.e qty is fixed) and some other products qty available to change .

Example :

cat1
  products
cat2
  subcat
    products
  subcat
    products
cat3
  subcat
     products

For Example:
 cat1 products allowed for qty change so when adding to shopping cart it will be 1  and remaining category should not allowed so it is stock item value .

Im trying below code in this class Mage/Checkout/Model/Cart.php but throwing error

$categoryIds=$this->getProduct()->getCategoryIds($productid);
    foreach($categoryIds as $categoryId)
    $category = Mage::getModel('catalog/category')->load($categoryId);
    if ($category->getName() == 'cat1')
        $minimumQty = $product->getStockItem()->getMinSaleQty();
   else if($category->getName() == 'cat2')
         minimumQty=stock_item->loadByProduct($product)->getQty();

How do i get category name ?


texts: remove/disable top-links-container form header

texts: How do i completely remove/disable top-links-container from the header?


texts: two or more magento2 installation is possible or not in a single linux system?

texts: I already successfully installed magento2 in locally ubuntu 14.04 LTS system. I need try to installation test another magento2-package So two or more magento2 installation is possible or not  in a single system?


texts: How can I put category image above category title. My guess it is something like editing MagentoCatalog/layout/catalog_product_view.xml and <move element="category.title" before="page.main.title" /> but that doesn't work.


texts: How to move magento 2 my account page title section after page top

texts: How to move magento 2 my account page title section below page top in full width as shown below


texts:
I can create a custom block then "import" another existing content, example:

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

How can I import the content of my cms home page into a custom block?


texts: Magento 2 API - Update Product Custom Attribute to Blank/Null

texts:
I am trying to update a product via the Magento 2 Rest API.

If an attribute already has a value I can update that value with another value with no problems.

However if I want to delete the value and leave the attribute blank it will not update and just leaves the old value in place.

I have tried submitting NULL and blank values but with no effect.

array( 'attribute_code' => 'standard_consumables', 'value' => '' ),
array( 'attribute_code' => 'standard_consumables', 'value' => NULL ),

How can I remove a custom attribute value via the REST API.

Thanks


texts: Magento 2: How to send emails from localhost?

texts: I'm working on a module which sends emails from admin panel on some action. I want to test these emails on localhost. How can I configure my Magento 2.1 settings or add SMTP so that sends emails over localhost?


texts:
While creating Open Graph extension in Magento I came across an issue- although my metatag is correct, facebook cannot catch my og tag because there is too much code before my meta/og tag.

Has anyone else encountered this and do you have any suggestions?

<reference name="head">
    <block type="catalog/product_view" name="product.opengraph">
        <action method="setTemplate">
            <template>socialtag/opengraph_product.phtml</template>
        </action>
    </block>
</reference>


texts: Magento 2.2.4 : How to change Footer Copyright in Magento 2?

texts:
I tried changing footer copyright in Content->Configuration Edit Active Theme and Change Copyright Message in Footer Tab.
But I get Error as "Area is Already Set" on Saving it.

So, How to Change Footer Copyright Message in Magento 2?


texts:
For product import,
I have checked from admin (admin -> catalog -> shared catalog ) that my id for shared catalog (Default (General)) is 1.
Then I done code as below. but not works. please guide me what I have missed
public function __construct(

    \Magento\Store\Model\StoreManagerInterface $storeManager,
     \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory $categoryCollection,
     \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
    \Magento\Catalog\Model\Product $productModel,
    \Magento\Catalog\Model\ProductFactory $productFactory,
    \Magento\CatalogInventory\Api\StockStateInterface $stockStateInterface,
    \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry,
    \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder,
    \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository,

    \Magento\SharedCatalog\Model\ProductManagement $sharedCatalog
)
{
    $this->_storeManager = $storeManager;
    $this->_categoryCollection = $categoryCollection;
    $this->_productRepository = $productRepository;
    $this->_productModel = $productModel;
    $this->_productFactory = $productFactory;
    $this->_stockStateInterface = $stockStateInterface;
    $this->_stockRegistry = $stockRegistry;
    $this->_categoryData = $this->getCategories();
    $this->attributeRepository = $attributeRepository;
    $this->searchCriteriaBuilder = $searchCriteriaBuilder;
    $this->_attributeData = $this->getAttributes();
    $this->_sharedCatalog = $sharedCatalog;
}

private function saveProduct($productData = array())
{
  $sku = $productData['custom_material'];
  $productObj = $this->_productFactory->create();
  $productObj->setName($productData['custom_material_description']);

  other attributes ....

  $productObj->save();
  $this->_sharedCatalog->assignProducts(1, array($sku) );

}


texts: PHPSESSID cookie is set to default sameSite= lax, how to change it to sameSite=none?


texts:
I am using several store views.
Each has different links so I would like to have a sitemap.xml including all links from all store views.

What is the practise of creating a proper sitemap.xml? Currently I can create it for one store view only ... do I combine them by hand?


texts: magento2 cart add multiple configurable product variants showing one product only

texts:
I am trying to add a configurable product with with different variants but its showing one item with 2 quantity instead of showing 2 item with each quantity one.

$wholedata = $this->getRequest()->getParams();

    $productId =$wholedata['product_id'];
    $superattribute = array();
    foreach ($wholedata['qty'] as $eachkey => $eachparam) {
        foreach ($wholedata['config'] as $key => $value) {
            $superattribute[$key] = $value[$eachkey];
        }
        $params = array(
            'form_key' => $this->formKey->getFormKey(),
            //'product' => $productId, //product Id
            'qty'   =>$eachparam,
            'selected_configurable_option' => '',
            'super_attribute' => $superattribute
        );
        $_product = $this->product->load($productId);
        $this->cart->addProduct($productId, $params);
        $this->cart->save();
    }

But Strange when I added it one by one and just refresh the cart page in-between then it works fine
If have tried to use $quote->collectTotals()->save(); as well $checkoutsession->getQuote()->setCartWasUpdated(true); but nothing works.
Please help


texts: How to configurable Child product cost price get in magento 2

texts:
How to get configurable child cost price get in magento 2.
Thanks.


texts: how to click on yes / no in system configuration, does it show custom content inside?

texts:
I want to click on yes, it will show the contents and click on it to hide it
[![enter image description here][1]][1]


texts:
how can I create edit form. I created list of posts, create new posts. But now need to edit posts record.

I did not get any code example from your website for create edit record form.


texts: Where is the class EavSetupFactory defined?

texts:
I was looking to a code example about creating custom attributes for products. I saw a class/interface in the code (Magento\Eav\Setup\EavSetupFactory). But I could not find where it is defined.

You can see that a lot of plugins have already been using this class/interface, but I could find where it is actually defined.

Where is this class defined?


texts:
I'm working on a module that needs to open modal window and show some content inside of it + some js logic.

So I load template with ajax request which works just fine: (simplified template):

<input type="checkbox" id="show_date" name="show_date" class="control-checkbox admin__control-text"/>
<input name="date" id="date" title="<?php echo __('Date') ?>" value=""
           class="date input-text admin__control-text" type="text"/>

require([
    "jquery",
    "mage/calendar"
], function ($) {
    $('#show_date').on('change', function () {
        console.log('Changed');
    });

    $("#date").calendar({
        buttonText: 'Select date',
        showTime: false,
        beforeShowDay: $.datepicker.noWeekends
    });
});

Afterwards modal window is opened with the template content:

        var modal = $('<div/>').html(content);
        modal.modal({
            title: $.mage.__('Modal'),
            innerScroll: true,
            modalClass: '_image-box',
            buttons: [{
                text: $.mage.__('Save'),
                attr: {
                    'data-action': 'save'
                },
                'class': 'action-primary',
                click: function () {
                }
            }]
        }).trigger('openModal');

When this happens for the first time everything works as expected. The checkbox does its thing and the calendar works as well.

The problem is that when the modal window is opened for second time without page reload(load tempalte with ajax -> open the modal), it breaks. None of the javascript works.

When the js is changed to use .live instead of .on, the checkbox works every time.

I also tried to move calendar initialization out of the template. In this case the calendar is initialized, however after clicking on specific date it does not change value of the text input.

Any ideas how to fix this issue?

Any help would be greatly appreciated.


texts: Magento 2 : Event Observer Exception Not Showing in Screen

texts:
In custom extension, I create observer like this.

app\code\Vendor\Extension\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="sales_quote_remove_item">
    <observer name="sales_quote_remove_item_handler" instance="Vendor\Extension\Observer\RemovecartbeforeObserver" shared="false" />
  </event>
</config>

And My Observer:

app\code\Vendor\Extension\Observer\RemovecartbeforeObserver.php

use Magento\Framework\Event\ObserverInterface;

class RemovecartbeforeObserver implements ObserverInterface
{
   public function execute(\Magento\Framework\Event\Observer $observer)
   {
       // HERE IS MY CODE
       $message = "THIS IS CUSTOM ERROR MESSAGE";
       throw new \Magento\Framework\Exception\LocalizedException(__($message));
       return;
    }
 }

My Observer function is called, but it not show custom error on the page. Instade of this it show my message in exception.log file like this.

main.CRITICAL: exception 'Magento\Framework\Exception\LocalizedException' with message 'THIS IS CUSTOM ERROR MESSAGE' in E:\xampp\htdocs\myworks\magento213\app\code\Vendor\Extension\Observer\RemovecartbeforeObserver.php:106

See how it show default message.


texts: Deploy Sample Data Content to app/code folder instead of vendor

texts:
I can deploy sample data to vendor folder with with the command bin/magento sampledata:deploy in Magento 2
however I want to edit this command to deploy sample data to app/code/magento folder instead of vendor.

Any ideas how can I do it ?


texts: my.cnf for local MySQL server - several Magento projects with big catalogs

texts:
I've read tons of times there is no magical my.cnf file for a Magento project, but... I want to believe there should be some params specifically relevant for Magento catalog pages when dealing with really big catalogs
What I am asking here is some tips to correctly tune those relevant params, according to this specifications:

MySQL server is version 5.6
MySQL server is just a 6GB RAM dedicated server, in our local network
MySQL server should host around 10 Magento databases (although most of them will remain inactive... let's say we'd work with 2 or 3 projects per
day)
Max connections param has zero importance here, as we talk about our local network. So we can reduce it to 10 or 20, in order to increase some buffers (if this really helps performance...)

I've been playing after lot of Google reading, trying some tools (such as mysqltuner or percona wizard), and we have get acceptable loading time for any page in:

Regular Magento project: any kind of page
Big Magento project: any kind of page except catalog/category, catalog/product & checkout process

I am not asking for a flying navigation, just consider acceptable about 5-10 seconds per catalog page in our local environment (of course, this is not acceptable for live environments, but enough for local). Right now we are really far from this times in catalog pages for the big Magentos
This is our current my.cnf file relevant (I think) params
skip-external-locking
skip-name-resolve

innodb_additional_mem_pool_size         = 20M
innodb_autoinc_lock_mode                = 2
innodb_buffer_pool_size                 = 2G
innodb_data_file_path                   = ibdata1:10M:autoextend
innodb_flush_log_at_trx_commit          = 0 # faster
innodb_log_buffer_size                  = 4M
innodb_log_file_size                    = 512M
innodb_buffer_pool_instances            = 2
innodb_buffer_pool_dump_at_shutdown     = 1
innodb_buffer_pool_load_at_startup      = 1

max_connections                         = 20
max_heap_table_size                     = 128M
tmp_table_size                          = 128M
open_files_limit                        = 65535

key_buffer_size                         = 80M
join_buffer_size                        = 16M
myisam_sort_buffer_size                 = 64M
query_cache_size                        = 64M
query_cache_type                        = 1
read_buffer_size                        = 1M
read_rnd_buffer_size                    = 4M
sort_buffer_size                        = 1M

table_definition_cache                  = 1024
table_open_cache                        = 256

To be clear, each of this projects are working properly in their separated live hostings (both testing and/or production environments), so it doesn't seem a coding issue, we use Profiling tools for that
When I say "big Magento" I am talking about 50k - 100k skus, with several hundreds (maybe some project would have more than 1k) of categories, and several hundreds of attributes. Our "regular Magento" would mean less than 10k skus, less than one hundred categories, etc...
Thanks in advance


texts: magento 2 how to get shipping method in system configuration

texts:
system.xml
<field id="shippingmethod" translate="label" type="multiselect" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Shipping Method</label>
                <depends>
                    <field id="restrictpaymentbyship/general/enable">1</field>
                </depends>
                <source_model>Magento\Shipping\Model\Config\Source\Allmethods</source_model>
            </field>


texts: Magento 1.9.2.2 Multiple CPU processes continue in maintenance mode

texts:
I have VPS 8cpu, 16gb ram. php-fpm+Redis+po full page cache

Sometimes multiple php processes appearing and not finishing. Eating cpu each one of them. Almost %100 cpu usage. Memory is below %10

I activated maintanance mode. maintenance.flag is active. Web site is not online.

I restarted php-fpm

Processes stopped, after couple of minutes started again and still continue.

When I activate magento Server is not stucked, I can reach whm and ssh but magento is sooo slow.

How can I find what is working? Or which script is working?


texts: Magento 2.0.10 HOW AND WHERE DO I PERFORM 1. UPDATE ON SAVE 2. REINDEX REQUIRED

texts:
I have Magento 2.0.10 and have under the Mode columns 9 (all of them)
UPDATE ON SAVE

and under Status columns  for Product Price -> REINDEX REQUIRED

Product EAV for Product Price -> REINDEX REQUIRED

HOW AND WHERE DO I PERFORM THE

UPDATE ON SAVE
REINDEX REQUIRED

Please help


texts: Unable to add product into cart from third party CURL

texts:
I have created custom controller in which I've written custom add to cart action and shared controller URL with 3rd party website. That website is calling my controller using CURL and on success, 3rd party website is redirecting to my cart page. But product is not be able to add into cart.

If I am calling my controller from browser, product will be added into cart successfully.

Can you please help me out.

Thank you in advance.

Regards,
Kunjesh


texts: How to switch the Product Tax Class based on VAT ID Number

texts:
For all my products I have a set a tax class with 19%.

The request:
If a customer put in a valid VAT ID Number within the checkout process - certain products should be calculated based on a tax class with 0%. Without a VAT ID Number all products must be calculated with 19% tax.

if no VAT ID exists:

product a: 19%
product b: 19%
product c: 19%

if VAT ID exists:

product a: 19%
 product b: 19%
 product c: 0%

Is this possible?


texts: Issue after SUPEE-8788 in removing samples downloadable products

texts:
I have just patched my Magento 1.9.2.4 with SUPEE-8788. Everything seems to be ok a part an issue in removing samples of downloadable products.
I mean when i click the "X" to remove the samples nothing happens

If i check with firebug included in firefox i see an error:
"Uncaught TypeError: Cannot read property 'remove' of undefined
    at Object.remove ((index):2113)
    at HTMLButtonElement. (prototype.js:391)
    at HTMLButtonElement.responder (prototype.js:5598)"

Can anyone know why this happens?


texts: Create invoice programmatically and capture online not working while running from cron

texts:
I'm currently facing a weird result with my script when running it by cron.
This script is creating the invoice and capture the amount online.

if($order->canInvoice()) {

  $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
  $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
  $invoice->register()->pay();

  Mage::getModel('core/resource_transaction')
      ->addObject($invoice)
      ->addObject($invoice->getOrder())
      ->save();

  $invoice->sendEmail();

}

It works fine when I call the cron by Magento backend AEOScheduler, then "RunNow".

The problem is when the cron is executed automatically by crontab.
The invoice is created successfully but the event "sales_order_invoice_pay" seems not fired. This is the event catched by my payment processor extension for capturing correctly the amount ONLINE.

Any idea/suggestion would be appreciate.
Thank you.


texts: How to move magento 2 swatches on category page

texts: I'm attempting to move the swatches of each product on the category page directly under the product images versus under the price box. So far not having much luck. I have tried altering  selectorProduct within Magento_Swatches::product/listing/renderer.phtml as well as changing settings inside swatch-renderer.js to get them to load where i choose. No luck. Any help is appreciated.


texts: 401 The consumer isn't authorized to access %resources on HTTPS

texts:
New to magento.
Everything worked properly until we deployed the same code to GoDADDY, added SSL.
Note that all get API's are having similar errors.
The REST API gives this error:
THE URL: /rest/V1/products?searchCriteria[pageSize]=20
STATUS CODE: 401
{
"message": "The consumer isn't authorized to access %resources.",
"parameters": {
"resources": "Magento_Catalog::products"
}
}
I have already tried:

Creating token from integrations and also tried with customer token
Tried again deploying with cache and compile, reindex and deployment

Magento version is 2.3.5
Any help is highly appreciated.


texts: Your password reset link has expired : Magento 2

texts:
I am trying to reset password from forgot password action using REST API:

http://domain/index.php/rest/V1/customers/password?
email=myemail@gmail.com&
template=email_reset&
websiteId=1

and I receive an email successfully to set new password as follow:

When click the button Set a New Password, I got this error

Your password reset link has expired

as follow :

when enter my email again in the last screen, I got another email to reset a new password as the first image, then click reset password and I can receive the proper screen and reset password function working fine as follow :


texts:
I am getting this warning when im trying to add a product:

Warning: array_filter() expects parameter 1 to be array, string given in

/html/vendor/magento/module-configurable-product/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Configurable.php on line 145

this is the code:

    }
  $extensionAttributes>setConfigurableProductLinks(array_filter($associatedProductIds));
    }

I dont understand why.


texts:
I need to change the text for a shipping method title.

Currently we have

Federal Express

Express Saver

I would like this to say Express Saver (3 Day Delivery) instead of Express Saver on the shopping cart/check out pages.

I have added this line to my custom themes translation file however it doesn't work. Where can I edit this text? I obviously don't want to modify the core fedex module files.

/home/website/public_html/app/design/frontend/Smartwave/porto_child/i18n/en_US.csv

"Express Saver","Express Saver (3 Day Delivery)",module,Magento_Fedex

I also tried putting the string here with no success,

/home/website/public_html/app/i18n/en_US.csv

"Express Saver","Express Saver (3 Day Delivery)",module,Magento_Fedex

Thanks


texts: Import errors (Image does not exist) external images (10000+ products)

texts:
I am doing a CSV import for 10.000 + products with external URL's for the images.

The strange thing is that 4000 products get imported perfect (products with AND without images) but 6000+ products don't get imported and the error for every skipped product: "Image does not exist.".

Kinda strange since it doesn't matter if there is an image or not (at least this works for the 4000 products the do get imported.

Any idea's what could be the problem?

UPDATE:

After a couple of tries now 6092 of 10000+ get imported and its exactly the same CSV file. Hope somebody can enlighten me..


texts: Magento 2.3.3 newsletter subscription not working

texts:
I am having issues with the newsletter subscription in magento 2.3.3-p1 (never set it up in any other version).
I have created the transaction email templates and selected them in Configuration > Customer > Newsletter and made sure this is set to enabled. I have "confirm subscription" enabled but i dont get the confirmation email or a success message on the website. I am using the Mageplaza SMTP plugin and i have tested this and it does work.
I am using Porto theme and it is the signup box in the footer that i have tried. On account sign up, ticking the box to subscribe works.
Where do i need to look next?


texts:
I have a custom module that sends email on localhost but now when I uploaded it to a live server, it generates an exception saying that "Unable to send mail."

Note: emails are enabled on the server and it sends registration or other emails.
I think it is not a duplicate question as in this: Magento e-mail sending does not work question email never got delivered. where as in my case registration/order emails are successfully delivering.


texts: How to remove default contact form validation in Magento2.2.5?

texts:
I want to remove default contact form validation and add my jquery validation in contact form in Magrnto2.2.5?

Any help would be appreciated.


texts: Attribute back to default value on checkout

texts:
Please help. The configurable price is £39 and over a certain size it is £42, but when you add say a size 9 to basket, in the cart it defaults back to size 2.

I have the 'Simple configurable product' module, but when a customer clicks a different size, on the checkout page it goes back to default size


texts:
To call the image from my media/img folder & display it in my list page I have used the below code:

 <?php echo "<img src='".Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA)."/img/".trim($value).".png'/>"; ?>

Now I want to call the image from my media/wysiwyg folder.

Is there any other way to call image from there apart from above mentioned code? Someone guide me please.


texts: some products are not billing and checking out

texts:
I am using magento 1.9.2.0. some of my store simple products from specific categories are not ordering, it got stuck on billing info. But when i tried to order a product from different categories it got successfully ordered.

also, when i add product from both categories it also get successful order.

please help me to solve this.


texts: Magento 2 Cybersource - MasterCard throws Transaction Declined error

texts: We are using Magento Commerce 2.3.5 with the Cybersource payment method. VISA, American Express, Discover cards are working fine. But the Mastercard throws "Transaction Declined. Please try again" error on Checkout. While checking the payment response, it has a field called "invalid-field": "card_type". But the card_type value has sent as'002'. Not sure why it's not working only for MasterCard.


texts: How can I get the date of birth of a guest customer? Where is this information in the database?


texts:
I am developing a cron supposed to capture all the recent orders from a specific payment method, but I currently have a problem getting all the orders from a specific payment method.

I thought that the payment method would be in the sales_flat_order table, but it isn't, so I can not use something like :

$ordersCollection = Mage::getModel('sales/order')->getCollection()
    ->addFieldToFilter('payment_method', $paymentMethod);

How can I filter all the orders and only get the one with a certain payment method ?


texts:
From Admin I have added correct credentials for DHL, like Access ID, Password & Account Number. When i Enable then on Frontend,  it always display

I have set Allowed All Countries & My Shipping Address Country is also Valid.

Product has also Weight.

What is missing i'm in Setting or what's Wrong?


texts:
I hope you don't mind me expanding on this question. Using what's explained I got the css working in my template file. But I have not been able to get it working from local.xml, so I am repeating myself several times within the same layout file.

I got to thinking that a local.xml file would be useful in this situation, so what I tried to do was take the node that worked in the layout file and wrap it in a reference node in local.xml and call that reference node

This works

frontend/base/default/layout/modulename/layoutFileForModule

<user_register_form>
    <block type="page/html_head" name="head" output="toHtml">
        <action method="addCss"><stylesheet>css/normalize.css</stylesheet></action>
    </block>
    <block type="core/template" name="prefcentre_regform" output="toHtml" template="ps/prefcentre/signup.phtml" />
</user_register_form>

This does not work

frontend/base/default/layout/local.xml

<reference name="someReferenceHandle">
    <block type="page/html_head" name="head" output="toHtml">
        <action method="addCss"><stylesheet>css/normalize.css</stylesheet></action>
    </block>
</reference>

frontend/base/default/layout/modulename/layoutFileForModule

<user_register_form>
    <reference name="someReferenceHandle">
        <block type="core/template" name="prefcentre_regform" output="toHtml" template="ps/prefcentre/signup.phtml" />
    </reference>
</user_register_form>

I have misunderstood a tutorial somewhere, I thought Magento would look for the layout.xml file first when it compiles all the .xml files, then by me using the reference handle I was able to reference the block within that handle.

Why does example one work and example two fail?


texts: Magento transactional emails are not being sent & cron jobs are not working

texts: Magento is not sending any emails, no confirmation mails, no invoice mails, no shipment mails or anything. The server sends email by command line and the contact form works, but transactional mail is not being sent. How can I fix it?


texts: Magento2 swatch image change Ajax return 404

texts:
I recently upgraded my Magento version from 2.1.9 to 2.3.3, after upgrade everything is working fine else the changing of configurable swatches.

On changing the configurable swatches product image is not changing and the Ajax in network is returning a 404 (it should have returned a json with image URLs).

https://magentodomain.com/swatches/ajax/media/

This is the Ajax that is returning to 404.

Any idea ?


texts: Set maximum limit of products purchased from a store for a day (not per customer or cart)

texts:
We are using Magento for a bakery website. There is a limit in the number of products that can be served per day (not for a single customer or cart, but for the whole store)...

The number of chicken bread rolls shown in the website is 100
(inventory..>Qty..>100)
On 30/Sept/2016, the maximum order can be placed (by total number of customers) is 20 (suppose we have the ability to make 20 chicken bread rolls only on a day - this 20 can be ordered by a single customer or by many customers). Oct 1st,2nd etc -Daily - this can be the case.


texts: UpgradeSchema/InstallData files not working

texts:
I've the following setup:

Company/Custom/etc/module.xml:

<?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="Custom" setup_version="1.0.6"></module>
</config>

Company/Custom/Setup/UpgradeSchema.php:

<?php

namespace Company\Custom\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;

class InstallSchema implements InstallSchemaInterface
{

/**
 * {@inheritdoc}
 * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
 */
public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
    $installer = $setup;

    $installer->startSetup();

    $eavTable = $installer->getTable('customer_entity');

    $columns = [
        'custom' => [
            'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
            'length' => '1',
            'nullable' => true,
            'comment' => 11,
        ],
    ];

    $connection = $installer->getConnection();
    foreach ($columns as $name => $definition) {
        $connection->addColumn($eavTable, $name, $definition);
    }

    $installer->endSetup();
}

}

I've removed the module from the setup_module table and run the upgrade commands.
Also, the module is appears in the dashboard and its enabled.

The problem is that table is not created in database after I run the scripts but if I put errors in the php file, the upgrade scripts run without error.

As you can see I incremented the module version in the module.xml.

Thanks.


texts: Where is the "CREATE TABLE" definition for catalog_product_flat* tables?

texts: I'm looking to add indexes the table to it to make lookups faster. If you manually add an index in MySQL, it will disappear at the next Magento "reindexing" event.


texts: How to update stock and set stock AVAILABILITY to in stock from same csv file

texts: I have been added 5000 products in my store and initially all products QTY is 0 and STOCK AVAILABILITY is "OUT OF STOCK" i want to update all my products stock from a single csv so when this csv file run it update the qty and set the STOCK AVAILABILITY "IN STOCK". please tell me how to do that because this is very confusing for me and which tool is used to update stock in this way


texts: PDF Invoice; changing shipping and other text

texts:
I am creating a new PDF Invoice and most is fine but the one thing that I just cannot find is how to change the text of the 'totals' block at the end!

Currently this shows

Subtotal
Shipping & Handling
Grand Total

and I want it to show

Sub Total
Delivery
Total

Should be very easy and I expected to be able to overwrite the values in my local locale translate.csv file with an entry such as

"Shipping & Handling","Delivery"

but it doesn't work!

Cache cleared, etc. but no change on the invoice.  What am I missing?

Or can anyone tell me how to get these values from the order so I can craft the lines myself?

Magento 1.9.0.1


texts: I changed Frontend language and the frontend changed

texts:
I have changed the front-end language, Now my site looks different. It seems that the css is lost..
How can I change the language without loosing my style of front-end ?


texts: How to Create Multi-Language Store in Magento 2?

texts:
I have a Magento store and I want to create a store for multiple languages.
can anyone gives briefly describe how to set up the store?
Thank you.


texts: unable to enable custom module in Magento ver. 2.0.0-rc

texts:
I have created custom module in Magento ver. 2.0.0-rc and I'm trying to enable by using below commands.

php -f bin/magento module:enable --clear-static-content Learning_Custom
php -f bin/magento setup:upgrade

But it's not enabling. If I missing any other commands to activate module please let me know?


texts: is site hacked ? strange home page & music displaying

texts:
our site home page looking like this

is our site hacked ?  strange home page & music displaying .

but backend is working fine.


texts: Adding jQuery doesn't seem to do anything

texts:
To add the jquery, plus my own file (main.js), I pasted this piece of code in my local.xml:

    <block type="core/text" name="google.cdn.jquery">
        <action method="setText">
            <text><![CDATA[<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script><script>window.jQuery||document.write('<script src="/path/to/your/jquery.js">\x3c/script>');</script><script>jQuery.noConflict();</script>]]></text>
        </action>
    </block>

    <action method="addItem">
        <type>skin_js</type>
        <name>js/main.js</name>
    </action>

Seems alright, but when I use this function in my main.js file, it doesn't do anything. Not even a console error:

$j('.block-title').click(function(){
    alert();
});

I know this will probably be marked as a duplicate, but all the answers I've found don't seem to work. I have tried changing the classname, but that also did not work.

UPDATE

So I found out jQuery does work, with this:

var $j=jQuery.noConflict();

But there is still a problem.

$j(document).click();

Works fine, but when I call a class, like this:

 $j('.footer').click()

It does nothing. I checked the classname alot, and even changed a few times to test. Didn't work. Is it possible, that jQuery 1.10.2 uses another form of calling classes?

LAST UPDATE:

Seems I had forgotten to place the .click function within the $j(document).ready() function... stupid me


texts: Products not showing on category page after reindex in magento 2.3.2

texts:
I have set up the Magento 2.3.2 website on the Nexcess Cloud Hosting server. I have transfer all the files and database from my localhost. Everything is working fine except for the Indexing process. Whenever I used the CLI command

  php bin/magento indexer:reindex

All the products showing from the category pages stops and displayed a message that there is no product matching. I have debugged the issue and found that after run the command "catalog_product_index_price" table get empty and there is no data. when I import the local data in this table all products displayed again. is it the hosting issue OR should I need to debug the cod more

Can you anyone please how can I debug why to reindex process not working properly.

you can see the CLI command that indexing process not taking any time for execution

Thanks in Advance


texts: Outdated Amazon_core after composer update (Magento 2.2.4)

texts:
I am getting this error:

Amazon_Core db schema version: defined in codebase - 2.0.12, currently installed - 2.0.4

and

Amazon_Core db data version: defined in codebase - 2.0.12, currently installed - 2.0.4

I have not been able to find any information on this issue, or a packagist repo that looks like the right choice for Amazon_Core.  I also have not found anything in my composer.json that relates to Amazon_Core.


texts: Magento2 error on injecting customer session in block

texts:
I'm trying to inject customer session in my block:

use Magento\Framework\View\Element\Template;
use Magento\Customer\Model\Session;

class Header
extends Template
{
protected $session;

public function __construct(
    Template\Context $context,
    Session $customerSession
)
{
    $this->session = $customerSession;
    parent::__construct($context);
}

public function getBaseUrl(){
    return $this->_storeManager->getStore()->getBaseUrl();
}

public function isCustomerLogged()
{
    if($this->session->isLoggedIn())
        return "yes";
    else
        return "no";
}

public function getLoggedCustomerName(){
    return $this->session->getCustomer()->getFirstName();
}
}

Updated question

$this->session->isLoggedIn() always returns false whereas in controller, it returns true.
The Context namespaces are different for both:

use Magento\Framework\App\Action\Context;
use Magento\Framework\View\Element\Template\Context;

Please help


texts: Why Magento core modules is inside vendor folder?

texts:
I know i should not modify any code inside vendor folder. And the vendor folder should be ignored in the git server.

But what if i need to make some small changes for the core module of my Magento application, instead of rewriting the whole thing of core module?


texts:
I had a customer order a product on my website and noticed that it was sold for bellow my cost. The store has 2 views for languages. When I went to update the price on the English store view (to force it to the correct price), I hit save, it then showed the original incorrect price 49.50$ - it will not update even though it says the price is [GLOBAL]

Default Store View:

English (Problem) Store View:

But when you look in the Manage Products view and select English as the store view, the correct price is shown.

I'm tempted to edit the database directly but I'm sure there is a method that will update this pricing and I hope that someone has come across this before.

How can I update the price of this problem product?

and

How can I verify that all my products are using the default store view value?


texts: how to optimize load all categories with image

texts:
right now, I have two nested foreach to loop through all the category, and it's extremely slow (3-4s on my local server). I think the problem is i use ->LOAD() to get the image path for the child category. is there any other way of doing it? or I should just redesign the whole navigation ui? any suggestion?

$categories = Mage::getSingleton('catalog/category')
    ->getCollection()
    ->addAttributeToSelect('id')
    ->addAttributeToSelect('name')
    ->addAttributeToSelect('url_key')
    ->addAttributeToSelect('url')
    ->addAttributeToFilter('level',2)
    ->addIsActiveFilter()
    ->addAttributeToSort('position');

foreach ($categories as $category):
    $id = $category->getId();
    $children = $category->getChildrenCategories();
    $name = $category->getName();
    $url_path = $category->getUrl();

    foreach ($children as $child):
        $childId = $child->getId();
        $thisChild = Mage::getSingleton('catalog/category')->load($childId);
        $name = $thisChild->getName();
        $url_key = $thisChild->getUrlKey();
        $url_path = $child->getUrl();
        $img = $thisChild->getImageUrl();
    endforeach;
endforeach;


texts: magento2 CatalogSearch ResultController params missing

texts:
Under \Tagalys\Tglssearch\Controller\CatalogSearch\ResultController.php

class ResultController extends \Magento\CatalogSearch\Controller\Result\Index
{
   public function execute()
   {
      $params = $this->getRequest()->getParams();
    $response = array();
    //Custom Change End

    //$query = Mage::helper('catalogsearch')->getQuery();
    $this->_objectManager->get('Magento\CatalogSearch\Helper\Data')->checkNotes();

    $this->layerResolver->create(Resolver::CATALOG_LAYER_SEARCH);
    $query = $this->_queryFactory->get();

    /* @var $query Mage_CatalogSearch_Model_Query */

    //$query->setStoreId(Mage::app()->getStore()->getId());
    $query->setStoreId($this->_storeManager->getStore()->getId());

    if ($query->getQueryText() != '')
    {
        //if (Mage::helper('catalogsearch')->isMinQueryLength()) {
        if ($this->_objectManager->get('Magento\Search\Helper\Data')->isMinQueryLength())
        {
              $query->setId(0)
                ->setIsActive(1)
                ->setIsProcessed(1);
         }

why does the $query variable does not include "is_active" "is_processed" params

Below is the output in magento1x from class Mage_CatalogSearch_Model_Query Object , but for Magento2x i get from Magento\Search\Model\Query Object hence im not getting the above params like is_active.


texts: Magento 2 Commerce Enable Elastic Search

texts:
Context:

As you may know, Magento 2 Commerce(used to be Enterprise) comes with Elastic Search support/integration for catalog search.

What I've done:

I have a fully functional ES service (I'm using docker though I think this is not a problem).

I have followed the steps mentioned here:

http://devdocs.magento.com/guides/v2.1/config-guide/elasticsearch/configure-magento.html

And I have a successful connection. (Step 5)

I've re-indexed all. Still, Nothing goes through to Elastic Search.

When I perform a search I get this:

  Notice: Undefined index: suggestions in
  /var/www/magento/vendor/magento/module-elasticsearch/Model/DataProvider/Suggestions.php
  on line 158

Now this is out of the box Magento stuff.

Am I missing something? Can anyone provide any clues on how to start debuging this?

I do not see anything in the logs when I perform the reindex.


texts: At what point in the payment process does M2.4 insert an order when using Paypal standard?

texts:
When does M2.4 insert order in order admin if using PayPal Standard?
When I click on 'Place Order' from M2 checkout using PayPal Standard and I am taken to PayPal to pay.  Then I decide to not buy, so I leave the PayPal Payment page.
NO order is inserted... on M1 it would be. Using another payment processor it would be on M2.4
Why would this happen?  Could there be something in the configuration I have missed?
many thanks


texts: How to display data instead of recently viewed products are not there

texts:
When recently viewed products are not there it shows blank space, I want to display some text or html on that blank space and after visited products it will display recently viewed products.
Thanks in advance.


texts: Remove Radio Buttons on Step 1 of Magento Onepage Checkout

texts:
I'm looking remove the "Continue" button on step 1 of Magento Onepage Checkout. I've tried the code at Thinking Magento with no luck.

Rather than a radio button, I'd like the option to be a button itself. Once clicked, the user is moved onto step 2 based on their selection.

Here is the current code in onepage:

<?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>

            <?php if( $this->getQuote()->isAllowedGuestCheckout() ): ?>

                <input type="radio" name="checkout_method" id="login:guest" value="guest"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_GUEST): ?> checked="checked"<?php endif; ?> class="radio" /><?php echo $this->__('Checkout as Guest') ?>

            <?php endif; ?>

                <input type="radio" name="checkout_method" id="login:register" value="register"<?php if($this->getQuote()->getCheckoutMethod()==Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER || !$this->getQuote()->isAllowedGuestCheckout()): ?> checked="checked"<?php endif ?> class="radio" /><?php echo $this->__('Register') ?>

    <?php else: ?>
        <input type="hidden" name="checkout_method" id="login:register" value="register" checked="checked" />
    <?php endif; ?>

&nbsp;

        <?php if ($this->getQuote()->isAllowedGuestCheckout()): ?>
            <button id="onepage-guest-register-button" type="button" class="button" onclick="checkout.setMethod();"><?php echo $this->__('Continue') ?></button>
        <?php elseif ($this->helper('checkout')->isCustomerMustBeLogged()): ?>
            <button id="onepage-guest-register-button" type="button" class="button" onclick="window.location='<?php echo $this->helper('checkout/url')->getRegistrationUrl();?>'"><?php echo $this->__('Register') ?></button>
        <?php else: ?>
            <button type="button" class="button" onclick="checkout.setMethod();"><?php echo ($this->getQuote()->isAllowedGuestCheckout() ? $this->__('Continue') : $this->__('Register')) ?></button>
        <?php endif; ?>

And there's the setmethod js:

    setMethod: function(){
    if ($('login:guest') && $('login:guest').checked) {
        this.method = 'guest';
        var request = new Ajax.Request(
            this.saveMethodUrl,
            {method: 'post', onFailure: this.ajaxFailure.bind(this), parameters: {method:'guest'}}
        );
        Element.hide('register-customer-password');
        this.gotoSection('billing', true);
    }
    else if($('login:register') && ($('login:register').checked || $('login:register').type == 'hidden')) {
        this.method = 'register';
        var request = new Ajax.Request(
            this.saveMethodUrl,
            {method: 'post', onFailure: this.ajaxFailure.bind(this), parameters: {method:'register'}}
        );
        Element.show('register-customer-password');
        this.gotoSection('billing', true);
    }
    else{
        alert(Translator.translate('Please choose to register or to checkout as a guest').stripTags());
        return false;
    }
    document.body.fire('login:setMethod', {method : this.method});
},

Curious if anyone has a more updated solution.


texts:
I'm trying to create a block I can call in my override of 'root.phtml'.

In the root file, I added some extra classes to the body depending on the url, so I've created a module which I call on this page.

I've overridden root.phtml in my theme folder, and I've created a seperate module to call in this phtml file.
This is just to get the current URL (so if you have a better suggestion, please come forward) however when I try to load the application it comes up with

    Missing required argument $data of Karl\OverrideView\Block\OverrideView

The file being refered to is;

namespace Karl\OverrideView\Block;

class OverrideView
{

public $assetRepository;
protected $_storeManager;

public function __construct(

    \Magento\Framework\View\Element\Template\Context $context,
    array $data = [],
    \Magento\Store\Model\StoreManagerInterface $storeManager
){
    $this->_storeManager = $storeManager;
    return parent::construct($context, $data);
}

public function getFullUrl(){
    return $this->_storeManager->getStore()->getCurrentUrl(false);
}
}


texts: Add query parameter to current url in phtml

texts:
I want to add query parameter to my current url, I'm getting current url in my phtml like this:

$current_url = $this->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true]);

I want to add query parameter to my url so it will look like this:

  https://currenturl.com?new_query=123

And when the current url already has another query parameter, it will look like this:

  https://currenturl.com?old_query=22&new_query=123


texts: Include Tier Prices in Price Range on Catalog Listing Page

texts:
For a configurable product with price differentials, Magento's catalog listing page (the page where Magento displays a list of products), prices can be displayed as a range

$35.23 - $64.00

(Update: Stock Magento can't display prices as a range.)

However, this range doesn't not incorporate (or does not appear to incorporate) price possibilities based on tiered pricing.

Is there a canonical/sane (ideally performant) way to get these price ranges to include the lowest/highest price including all tiered price options?


texts: Magento 2: How to get special price from the order?

texts:
Question: I need to know if a product is bought with special price or not.

More Background:
We are using three prices for our products, which are original price, special price and tier price. We have integrated Magento with another system, called Linx. This system needs to know if the price is a special price, or not.

When I look at the sales_order_item table, I can list the following fields related with the price:

price
base_price
original_price
base_original_price
price_incl_tax
base_price_incl_tax
discount_percent
discount_amount

Paraphrased Question: How can I say that one of these fields hold special price for sure?


texts: Magento 2.3.X Custom Module JavaScript won't load with require.js

texts:
I am building a module, and the HTML loads fine, but the JS isn't.
Here is what I have:

Vendor Name: NewShop
Module Name: HelloWorld

File: app/code/NewShop/HelloWorld/view/frontend/requirejs-config.js

var config = {
  map: {
    '*': {
      "helloworld": "NewShop_HelloWorld/js/newshop_helloworld",
    }
  }
};

File: app/code/NewShop/HelloWorld/view/frontend/web/js/newshop_helloworld.js

require(["helloworld"], function($) {
  console.log('Hello World!')
});

I cleared up the cache and everything. I can't see the console message show up, even though the module shows fine.


texts: How to get theme specific cms page links in front end?

texts:
I have two themes (desktop and iphone) for same store view.
I have created cms pages for both the themes differently due to different look.
so there are 2 about-us pages, 2 contact-us pages..and so on..

Now there is a link called "sitemap" in which all the links of cms pages and categories is showing.
The problem is..
both the links of cms pages are displaying.

The function resoponsible for getting cms pages is as follows..

public function getCMSPages(){

    $storeId = $this->helper('core')->getStoreId();
    $cms = Mage::getModel('cms/page')->getCollection()
                    ->addFieldToFilter('is_active',1)
                    ->addStoreFilter($storeId);
    $url = Mage::getBaseUrl();
    $html = "";
    foreach($cms as $cmspage):
        $page = $cmspage->getData();
        if($page['identifier'] == "no-route" || $page['identifier'] == "enable-cookies" || $page['identifier'] == "empty"){
             /* do nothing */
         } else {
            if($page['identifier'] == "home"){
                $html .= "
".$page['title']."
\n";
            } else {
                $html .= "
".$page['title']."
\n";
            }
        }
    endforeach;

    return $html;
}

Now What I want is..
How can I get theme specific cms page links in the frontend ?


texts: Magento 2 product import not working showing error

texts:
Maximum error count has been reached or system error is occurred!

Following Error(s) has been occurred during importing process:
Only the first 100 errors are shown.

General system exception happened
Additional data:

Notice: Undefined index: "SKU NAME" in /var/www/html/vendor/magento/module-catalog-import-export/Model/Import/Product.php on line 1905

Can any one help me to solve this error or debug this error why this error is showing.while updating product useing csv fiel.