texts: cataloginventory_stock_item - errno: 150 Foreign key constrain is incorrectly formed

texts:
I'm tranfering my magento2 website locally.

Importing website database gives me the following error:

ERROR 1005 (HY000) at line 636351: Can't create table 'cataloginventory_stock_item' (errno: 150 "Foreign key constrain is incorrectly formed")

This is the sql part that causes this:

DROP TABLE IF EXISTS `cataloginventory_stock_item`;
CREATE TABLE `cataloginventory_stock_item` (
  `item_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Item Id',
  `product_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Product Id',
  `stock_id` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT 'Stock Id',
  `qty` decimal(12,4) DEFAULT NULL COMMENT 'Qty',
  `min_qty` decimal(12,4) NOT NULL DEFAULT 0.0000 COMMENT 'Min Qty',
  `use_config_min_qty` smallint(5) unsigned NOT NULL DEFAULT 1 COMMENT 'Use Config Min Qty',
  `is_qty_decimal` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT 'Is Qty Decimal',
  `backorders` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT 'Backorders',
  `use_config_backorders` smallint(5) unsigned NOT NULL DEFAULT 1 COMMENT 'Use Config Backorders',
  `min_sale_qty` decimal(12,4) NOT NULL DEFAULT 1.0000 COMMENT 'Min Sale Qty',
  `use_config_min_sale_qty` smallint(5) unsigned NOT NULL DEFAULT 1 COMMENT 'Use Config Min Sale Qty',
  `max_sale_qty` decimal(12,4) NOT NULL DEFAULT 0.0000 COMMENT 'Max Sale Qty',
  `use_config_max_sale_qty` smallint(5) unsigned NOT NULL DEFAULT 1 COMMENT 'Use Config Max Sale Qty',
  `is_in_stock` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT 'Is In Stock',
  `low_stock_date` timestamp NULL DEFAULT NULL COMMENT 'Low Stock Date',
  `notify_stock_qty` decimal(12,4) DEFAULT NULL COMMENT 'Notify Stock Qty',
  `use_config_notify_stock_qty` smallint(5) unsigned NOT NULL DEFAULT 1 COMMENT 'Use Config Notify Stock Qty',
  `manage_stock` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT 'Manage Stock',
  `use_config_manage_stock` smallint(5) unsigned NOT NULL DEFAULT 1 COMMENT 'Use Config Manage Stock',
  `stock_status_changed_auto` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT 'Stock Status Changed Automatically',
  `use_config_qty_increments` smallint(5) unsigned NOT NULL DEFAULT 1 COMMENT 'Use Config Qty Increments',
  `qty_increments` decimal(12,4) NOT NULL DEFAULT 0.0000 COMMENT 'Qty Increments',
  `use_config_enable_qty_inc` smallint(5) unsigned NOT NULL DEFAULT 1 COMMENT 'Use Config Enable Qty Increments',
  `enable_qty_increments` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT 'Enable Qty Increments',
  `is_decimal_divided` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT 'Is Divided into Multiple Boxes for Shipping',
  `website_id` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT 'Website ID',
  PRIMARY KEY (`item_id`),
  UNIQUE KEY `CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID_STOCK_ID` (`product_id`,`stock_id`),
  KEY `CATALOGINVENTORY_STOCK_ITEM_WEBSITE_ID` (`website_id`),
  KEY `CATALOGINVENTORY_STOCK_ITEM_STOCK_ID` (`stock_id`),
  CONSTRAINT `CATINV_STOCK_ITEM_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  CONSTRAINT `CATINV_STOCK_ITEM_STOCK_ID_CATINV_STOCK_STOCK_ID` FOREIGN KEY (`stock_id`) REFERENCES `cataloginventory_stock` (`stock_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Cataloginventory Stock Item';

How can I fix this?


texts:
I have created the Payment gateway and it's ok, already sending payments, etc. Now I want to all the orders that were created through this gateway to have a Custom Refund (Credit Memo) button in the System Admin panel.

This refund will send to my custom API that does the refund of my payment (in the same system, but different API endpoint).


texts: Set category page title to its 'Name' if 'Page Title' not specified

texts:
I need to change the categories page title if their 'Page Title' attribute did not specify. It should set to their 'Name' attribute.
If I switch back to default theme the page title is correct so I think there's something in my custom layout xml files. I added a block with customer/form_login type in my head section and there's this line of code inside its class:

File: app/code/core/Mage/Customer/Block/Form/Login.php:
protected function _prepareLayout()
{
    $this->getLayout()->getBlock('head')
         ->setTitle(Mage::helper('customer')
         ->__('Customer Login')); // <-- This sets the title
    return parent::_prepareLayout();
}

I heard everywhere on the net to comment out this line but I don't want to do this because of two reasons:

It is bad and ugly even if I copy the whole file into app/code/local folder.
I noticed that the default theme will set the title correctly even if I include the login form block inside its head. So it must be something inside my layout files.

Any idea would be appreciated.


texts: How can i display single recent blog post?

texts: I need to display my recent blog post under all selected category landing page and selected products left side.


texts:
I am using Varien_File_Csv to save CSV data.

$csv = new Varien_File_Csv();
$csv->saveData($fileName, $data);

This approach always rewrites the CSV output file. Is there any way to use append method to output file instead of rewrite?


texts: Saving homepage do not invalidate Full Page Cache

texts:
I'm experience this strange issue on EE 1.13.1.0 on the CMS home page only:

I edit the homepage the changes are reflected on http://MYDOMAIN/home but not on http://MYDOMAIN.
If I clean the cache from backend it still don't see the changes on http://MYDOMAIN but I need to remove cache files manually.

The issue is related to the full page cache and looks like the 2 requests (http://MYDOMAIN and http://MYDOMAIN/home) have different cache.

I can see that Mage_Cms_Model_Resource_Page has in the _afterSave a call to Mage::app()->getCacheInstance()->invalidateType('layout');

Anyone have same issue ?


texts: How to bind an action after customer login success using Magento?

texts:
I'm using Magento 1.4.1.1. After logout success, customer is rooted to "logout.phtml" first and "home page" later.

Is there anyway I could make Magento run couple of "php" codes after "login" success ?

Please don't hesitate to provide code samples as I'm new in Magento.

/var/www/app/etc/modules/Lpf_ModuleCookie.xml

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

/var/www/app/code/local/Lpf/ModuleCookie/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Lpf_ModuleCookie>
            <version>0.1</version>
        </Lpf_ModuleCookie>
    </modules>
    <events>
        <customer_login>
            <observers>
                <customer_login>
                    <type>model</type>
                    <class>ModuleCookie/observer</class>
                    <method>customerLogin</method>
                </customer_login>
            </observers>
        </customer_login>
    </events>
</config>

/var/www/app/code/local/Lpf/Observer.php

<?php
class Lpf_ModuleCookie_Model_Observer
{
     /**
      * Run couple of 'php' codes after customer logs in
      *
      * @param Varien_Event_Observer $observer
      */
     public function customerLogin($observer)
     {
         Mage::log(__METHOD__ . '() Hello!'); // Remove afterwards. Check your var/log/system.log to see if came to this point
         $customer = $observer->getCustomer();
         // "run couple of 'php' codes"
     }

}
?>


texts: How to give onclick event for admin grid action link

texts:
I have a custom admin grid for return items. For which I need to add a popup to add a comment for every action below

I have written a js function for the modal popup. But I am unable to trigger onclick event for action links.
   I have tried below code in UI action file, it is not working.

Many thanks in advance.


texts: Error Array to string conversion in vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 3101

texts:
When i tried to edit an image in custom module i am getting an error like below.

  1 exception(s):
  Exception #0 (Exception): Notice: Array to string conversion in /var/www/html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 3101

I have a fix for this. replacing this code set

case 'longtext':
$value  = (string)$value;
if ($column['NULLABLE'] && $value == '') {
    $value = null;
}
break;

With

case 'longtext':
if(!is_array($value)) $value  = (string)$value;
else $value = '';
if ($column['NULLABLE'] && $value == '') {
    $value = null;
}
break;

I want to know how can i do this in proper way rather than directly editing the core file.
UPDATE
My modules Save.php

try{
    $uploader = $this->_objectManager->create(
                'Magento\MediaStorage\Model\File\Uploader',
                ['fileId' => 'image']
            );
    $uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png']);
            /** @var \Magento\Framework\Image\Adapter\AdapterInterface $imageAdapter */
    $imageAdapter = $this->_objectManager->get('Magento\Framework\Image\AdapterFactory')->create();
    $uploader->setAllowRenameFiles(true);
    $uploader->setFilesDispersion(true);
    /** @var \Magento\Framework\Filesystem\Directory\Read $mediaDirectory */
    $mediaDirectory = $this->_objectManager->get('Magento\Framework\Filesystem')
                ->getDirectoryRead(DirectoryList::MEDIA);
    $result = $uploader->save($mediaDirectory->getAbsolutePath('news_news'));
    if($result['error']==0)
    {
        $data['image'] = 'news_news' . $result['file'];
    }


texts: How to check order details when placed as guest from frontend?

texts:
How can user check the order details when the order is placed as guest. I have tried 'yourdomain.com/sales/guest/form/' but it requires Billing Last name which is not available in case of guest checkout.

Any alternate to get the order details?

Thanks


texts: core_resource creates module_setup but install script is not called

texts:
I am trying to create an install file but Magento is not running that file, although it is putting an entry in to the core_resource table.

I have deleted the row which was created and loaded the page again. The row was re-created but the install file was not called (There is only and echo statement and die statement in that file to check if its working).

Trying to solve this problem I found this question on stackoverflow and have followed the advice, but I cant seem to get a result. When I break the config, I get a 404 page, I have changed the file permission so there is no problem there. Finally I have loaded the config, in there I have found Ps_Prefs_Model_Mysql4_Setupcore_setupcore_writecore_read, so Magento is doing something with my file, but I cannot tell what from this.

I'm hoping that it is a simple casing issue (which I cannot see, so below is my files and my config)

I also tried renaming the install file mysql4-install-0.1.0.php, that had no effect

<config>
    <modules>
       <Ps_Prefs>
          <version>0.1.0</version>
       </Ps_Prefs>
    </modules>

<global>
    <models>
        ........
    </models>

    <resources>
        <prefs_setup>
            <setup>
                <module>Ps_Prefs</module>
                <class>Ps_Prefs_Model_Mysql4_Setup</class>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </prefs_setup>

        <prefs_write>
            <connection>
                <use>core_write</use>
            </connection>
        </prefs_write>
        <prefs_read>
            <connection>
                <use>core_read</use>
            </connection>
        </prefs_read>
    </resources>

    ............

</global>

In log/system.log I get this message

2013-10-01T09:36:13+00:00 ERR (3): Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 8: parser error : Start tag expected, '&lt;' not found  in /Users/tsimps/Sites/magentoDevTest/lib/Varien/Simplexml/Config.php on line 510
2013-10-01T09:36:13+00:00 ERR (3): Warning: simplexml_load_string() [function.simplexml-load-string]: &lt;/config&gt;--&gt;  in /Users/tsimps/Sites/magentoDevTest/lib/Varien/Simplexml/Config.php on line 510
2013-10-01T09:36:13+00:00 ERR (3): Warning: simplexml_load_string() [function.simplexml-load-string]:             ^  in /Users/tsimps/Sites/magentoDevTest/lib/Varien/Simplexml/Config.php on line 510
2013-10-01T09:36:14+00:00 DEBUG (7): HEADERS ALREADY SENT:
[0] /Users/tsimps/Sites/magentoDevTest/app/code/core/Mage/Core/Controller/Response/Http.php:52
[1] /Users/tsimps/Sites/magentoDevTest/lib/Zend/Controller/Response/Abstract.php:766
[2] /Users/tsimps/Sites/magentoDevTest/app/code/core/Mage/Core/Controller/Response/Http.php:83
[3] /Users/tsimps/Sites/magentoDevTest/app/code/core/Mage/Core/Controller/Varien/Front.php:188
[4] /Users/tsimps/Sites/magentoDevTest/app/code/core/Mage/Core/Model/App.php:354
[5] /Users/tsimps/Sites/magentoDevTest/app/Mage.php:683
[6] /Users/tsimps/Sites/magentoDevTest/index.php:87

Cache is disabled and has been cleared (just incase)

I am using version 1.7.0.2


texts: How can I accomodate category names also to the magento quick search?

texts:
I am new to magento2, I wanted to know how we can bring category names also to the quick search. For eg: When I search using a keyword 'Bag', I should get a list off all products under the category "Bag" + all products that have the keyword 'bag' in its title , description or SKU.
Thanks


texts: Magento1 or 2 - Configurable product added to sales order line table as well as simple

texts:
As per heading, I have always wondered why both a configurable and simple are recorded when an order for a simple product is made?

Magento 1.9 example:

I can see that when an order is made, the simple product doesn't really contain much information except a reference to the parent product.  The configurable product holds most of the relevant information such as the price, configurable options for the particular simple product in the 'product_options' field, etc.

However, if I update the simple product with price, options, etc, and delete the configurable product, it still displays exactly the same way on the Magento admin order screen.

'product_options' field sample:

a:6:{s:15:"info_buyRequest";a:3:{s:3:"qty";i:1;s:15:"super_attribute";a:3:{i:81;s:2:"12";i:92;s:2:"64";i:132;s:1:"6";}s:7:"options";a:0:{}}s:15:"attributes_info";a:3:{i:0;a:2:{s:5:"label";s:12:"Manufacturer";s:5:"value";s:1:"A";}i:1;a:2:{s:5:"label";s:5:"Color";s:5:"value";s:8:"Light T1";}i:2;a:2:{s:5:"label";s:4:"size";s:5:"value";s:1:"S";}}s:11:"simple_name";s:22:"Samsung Galaxy S6 Note";s:10:"simple_sku";s:29:"Samsung-Galaxy-S6";s:20:"product_calculations";i:1;s:13:"shipment_type";i:0;}

The reason I ask is that I am importing orders into Magento - I am only importing simple products (if they're children of configurable products) and it appears that I can achieve the same behavior as what is currently default.

Is there anything I am missing by doing this?  Will it impact any functionality? Doesn't seem to have any impact on invoices, shipments, front-end-display, etc.  What is the point of having two lines for the same product?

Thank you.

EDIT: As per answer/comment. I reduce inventory like so:

$stockItemsFullSave = Mage::getModel('cataloginventory/stock')->registerProductsSale($stockItems);

If order fails, I don't add stockItemsFullSave to a transaction I use to save order/invoice and inventory, and roll back using standard functionality:

Mage::getModel('cataloginventory/stock')->revertProductsSale($stockItems);

I would assume this would decrement stock correctly and control all things related to inventory?


texts: How to modify part of the design of the details of the article magento 2?

texts:
I want to be able to modify a part of the page of the details of the products of magento 2

The marked part is the one that I want to be able to edit, add or remove content is that section.

So far I can modify the title, the price and the description below, but how do I manage to manipulate that section? From the admin panel is the content section. I have tried so

public function afterLoad(\Magento\Catalog\Model\Product $subject, $result)
{
    $subject->setData('content', $subject->getContent() . '- TEST CONTENT');
    return $result;
}

But it does not work, how can I solve it?

And this is my di.xml file

<config>
  <type name="Magento\Catalog\Model\Product">
    <plugin name="change_product" type="Devchannel\HelloWorld\Plugin\Product " sortOrder="1" disabled="false"/>
  </type>
</config>


texts: Magento 2 admin is not working after disable Magento_Theme

texts:
I made disable "Magento_Theme" module in (
Stores/Configuration/Advanced/Disable Modules Output), but after disabling I cannot see admin page (It's black page) and even storefront page, too. (Even I cannot see login page).. Is there anything I can do? (I think Magento is fail to set theme correctly when it load a page...).

I already tried to clear cache, all generation files...
Btw, this is Magento 2 store application.
Please help me..


texts: Magento 2 how can to get bank details in order success page

texts: How can i get bank details in order success page when i select in bank payment page and checkout.


texts: Magento 2: Remove change email checkbox and display all fields on customer account edit page

texts: i want to display change email checkbox field out side the checkbox and remove the change email checkbox.


texts: Clear installments on payment method change

texts:
My store have two payment methods, one based on credit card and another bank transfer. If I choose credit card and choose to installments, Magento update subtotal adding taxes.

If I give up to pay with credit card and change to bank transfer (who should't have taxes), the taxes of installments persists. How can I clear installments in this cenary?

I tried to use those events:

checkout_type_onepage_save_order_after
sales_order_place_after

But it is not triggered when I change the form of payment. Only when saved.


texts: Programmatically Adding Magento Products & Incrementing Sku?

texts:
I'm trying to write a script to add 10 products to Magento using php/mage.

This is what I have so far, in Magento 1.8.1

<?php
ini_set('memory_limit', '-1');
ini_set('display_errors', '1');
error_reporting(E_ALL);
require '../app/Mage.php';
$app = Mage::app('default');
set_time_limit(0);
$product = Mage::getModel('catalog/product');
$sku = 1;

do {
$product->setName(trim(strip_tags('Unnamed Product')));
$product->setDescription(trim(strip_tags('Description')));
$product->setShortDescription(trim(strip_tags('Short Description')));
$product->setSku($sku);
$product->setPrice(trim(strip_tags('19.99'))); # Set some price
$product->setWeight('1');
$product->setCreatedAt(strtotime('now'));
$product->setTypeId('simple');
$product->setTaxClassId(2); // taxable goods
$def_attribute_set = Mage::getModel('catalog/product')->getResource()->getEntityType()->getDefaultAttributeSetId();
$product->setAttributeSetId($def_attribute_set);
$stock_data=array(
'use_config_manage_stock' => 1,
'qty' => trim(strip_tags($data[13])),
'min_qty' => 0,
'use_config_min_qty'=>1,
'min_sale_qty' => 0,
'use_config_min_sale_qty'=>1,
'max_sale_qty' => 9999,
'use_config_max_sale_qty'=>1,
'is_qty_decimal' => 0,
'backorders' => 0,
'notify_stock_qty' => 1,
'is_in_stock' => 1
);
$product->setData('stock_data',$stock_data);
$product->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId()));
$product->setStatus(1);
$product->setVisibility(4);
$product->save();
$sku++;
} while ($sku<=10)

?>

I'm trying to tell it to add products, increment the sku by 1, and keep adding and incrementing till it gets to 10. However it only adds one product and then does nothing?

Is there a better way to programatically add products to magento and increment the sku? Also trying to figure out how to  get Magento to check for the sku and skip it if it exists and have had zero luck with that as well.


texts: Add an external js file with custom name using integration

texts:
Is it possible to add an external js file based on domain name from integration ?

Lets say the domain is: example.com. When user installs my integration, I want to add a myintegration.com/examplecom.js to my magento store.


texts: Set default value to news_from_date and news_to_date

texts:
How can I automatically set the news_from_date and the news_to_date for a new product?

news_from_date should be the date now and news_to_date should be date now +1 week.


texts: How to Divide Cart items Based upon Attribute value

texts:
I was trying to Divide Cart items Based on Attribute value. I tried to fetch the attribute on Cart Page.

Basically I have Attribute is_ship_immediately with yes or no option. I have products with yes or no options in the cart. If option is yes for products in cart then I want to show option yes items under the title(Ship immediately). Then If option is no I want to Show option no items under title(Not Ship immediately).


texts:
I need to show Company Name in sales order grid. These are the files I created:

config.xml

<adminhtml>
    <events>
      <adminhtml_block_html_before>
            <observers>
                <addCompanyNameToSalesOrderGrid>
                    <class>Cpu_CustomGrid_Model_Observer</class>
                    <method>addCompanyNameToSalesOrderGrid</method>
                </addCompanyNameToSalesOrderGrid>
            </observers>
        </adminhtml_block_html_before>
    </events>
</adminhtml>

Observer.php

<?php
class Cpu_CustomGrid_Model_Observer extends Varien_Event_Observer
{
    public function addCompanyNameToSalesOrderGrid(Varien_Event_Observer $observer)
    {
        $event = $observer->getEvent();
        $this->_grid = $event->getBlock();
        if ($this->_grid instanceof Mage_Adminhtml_Block_Sales_Order_Grid) {
            $this->_collection = $this->_grid->getCollection();
            $this->_collection->joinAttribute('company', 'customer_address/company', 'default_billing', null, 'left');
            $this->_collection->addAttributeToSelect('company');
            $columnData = array(
                'header' => 'Company Name',
                'index'  => 'company',
                'type' => 'text',
            );

            $this->_grid->addColumnAfter('company', $columnData, 'name');
            $this->_grid->sortColumnsByOrder();
            // rebuild the filters
            $filter = $this->_grid->getParam($this->_grid->getVarNameFilter(), null);
            if (is_null($filter)) {
                $this->_collection->load();
            }
            $this->_collection->clear();
            if (is_string($filter)) {
                $data = $this->_grid->helper('adminhtml')->prepareFilterString($filter);
                $this->_setFilterValues($data);
            } else {
                if ($filter && is_array($filter)) {
                    $this->_setFilterValues($filter);
                }
            }
            // force a reload of the collection
            $this->_collection->load();
        }
    }

    protected function _setFilterValues($data)
    {
        foreach ($this->_grid->getColumns() as $columnId => $column) {
            if (isset($data[$columnId]) && (!empty($data[$columnId]) || strlen($data[$columnId]) > 0)
                && $column->getFilter()
            ) {
                $column->getFilter()->setValue($data[$columnId]);
                $this->_addColumnFilterToCollection($column);
            }
        }

        return $this;
    }

    protected function _addColumnFilterToCollection($column)
    {
        if ($this->_collection) {
            $field = ($column->getFilterIndex()) ? $column->getFilterIndex() : $column->getIndex();
            if ($column->getFilterConditionCallback()) {
                call_user_func($column->getFilterConditionCallback(), $this->getCollection(), $column);
            } else {
                $cond = $column->getFilter()->getCondition();
                if ($field && isset($cond)) {
                    $this->_collection->addFieldToFilter($field, $cond);
                }
            }
        }

        return $this;
    }
}

Unfortunately I cannot get it to work. What could be the problem?


texts: Paypal Express checkout not showing up on cart page

texts:
The paypal express checkout button not showing up on my cart pages. It shows up as a payment method on my checkout page however and works fine. I enabled the Display on Shopping Cart option even going down to the store view and trying and still a no go. I even tried putting my theme to default one and it still does not show up.
Any help would be appreciated.
Thanks


texts: Magento 1.9 and php7.0 - image upload error File was not uploaded

texts:
Hello,
We have face issue in admin area. "Showing error File was not uploaded"


texts: How to get values of a particular attribute in category page in Magento 2

texts:
I am using Magento 2.3

I want to display values of a particular attribute in category page.
For ex. I have an attribute called 'test' and I have 10 values in this attribute. I have selected different values of this attribute in different products.

Now I want to display values of "test" attribute which are selected in product(not all values) and I want to display list of attribute values in category page instead of product listing.

So How can I achieve this?


texts:
Have upgraded from 1.8.1.0 to 2.3.3.

But every single category page is now 404'd.

Have truncated a url_rewrite and catalog_url_rewrite_product_category, but no luck.

Have gotten rid of the other root and clear:cached and re-indexed.

Other symptoms: All of the form fields in the categories are blank.

Would very much appreciate any help, thank you!

--Just to note CMS rewrites are working fine, however "http://host/catalog/category/view/id/[id]" returns 404, so doesn't seem to be a rewrite problem.


texts:
How do you manage to show Yes/No attribute on layered navigation.

I did not find any extension for that !

It seems impossible to not be able to achieve this.


texts: How can magento2 support .less or css for multi language locale?

texts:
For CSS, I found that we can add web/i18n/en_US/mymodule.css for module

If I want to add some locale specific CSS for the core module, where should I put them in? e.g. app/design/frontend/mypackage/mytheme/Magento_Catalog/web/i18n/en_US/catalog.css ?

But if I want to add locale specific .less file, how can I do this?


texts: Super-quick one. I'm hoping to get some assistance exporting sku and qty from an M1 database using SQL.


texts:
When I add a product in my shop magento it does not display. I am compelled to re-index to see my product. Yet in the indexes management they are all updated backup.

Can you help me?

Thank you very much

Alizée


texts: How can I pass variable from one block function to another function in magento block

texts:
This is my code:

namespace send\sms\Block;

class mobileverification extends \Magento\Framework\View\Element\Template
{

    public function checknumber(){
        $this->_resources = \Magento\Framework\App\ObjectManager::getInstance()
        ->get('Magento\Framework\App\ResourceConnection');

        $connection= $this->_resources->getConnection();
        $tableName = $this->_resources->getTableName('otpp');

        $dates = date("Y-m-d");

        $phone = $_POST["phone"];

        // SELECT DATA
        $sql = "SELECT otp FROM otpp WHERE `phone`='$phone' AND 'dates'='$dates' ORDER BY otp DESC LIMIT 1";
        $result = $connection->fetchall($sql);

        if(!empty($result)){
            // if already exists

            $code = $result[0];
            $otppass = $code['otp'];

            echo $otppass;

        }else{
            // if already not exists

            $randcode = rand(100000, 999999);

            $sendotp = $randcode;
            //insert data
            $sql = "INSERT INTO " . $tableName . "(phone, otp, dates) VALUES ('$phone', '$sendotp', '$dates')";

            echo $sendotp;
        }
        $connection->query($sql);

    }

    public function checkotp(){

        $ckotp = $_POST["getotp"];

        if($otppass=$ckotp){
            echo "otp verified";
        }else{
            echo "otp Not verified";
        }

    }

}


texts: Live price calculation based on dimensions

texts:
I want to calculate a price based on the dimensions of a product. Customers can set these dimensions in a custom option field. The price is set per cm2.

When a customer is adding a product to the shopping cart, the price is calculated with the following code. This is working.

    public function changingPrice(Varien_Event_Observer $observer){

        $event = $observer->getEvent();
        $quote_item = $event->getQuoteItem();
        $product = $quote_item->getProduct();
        $quantity = $product->getQty();
        $options = $this->getProductOptions($quote_item);

        if(sizeof($options) > 0)
        {
            foreach($options as $option)
            {
                if($option['label'] == 'Hoogte in cm')
                    $heightVal =  $option['value'];
                if($option['label'] == 'Breedte in cm')
                    $widthVal =  $option['value'];
            }

            $meter = ($heightVal*$widthVal)*$product->getPrice();
            $new_price = $meter*$quantity;
            $quote_item->setOriginalCustomPrice($new_price);
        }
    }

I'm wondering how to calculate the price live on input change?


texts:
I stuck while adding a product in magento 1.9
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.event_id' in 'on clause', query was: SELECT main_table.*, process_event.status AS process_event_status FROM index_event AS main_table INNER JOIN index_process_event AS process_event ON process_event.event_id=main_table.event_id WHERE (process_event.process_id = '8') AND (process_event.status = 'new') AND (entity = 'catalog_product') AND (type = 'mass_action');


texts: add icon to Magento carriers and shipping methods

texts:
i have some custom shipping methods which is made by different extensions like webshopapps matrixrate and etc... . i want to add an icon (.png file) to each carrier.

i know that shipment methods names are shown in frontend by this code:

   <?php foreach ($_shippingRateGroups as $code => $_rates): ?>

<?php echo $this->getCarrierName($code) ?>

how to change this code to show some .png file for each method?


texts: Product View.phtml Modification 1.9.2.4 Move Tab Description

texts:
i have delete the Short description and price add to cart size collors now are on the place i want i have try to move the code for description but than i get a blank page .

maybe you can suggest me wich code i have to move that the description is after add to card and add this .

code please follow this link CODE LINK

update


texts: Latest css changes not get updated in pub/static folder - magento 2.0.1

texts:
I installed magento 2.0.1 and working in developer mode.Now the problem is whenever I change css its not get reflect into pub/static folder . I could refer this Magento2: Re generate css file in pub/static folder but no luck. Before its working fine, Now only its getting problem.

folder permission : 755 and also try 777 but no luck

anything we can do apart from this

note: I am wondering, whenever deploy static content that time also not generated my new updated css old css only getting load and also when I delete any css from my theme pub/static folder its not get generated but, before it get generate after loading page.

Thanks in advance


texts: How do I customize theme in magento 1.9?

texts:
I am trying to customize design in magento. Magento version is 1.9.2.0.

This is my design settings in Magento Admin. Though I can not find any package rwd in magento/skin/frontend, so i created new package rwd/trend but it is not working.

When I create another package named ksade/trend, magento gives me this error. Can somebody help me to sort it out and guide me on how to customize a theme?

Edit
Skin/frontend dir

app/design/frontend dir

This is how site design look like


texts: Magento2.3.3 - Loading first product image if no base, small or thumbnail image is set?

texts:
How can I get the first product image of a product, If none of the products images are set as base, small or thumbnail image?
In all the examples I found based on getting base, small or thumbnail images for a product.
Thanks!


texts: Category Specific Layered Navigation Changes (Disabling Attribute Filters)

texts:
I'm trying to disable a particular attribute filter in layered navigation for a specific category. The attribute filter I wish to disable is the manufacturer in this instance.

I'm trying the following in the 'Custom Design Layout' for the category in question:-

<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml">
    <action method="unsetChild"><alias>manufacturer_filter</alias></action>
</block>

This is half working, it hides the manufacturer filter in the layered navigation, but it also hides everything else below this in catalog.leftnav.

Any idea how the above needs modifying to prevent that from happening?

To explain what I mean, here are screenshots.

Before the XML update

After the XML update


texts:
When you click on a product page, it only shows a one image.  Looking at the stack trace, it looks like there is some PHP error.  I think when I patched to 2.3.2, maybe something didn't updated?  How do I recover?

eg. click the product, then it is only the product image showing afterwards.


texts: Magento 2 How to disable price from orders, customer account and order view if custom module is enabled?

texts:
I have created one module which has admin side configuration to enable/disable the module. Now I want to hide the prices from "orders, customer account, and order view ". Means I want to hide the price, so the user can not see the price other information should be there.

How could I hide the price and totals from "cart/order/email" if the module is enabled?

I have one helper function which returns the value of the configuration.

I found the way to hide price from "order view, invoice, shipment, etc", I created one plugin:

<type name="Magento\Sales\Model\Order">
    <plugin name="price_hide_from_orders" type="Name\Module\Plugin\Order\Pricehide" sortOrder="1" disabled="false"/>
</type>

namespace Name\Module\Plugin\Order;

class Pricehide
{
    protected $helperData;

    public function __construct(
        \Name\Module\Helper\Data $helperData
    ) {
        $this->helperData = $helperData;
    }
    function afterFormatPrice($price, $addBrackets = false)
    {
        if($this->helperData->getModuleStatus()): // check moude enable or not
             return $this->helperData->getPriceMessage(); // message instead of price
        else:
            return $this->formatPricePrecision($price, 2, $addBrackets);
        endif;
    }
}

It gives error as below:

Fatal error: Uncaught Error: Call to undefined method Name\Module\Plugin\Order\Pricehide::formatPricePrecision() in app\code\Name\Module\Plugin\Order\Pricehide.php:18 Stack trace: #0

In "Magento\Sales\Model\Order.php" there are dependent functions available in Order.php file, how can we use it?

Thanks.


texts: Migration from Magento 1.9 to Magento 2.3 - Duplicated websites

texts:
I migrated from Magento 1.9.1 to Magento 2.3.4 using Data Migration Tool.

I follow the Settings - Data - Delta steps but at least i obtain duplicated websites/views of my site.

When I try to access to one category on my site I obtain the following error message: "There has been an error processing your request - The store that was requested wasn't found. Verify the store and try again".

Please can you help me to solve the issue?


texts: Show (.incl) tax and (.excl tax) after prices

texts:
I made two customer groups, one with Tax calculated in the product price and the other without the tax calculated in the product price. Now, whenever a customer group member is logged in with tax enabled, I want to show to product prices like so:

  $44,99 (incl. tax)

and when a customer group member is logged in from a group without tax, like so:

  $35,96 (excl. tax)

Is there a way to achieve this?

I've been looking in the core files for the file responsible for rendering the  <span class="price"> but could not find it. Anyone who might know how to do this?


texts:
A few weeks ago, my Magento Go website begin acting strange as far as the width of the website. When you load it, the website is completely centered but you have the ability to scroll right pretty far. I think it also depends on the size of your monitor.

Website: http://collegiatestorageandrental.gostorego.com/

This is what it looks like when it is loaded:

This is what it looks like when I scroll all the way to the right

How can I get it to not be able to scroll to the right?


texts: Retrieve all the available color in product collection

texts:
I have a custom product collection and products inside this collection has variety of colors. I want to retrieve all the colors available inside this product collection and store it in array.

$layer = $this->getLayer();
$productCollection = $layer->getProductCollection();
$productCollection->addAttributeToFilter(
       'entity_id',
       ['in' => $querydata->getData()]
);

Is there a way to do this?


texts:
We need to change all our orders to complete (600k)

Is there an easy script to accomplish this?

I am not sure if this is to safe?

UPDATE sales_flat_order_grid SET status = 'complete';
UPDATE sales_flat_order SET state = 'complete', status = 'complete';


texts: Redirect customer to a specific category page after successful registration

texts:
I am trying to redirect customer to a specific category based on the entered code.
Everything works fine except the redirect. Magento redirects to homepage instead of category page.
How can I redirect to category page? Any can help?

Customer Registration Form extra field to get the correct category:

<input type="text" name="login[passcode]" id="passcode" value="" title="<?php echo $this->__('Passcode') ?>" class="input-text required-entry" />

My config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <Team_Savepasscode>
            <version>0.0.1</version>
        </Team_Savepasscode>
    </modules>
    <global>
        <models>
            <team_savepasscode>
                <class>Team_Savepasscode_Model</class>
            </team_savepasscode>
        </models>
        <events>
            <customer_register_success>
                <observers>
                    <team_savepasscode>
                        <class>team_savepasscode/observer</class>
                        <method>customerRegisterSuccess</method>
                        <type>singleton</type>
                    </team_savepasscode>
                </observers>
            </customer_register_success>
        </events>
    </global>
</config>

Customer registration success event observer:

public function customerRegisterSuccess(Varien_Event_Observer $observer) {
    $classcode = Mage::app()->getRequest()->getPost('login');
    $session = Mage::getSingleton('customer/session');
    $session->setPasscode($classcode);

    $categories = Mage::getResourceModel('catalog/category_collection');
    $categories->addAttributeToSelect('*');
    $categories->addAttributeToFilter('is_active', 1);
    $categories->addAttributeToFilter('passcode', $classcode);
    $categories->addUrlRewriteToResult();
    $categories->setCurPage(1)->setPageSize(1);
    $categories->load();

    if ($categories->getFirstItem()) {
        $category = $categories->getFirstItem();
        $successUrl = $session->getBeforeAuthUrl(true);
        $successUrl = Mage::getUrl($category->getURL($category), array('_secure' => true));
        return $successUrl;
    }
    else {
        echo 'No category exists with the name ' . $name;
    }

}


texts: How to identify login user with Social Connect Magento Extension

texts:
I am using Inchoo Social Connect Magento extension

which is working fine but my concern is that how can i identify user is login by which account? if email address are same for Google and Facebook account. its return me in login customer session Facebook id and and Google id both.

I need to determine this information just because when user enter there comments in product detail page[product comment is my custom module]. I'll display there Avatar picture from Google/Facebook account.

Any one please help.


texts: How to deploy local source to live server for magento 2

texts:
I have tried many ways to deploy my local server project to live server or another PC but not working very well.

so please give me a better and exact solution for it.

thanks in advance.


texts: Checkout billing address update custom attributes

texts:
I am trying to add an additional field to the checkout billing address. Below is the LayoutProcessor plugin that i use to do that.

// Loop all payment methods (because billing address is appended to the payments)
    $configuration = $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']['payment']['children']['payments-list']['children'];
    foreach ($configuration as $paymentGroup => $groupConfig) {
        if (isset($groupConfig['component']) AND $groupConfig['component'] === 'Magento_Checkout/js/view/billing-address') {

            $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
            ['payment']['children']['payments-list']['children'][$paymentGroup]['children']['form-fields']['children'][$mobilePhoneAttributeCode] = [
                'component' => 'Magento_Ui/js/form/element/abstract',
                'config' => [
                    // customScope is used to group elements within a single form (e.g. they can be validated separately)
                    'customScope' => 'billingAddress.custom_attributes',
                    'customEntry' => null,
                    'template' => 'ui/form/field',
                    'id' => 'mobile-phone',
                    'elementTmpl' => 'ui/form/element/input',
                    'tooltip' => [
                        'description' => 'For delivery questions.',
                    ],
                ],
                'dataScope' => 'billingAddress.custom_attributes.' . $mobilePhoneAttributeCode,
                'label' => 'Mobile Phone',
                'provider' => 'checkoutProvider',
                'sortOrder' => 125,
                'validation' => [
                    'required-entry' => false
                ],
                'options' => [],
                'filterBy' => null,
                'customEntry' => null,
                'visible' => true,
                'id' => 'mobile-phone'
            ];
        }
    }

But when the updateAddress function runs in vendor\magento\module-checkout\view\frontend\web\js\view\billing-address.js the custom attributes are not passed in the dataScope so i can't parse the value to save it to the database.

PS I also added this field to the checkout shipping address and it works fine even with the billing address. The problem above exists only when i use diffent billing address.


texts: Restrict textarea characters length in system.xml

texts:
...
<orderPlaceMessage translate="label">
    <label>Message for order place: </label>
    <frontend_type>textarea</frontend_type>
    <sort_order>1</sort_order>
    <show_in_default>1</show_in_default>
    <show_in_website>1</show_in_website>
    <show_in_store>1</show_in_store>

    {how to limit character length }

</orderPlaceMessage>
...

  *How do I achieve? *


texts: How can I add a "Downloadable Product" to a Bundle?

texts:
The company I'm working for has asked me to help them with implementing eBooks into their e-commerce website. I have read on the Magento forums that you can add a line to the config for bundles, and that worked on one of my servers, but none of my other servers. We are looking to provide Bundles to our customers if they want to buy both the printed book, as well as the eBook, and provide that bundle at a slight discount from the regular price of both products. Any help to solve the issue would be appreciated.

Setup for company testing server #1 and #2:
OS: CentOS 6
Magento Version: 1.7.0.2

Setup for company production server:
OS: CentOS 6
Magento Version: 1.7.0.2

Setup for personal "play" server:
OS: Ubuntu 13.10
Magento Version: 1.8.0.0

EDIT: In the app\code\core\Mage\Downloadable\etc\config.xml (Which I overrode in the proper way with app\code\local) You can add <downloadable/> as a key under bundle/allowed_selection_types
This worked for one of my testing servers — allowing me to add a downloadable product to a bundle, but the other servers will not let me do the same.

Any help to accomplish the goal of adding a download to a bundle on multiple systems and occasions will be greatly appreciated.

EDIT 2: Adding Downloadable Products to Grouped Products or Bundled Products This provided information relevant to this problem/issue, but has not helped solve it.

EDIT 3: Now I cannot add a download to a bundle on any server I have access to.


texts:
My developer with questionable code practices modified a few core files, We tried to integrate a new theme and a few blocks are posing a problem.

The site has been running for over 6 months and I don't want to waste all the SEO efforts.

My development team is suggesting 3 options

New instance of magento altogether
Custom theme developemnt
Upgrading magento version from 1.9.1 to 1.9.3


texts: Magento 2.3.0 - SendGrid Email Delivery Module issue

texts:
I have installed "SendGrid Email Delivery" module on my magento (2.3.0 version) application. It installed successfully but when I tried to access it from admin panel to configure their settings after clicking on setting link. It's throwing error - The message should be an instance of \Zend_Mail.

Error screen : -

Is this module not compatible with Magento version 2.3 or what could be issues behind this?

Thanks!


texts: User registration Date of Birth field starts at 1930, how do I change that?

texts: On user registration, the Date of Birth field starts only goes down as far as 1930. I want to allow older people to register as well, how do I change that?


texts: Magento 2.2.5 EE Cybersource admin order create gives message "Payment declined"?

texts: In magento2.2.5 commerce version does cyber source support admin create order feature  ? If yes do we need any more configuration in place In order to perform admin order create operation .


texts: How to get frontend area layout in admin side?

texts:
I asked the question but did not get an answer to it.
Now i understand how get all block in pages, but i get only current page blocks. For example:

  $layout = Mage::app()->loadArea(Mage_Core_Model_App_Area::AREA_FRONTEND)->getLayout();
  /* then i get all blocks from that page*/

How to get frontend area, when i in backend?? I know that it should be simple, but when i want get AREA_FRONTEND, i get my current page, but i need get frontend area.


texts: magento migration tool migrate:data errors

texts:
When I run migrate:data I get some errors, any way to fix this?

[2017-03-06 17:00:38][ERROR]: Foreign key (FK_CATALOG_COMPARE_ITEM_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID) constraint fails. Orphan records id: 0 from `catalog_compare_item`.`customer_id` has no referenced records in `customer_entity`
[2017-03-06 17:00:38][ERROR]: Foreign key (FK_CATALOG_EAV_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID) constraint fails. Orphan records id: 903 from `catalog_eav_attribute`.`attribute_id` has no referenced records in `eav_attribute`
[2017-03-06 17:00:38][ERROR]: Foreign key (FK_CAT_PRD_ENTT_INT_ATTR_ID_EAV_ATTR_ATTR_ID) constraint fails. Orphan records id: 903 from `catalog_product_entity_int`.`attribute_id` has no referenced records in `eav_attribute`
[2017-03-06 17:00:38][ERROR]: Foreign key (FK_EAV_ATTRIBUTE_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID) constraint fails. Orphan records id: 19,21 from `eav_attribute`.`entity_type_id` has no referenced records in `eav_entity_type`
[2017-03-06 17:00:38][ERROR]: Foreign key (FK_EAV_ATTR_SET_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID) constraint fails. Orphan records id: 19,21 from `eav_attribute_set`.`entity_type_id` has no referenced records in `eav_entity_type`
[2017-03-06 17:00:38][ERROR]: Foreign key (FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID) constraint fails. Orphan records id: 202,213,706,732,903,2712 from `eav_entity_attribute`.`attribute_id` has no referenced records in `eav_attribute`

and this is another one

[2017-03-06 17:00:42][ERROR]: Source documents are not mapped: paybox_question_number,strikeiron_tax_rate


texts: Create link to internal page from its url key

texts:
How should I create the link to internal page in a template file ?

For instance, I have a subcategory which URL key is education, how should it be called in my phtml file to get the page http://my.website.com/education.html ?

I'm currently using this:

<a href="<?php echo $block->getUrl('education.html') ?>">


texts: How to modify a protected variable $items in magento collection

texts:
for some reasons I need to alter the $_items array from the class Magento\Framework\Data\Collection
That variable is set as protected, so as,if I try to do something like this $this->_collection->_items = $filteredItems; It won't work because of the protected access.
So now I know, that we are not supposed to modify this variables and the collection should be able to be sorted using her own methods.
But sadly for some reasons, for the attribute I am working on this isn't working at all, so I had to take the items and sort it by myself.
The sort works fine...and now I just need to replace the not sorted items with my sorted items.
Do you see any solution that might allow me to do that ? Considering there isn't any getter provided for this attribute.
If i'm creating a preference for this class, and extend it to add a simple getter, will the attribute be accessible or it won't work still because of the protected access ?
Thanks for the solutions you might provides.


texts:
I am getting randomly the 502 bad gateway on my site. When I check the hhvm logs I am getting this error:

Fatal error: Class undefined: Mage_Facebookfree_Helper_Active in /mypath/Mage.php on line 547

The Belvg/Facebookfree module is disabled from admin panel and from modules/Belvg_Facebookfree.xml

<active>false</active>

Also I commented all of the code when the helper is called from the design folder. What should I try more ? and why I am getting this error randomly ? thx

UPDATE
After I removed the line from core_config_data I got again 502 and in the logs i got this message:

SlowTimer [1308ms] at runtime/ext_mysql: slow query: SELECT COUNT(*) AS `count` FROM `mydb`.`catalog_product_entity_datetime` WHERE (CONVERT(`value_id` USING utf8) LIKE '%advanced/modules_disable_output%' OR CONVERT(`entity_type_id` USING utf8) LIKE '%advanced/modules_disable_output%' OR CONVERT(`attribute_id` USING utf8) LIKE '%advanced/modules_disable_output%' OR CONVERT(`store_id` USING utf8) LIKE '%advanced/modules_disable_output%' OR CONVERT(`entity_id` USING utf8) LIKE '%advanced/modules_disable_output%' OR CONVERT(`value` USING utf8) LIKE '%advanced/modules_disable_output%')

this is one of the many tables. There is multiple slow timer errors


texts: How to get Default Quantity of child product of Bundle Product in Magento 2

texts:
Today I am working on Bundle Products, Here I am trying to get the Default Quantity of child product of Bundle Product. But I am unable to get the details. Even though I debugged in product page, I am not getting results.

See My debugging child product of Bundle Product.

I want to get the Default Quantity of Bundle Child Product as shown below pic.

Any help on this?


texts: Having two tax rates with same percent but different names

texts:
I'm struggeling with this for a few days now.

I'm trying to sell products and insurances. Products have 19% VAT, insurances have 19% insurance tax.

I added a new Tax class, rate and rule.

If I see this correct, magento aggregates taxes with the same rate. There is no way to prevent this (at least I didn't found one)

\Mage_Tax_Model_Sales_Total_Quote_Tax::_totalBaseCalculation()

It doesn't matter what priority my rules has.

I'm ending with this, which is correct calculated, but not splitted in the correct parts:

MwSt. (19%)      21,70 $
Vst. (19%)       21,70 $
Tax              21,70 $

After adding shipping, it looks like this, now the sums are totally screwed:

MwSt. (19%)      22,50 $
Vst. (19%)       21,70 $
Tax              22,50 $

The interessting part is, the invoice in the backend is again ok (the pdf too):

Shipping & Handling Tax   0,80 $
MwSt. (19%)              15,97 $
Vst. (19%)                5,73 $
Total Tax                22,50 $

At the moment I think magento can't handle two different taxes with the same percent rate. At first glance, this use case isn't needed, but this evaluation is wrong :-/

Any ideas on this?


texts: unable to call searchbox phtml on static block in magento 2.4.2

texts:
I want to add searchbox in main content on homepage, i created a static block and tried to call form.mini but it throws a error.
code in static block:-
{{ block class="Magento\Framework\View\Element\Template" name="top.search.custom" as="topSearchcustom" template="Magento_Search::form.mini.phtml"  }}

The error I am facing is:-


texts: How to use Google fonts in email template

texts:
I'm working on email templates front end design, currently having problem in using google fonts, how can I embed or use google font in my email templates.

I've added the google font this way:

<style type="text/css">
   @import url(http://fonts.googleapis.com/css?family=Oswald);
font-family:'Oswald';
</style>

Please guide me in the correct way, thanks.


texts:
Client already using Magento store,

Now they are going to introduce new product line,
How can we generate new store under same platform.

Home Page have some Company info and both link for different store( i.e Men & Women )

When user is on Men section, all the products and checkout will be only for Men.


texts: Implement Google Invisible reCaptcha in custom Ajax Form

texts:
I have a custom form on the product page and this form is same as Contact Us form. I have already implemented Google invisible reCaptcha code on this page.
Google invisible reCaptcha is implemented along with the Google conversion code. While when we are submitting the form it is not throwing any errors and Form is submitted successfully Issue is we are getting spam emails and it seems user bypass reCaptcha.
Also when we are generating an analytic report then getting an error.
"We detected that your site is verifying reCAPTCHA passed solutions less than 50% of the time. This could indicate a problem with your integration with reCAPTCHA. Please see our developer site for more information."
Google invisible reCaptcha code is implemented with below code
 <button id='recaptcha' class="g-recaptcha" data-sitekey="site-key here" data-callback="doRecaptcha" data-size="invisible"><?php echo $this->__('Submit Form') ;?></button>

var formId = 'customform';
var myForm = new VarienForm(formId, true);
var postUrl = '<?php echo $this->getUrl("submit url") ?>';

new Event.observe(formId, 'submit', function(e){
    e.stop();
    validateFunction();
});

function validateFunction(){
     if (myForm.validator.validate()) {
        grecaptcha.execute();
    }
}

function doRecaptcha(token) {
        conversionCode();
    }

function conversionCode(){
        gtag('event', 'conversion', {
              'send_to': 'hdasdhasdasdklkada',
              'event_callback': ajaxCall()
            });
    }

function ajaxCall() {
   custom code here
}

is anybody implemented this before? Please share your ideas so that I can implement it properly.


texts: File exists but 404 for jquery-ui-1.9.3.2.js only one file

texts:
I upgraded magento 2.3.2 from 2.3.0. And getting this error in admin panel.
GET https:///pub/static/adminhtml/Magento/backend/nl_NL/jquery/jquery-ui-1.9.2.js net::ERR_ABORTED 404 (Not Found).
I already tried:

  sudo php bin/magento setup:upgrade
  sudo php bin/magento setup:di:compile
  php bin/magento setup:static-content:deploy -f
  php bin/magento setup:static-content:deploy -f --theme
  Magento/backend
  sudo php bin/magento cache:clean
  sudo chmod -R 0777 pub var generated

File existing in folder and other files in same folder are working. Same file permissions and user groups.

Please help me to solve this issue.


texts: How to differentiate orders from Magento website, Andriod app & iOS app

texts:
Custom made android & ios application has been created by using our Magento source code & database.

Since we are getting orders from different environments such as Magento website, Andriod & iOS app, we would like the differentiate the source of the order.

Please let me know the best way to differentiate the source of the order.

Thaks in advance!


texts: 3 diffrent magento websites 1 magento 2 backend

texts:
Hi is it possible to have 3 different magento websites on 3 different domains is there any way to have one backend which show orders products and other magento information in one backend
hope you understand


texts: I want to expand "Apply Discount Code" as default

texts:
Using Magento 2
I would like to expand the "Apply Discount Code" as default.

The current code is

I think the code should be

I have no idea where to edit this code
 Thank you in advance


texts:
I am developing a new Magento 2 theme based on Magento Blank parent.
I am trying to move the footer-container outside the page-wrapper container. To do so I inserted in my app/design/frontend/custom/theme/Magento_Theme/layout/default.xml
the following instruction:

<move element="footer" destination="root" after="-" />

The footer content is correctly moved outside the page-wrapper container but it is not wrapped anymore in the footer tag. What I get is:

...

...

What I expected was

...

...

What should I do to keep the footer tag? Should I redeclare a new container with htmlTag="footer" in my default.xml and move the footer element inside it?


texts: How can I remove a quote item from an observer from adminpanel in Magento 1?

texts:
I want to remove some items if I am pressing the reorder button from adminpanel.
I'm using this event: controller_action_postdispatch_adminhtml_sales_order_create_reorder

and this is my method from my observer:

    $quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
    foreach($quote->getAllItems() as $item) {
        if ($item->getSku() === 'with smth') {
            $quote->removeItem($item->getId());
        }
    }
    $quote->collectTotals()->save();

I don't get any errors, and the item is not removed :) What am I doing wrong here ? :)

Thank you!


texts: Perform Some Action after Customer successful Login : Magento

texts:
I am creating a module in which I want to  check some condition after customer successfully login, if condition is true then customer login otherwise not.

I know two ways of doing this :

Overriding AccountController
With Magento event.

My query are:

which is the best way?
Is there any event with which I can full fill my requirement?

Or if there is other best way of doing this, please recommend.


texts: Magento2 :: How can I get current page URL when cache is enabled

texts:
I am facing issue to get current page URL when cache is enabled

<?php
     $urlInterface = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Framework\UrlInterface');
     $CurrentUrl = $urlInterface->getCurrentUrl();
     $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
     $request = $objectManager->get('Magento\Framework\App\Action\Context')->getRequest();
     echo $request->getFullActionName();
     // echo "<pre>";
     // echo $this->getBaseUrl();
     // echo strcmp($CurrentUrl, $this->getBaseUrl());
     echo $this->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true]);
?>

On switching from menu to top links the current URL is not received properly. If I clear cache then I am getting the desired result.


texts:
I am injecting this collection into my model:

\Magento\Reports\Model\ResourceModel\Product\Collection $prodCollection

I use it to create an array of all products but I want to add the products category ids to the results.

I tried:

$prodItems = $this->prodCollection->addFieldToSelect('*')->addCategoryIds()->getData();

This doesn't include the category IDs in results.  I am trying to avoid having to load the product through the product repository and calling the method to get categories on every single product as that would be a very expensive operation.

Whats the cheapest way to get the product categories?


texts: Exclude category from flat catalog and indexer

texts:
Is it possible to exclude a category from being added to the flat catalog index or index in general?
The problem: we have a huge set of data in one category (5mio products). It's only accessible via search (elasticsearch), and not visible on the frontend.

But the rest of the products (about 12k) need to be visible and accessible via URL, when the client adds a new item. So we should have update on saving - but excluding that one big category.


texts: Loading external JS Module breaks Configurable Swatches / PrototypeJS in Magento 1

texts:
I'm using an outside JS library built with Webpack and Babel. The library is self-contained and only adds a single global variable.

When this library is loaded onto a product page, the hover-over and select functionality of Magento's configurable swatches breaks.

On hover, colors/sizes still dynamically show stock. But when hovering or clicking the swatches, the following error is logged:

(Chrome) Uncaught TypeError: Cannot read property 'apply' of undefined   prototype.js:936

(Firefox) TypeError: value[method] is undefined   prototype.js:936:7

This traces to skin/frontend/rwd/default/js/configurableswatches/swatches-product.js:676:40 which is the following:

el.select('span span').invoke('update', Translator.translate(this._E.cartBtn.txt[index]));

When I try to then add the product to cart, I get messages saying "Please select a size", etc.

Is there a known problem with Prototype and Babel or Webpack that would cause this?


texts: Date and Time not updating when a custom attribute is updated

texts: We're running Magento ver 2.2.3 on one of our sites and noticed that the date and time aren't being updated when making a change to a custom attribute. I tried looking online but haven't found an answer. Does anyone know if this is a known issue or something? Has anyone ever ran into this same problem before? Any ideas would be great.


texts:
In unit testing I want to create mock object for factory classes e.g.

  $this->getMockBuilder(\Magento\Framework\Controller\Result\RawFactory::class)->disableOriginalConstructor()->getMock();

but I have following error,

generation does not exist.

So how to generate factory class in in generation when create unit testing.


texts: Magento 2 : Add Filter in select ui form field

texts:
In ui form, I set 2 dropdown field. Now, I want to do something like that in second dropdown value set based on first dropdown selected value.

  For ex : In Customer module, There are country region dropdown field. In country If you select "United States" then, in region will display "United States" country's region.

I want to do same as like in my custom dropdown with ui-select dropdown. How to do that?

I figure out that i think it's working by this below code :

<item name="filterBy" xsi:type="array">
 <item name="target" xsi:type="string">${ $.provider }:${ $.parentScope }.country</item><!-- 'country' - db table column name where country code is saved -->
 <item name="field" xsi:type="string">country_id</item><!-- country_id field name -->
</item>

But, how it works?

Any help would be highly appreciated !!


texts:
I have an online eshop developed with Magento 2.1.7 and I have a problem in checkout.

I want my customers to have choice between casual receipt and invoice.

I am not intrested to heve extra fields in in Address Settings Form.

The only one that I want is to have a checkbox or an multiple choice module, in which the customer will say its decission and of cource it will be saved in a way in order to be visible from employees.

Any idea?


texts: Magento 2.3 InstallSchema.php does not create any table

texts:
I have an InstallSchema.php that does not create the table in the database.
Here is the code of the schema php:

<?php

namespace MyVendor\News\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;

class InstallSchema implements InstallSchemaInterface
{
    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $installer = $setup;
        $installer->startSetup();

        // Get news table
        $tableName = $installer->getTable('simplenews');
        // Check if the table already exists
        if ($installer->getConnection()->isTableExists($tableName) != true) {
            // Create news table
            $table = $installer->getConnection()
                ->newTable($tableName)
                ->addColumn(
                    'id',
                    Table::TYPE_INTEGER,
                    null,
                    [
                        'identity' => true,
                        'unsigned' => true,
                        'nullable' => false,
                        'primary' => true
                    ],
                    'ID'
                )
                ->addColumn(
                    'title',
                    Table::TYPE_TEXT,
                    null,
                    ['nullable' => false, 'default' => ''],
                    'Title'
                )
                ->addColumn(
                    'summary',
                    Table::TYPE_TEXT,
                    null,
                    ['nullable' => false, 'default' => ''],
                    'Summary'
                )
                ->addColumn(
                    'description',
                    Table::TYPE_TEXT,
                    null,
                    ['nullable' => false, 'default' => ''],
                    'Description'
                )
                ->addColumn(
                    'created_at',
                    Table::TYPE_DATETIME,
                    null,
                    ['nullable' => false],
                    'Created At'
                )
                ->addColumn(
                    'status',
                    Table::TYPE_SMALLINT,
                    null,
                    ['nullable' => false, 'default' => '0'],
                    'Status'
                )
                ->setComment('News Table')
                ->setOption('type', 'InnoDB')
                ->setOption('charset', 'utf8');
            $installer->getConnection()->createTable($table);
        }

        $installer->endSetup();
    }
}

I know I'm not the first one to have this issue, so I tried everything I could find about this. Here is what I have done to try make it works.

Before every try, executing sql

Delete from setup_module where module like '%module_name%';

I have of course checked that the query worked properly.

I have tried to install it with UpgradeSchema.php and change the version of the module in

magento/app/code/MyVendor/module/etc/module.xml (from 1.0.0 to 1.0.1),

it didn't work.

I have also tried to install it with Recurring.php

I'm using the command

sudo php bin/magento setup:upgrade

to install the table in the database. This command display no error and i can see my module in the output of the command.

I have also tried

setup:di:compile

to see any errors, but can't find any errors.

I had no problem installing magento, everything looks good so I'm lost.

  EDIT : My module is active (I checked it with sudo php bin/magento
  module:status)


texts: Error: Class Magneto_PopupQuestion\Products does not exist

texts:
hello I want to call the file in form.xml to display the product name but i am getting error class not found

form.xml

    <field name="entity_id">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="label" translate="true" xsi:type="string">product name</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">Product</item>
                <item name="disabled" xsi:type="boolean">true</item>
                <item name="class" xsi:type="string">Magneto_PopupQuestion\Products</item>
                <item name="sortOrder" xsi:type="number">30</item>
                <item name="dataScope" xsi:type="string">entity_id</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">false</item>
                </item>
            </item>
        </argument>
    </field>

products.php

<?php
namespace Magneto\PopupQuestion\Ui\Component\Listing\Column;

use \Magento\Catalog\Api\ProductRepositoryInterface;
use \Magento\Framework\View\Element\UiComponent\ContextInterface;
use \Magento\Framework\View\Element\UiComponentFactory;
use \Magento\Ui\Component\Listing\Columns\Column;

class Products extends Column
{
    protected $_ProductRepository;

    public function __construct(
        ContextInterface $context,
        UiComponentFactory $uiComponentFactory,
        ProductRepositoryInterface $ProductRepository,
        array $components = [],
        array $data = []
    ) {
        $this->_ProductRepository = $ProductRepository;
        parent::__construct($context, $uiComponentFactory, $components, $data);
    }

    public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            foreach ($dataSource['data']['items'] as $key => $items) {
                $product = $this->_ProductRepository->getById($items["entity_id"]);
                $dataSource['data']['items'][$key]['entity_id'] = $product->getName(); //to get product name
            }
        }
        return $dataSource;
    }
}


texts: Editing product link on shopping cart - "Cannot configure product"

texts:
If I click the product edit link in the Shopping cart, follow message displays "Cannot configure product."

This message only displays if the product I am trying to edit is a configurable product.

Anyone got any ideas how to fix?

In the logs I am getting the following

exception 'Mage_Core_Exception' with message 'Mage registry key "old_skip_aleable_check" already exists' in /home/mydomain/public_html/staging/app/Mage.php:595
Stack trace:
#0 /home/mydomain/public_html/staging/app/Mage.php(223): Mage::throwException('Mage registry k...')
#1 /home/mydomain/public_html/staging/app/code/community/Easylife/Switcher/Model/Observer.php(58): Mage::register('old_skip_aleabl...', true)
#2 /home/mydomain/public_html/staging/app/code/core/Mage/Core/Model/App.php(1338): Easylife_Switcher_Model_Observer->checkShowStockOnConfigure(Object(Varien_Event_Observer))
#3 /home/mydomain/public_html/staging/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Easylife_Switcher_Model_Observer), 'checkShowStockO...', Object(Varien_Event_Observer))
#4 /home/mydomain/public_html/staging/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#5 /home/mydomain/public_html/staging/app/code/core/Mage/Core/Controller/Varien/Action.php(385): Mage::dispatchEvent('controller_acti...')
#6 /home/mydomain/public_html/staging/app/code/core/Mage/Catalog/Helper/Product/View.php(147): Mage_Core_Controller_Varien_Action->renderLayout()
#7 /home/mydomain/public_html/staging/app/code/core/Mage/Checkout/controllers/CartController.php(327): Mage_Catalog_Helper_Product_View->prepareAndRender('18269', Object(Mage_Checkout_CartController), Object(Varien_Object))
#8 /home/mydomain/public_html/staging/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->configureAction()
#9 /home/mydomain/public_html/staging/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('configure')
#10 /home/mydomain/public_html/staging/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 /home/mydomain/public_html/staging/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#12 /home/mydomain/public_html/staging/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#13 /home/mydomain/public_html/staging/index.php(87): Mage::run('', 'store')
#14 {main}


texts: Magento error in sales_order when active one of standard filter

texts:
After upgrade my magento to 1.9 in sales order if I active an filter as particular name od order_id I have this error:

  Fatal error: Call to a member function getId() on a non-object in /.../public/app/code/core/Mage/Adminhtml/Block/Permissions/Editroles.php on line 44

have you any information or suggest for this error?

---UPDATE ---

If I replace Editroles.php with original code

$this->_title($this->__('System'))
             ->_title($this->__('Permissions'))
             ->_title($this->__('Roles'));

        $role = Mage::getModel('admin/roles')->load($this->getRequest()->getParam($requestVariable));
        // preventing edit of relation role
        if ($role->getId() && $role->getRoleType() != 'G') {
            $role->unsetData($role->getIdFieldName());
        }

        $role = Mage::register('current_role', $role);

The fatal error disappear but I have an error js on prototype.js that redirect me on dashboard of admin


texts: How to create custom local.xml to prevent Magento upgrade from losing changes

texts:
I'm familiar with child themes for Magento and the fallback mechanism Magento utilises, but I am not familiar with how the local.xml file works.

The other day I asked a question on here and the answer was to add to the local.xml file.  See here:
How to add a block at the very top of every page?

Now, I did that with success but since then I have upgraded my Magento version to 1.9.1 and have just realised that my changes have now gone from the local.xml file.

How do you modify the local.xml file so that it won't revert back when you upgrade Magento versions?

Does it work in the same manner as themes, where you can create a copy of the local.xml file and place it in the child directory?


texts: When Select France Language in Google Translate Price Formatting Different in cart page in Magento 1.9

texts:
i set the google translate for translate language in magento 1.9 but in cart page in some product the currency symbol was not chnage

Select Language France

Select Language English

any one can help me for this in magento 1.9


texts:
I've followed this tutorial: https://store.fooman.co.nz/blog/displaying-complex-error-messages-in-magento-2.html

This is my di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\View\Element\Message\MessageConfigurationsPool">
        <arguments>
            <argument name="configurationsMap" xsi:type="array">
                <item name="PortailAxiane" xsi:type="array">
                    <item name="renderer" xsi:type="const">\Magento\Framework\View\Element\Message\Renderer\BlockRenderer::CODE</item>
                    <item name="data" xsi:type="array">
                        <item name="template" xsi:type="string">Portail_Axiane::custommessage.phtml</item>
                    </item>
                </item>
            </argument>
        </arguments>
    </type>
</config>

This is my custommessage.phtml

<?php echo $block->escapeUrl($block->getData('url'))?>

And my message in my observer :

$this->_messageManager->addComplexErrorMessage(
                        'PortailAxiane',
                        array(
                            "url" => $produtToAddUrl
                        ), null
                    );

But as the result, I only have the red rectangle. What did I missed ?


texts: Checkout Page :- Auto populate city and state is not validate while entered the pincode

texts: I  am trying to submit the form when the data autopopulate and set the data in prespective fields, But it gives error at time of validate from knock out js it give city and state field is a required field


texts: Create Account not working properly for Guest User : Delete operation is forbidden for current area (Enterprise Magento ver. 2.1.0)

texts:
Error:

Delete operation is forbidden for current area

Steps to reproduce :

Create an address attribute from stores >> Attribute >> Customer address.

Set the attribute input type as Text Field

Set show in Front-end and show in Customer Address Registration and Customer Account Address forms.

Set values required field 'Yes'

The new text field will show up in forms.

Add any products to cart >> Checkout with Guest >> Fill data into newly created attributes >> Place Order >> Click on 'Create Account link'

Then error message receiving 'Delete operation is forbidden for current area'.

Expected result
Notification message should be display for create account.
Actual result
Delete operation is forbidden for current area


texts: I create products in Magento 2 with visibility in catalog and search, but I can search the product but not in catalog. The cron is executed many times correctly since the creation but not solve the problem. If I executed php bin/magento indexer:reindex solve the problem but I want this is executed alone


texts: mutiple images not displaying in custom tab form in admin grid in magento2

texts:
how to display the uploaded image in the custom tab in admin grid in that single image is coming but multiple images are not coming in database multiple image name are stored through that I want to display the image in custom tab
screenshot

info.php

$fieldset->addField(
        'image',
        'image',
        [
            'name'        => 'image',
            'label'    => __('image'),
            'required'     => true

        ]
    );


texts:
I'm currently working on improvements on load times and Time To First Byte for Magento 1.7.

Server side info:
Dedicated server
Running 1 Magento instance = 3 store views
LAMP setup

Css & js merged, using CDN
Built-in Magento cache enabled

I have attached profiler info from product page and as you can see ttfb is 1000ms.

I have been advised to use Full Page cache and Varnish cache, which I have set up and speed is noticeable on cached pages, but I would be more interested to get actual non-cached results around 200-400ms mark.

Any suggestions and thoughts would be highly appreciated.


texts: Magento 1 : Showing Custom Attribute On Product Page

texts:
I am working on aMagento 1.9website.
I want to add an attribute of the brand on the product page under the product name.
I have highlighted in the following image.

can anyone please guide how can I do the same.


texts:
I came across this block of code in an extension that loops through child products and attempts to return their current stock qty and the child products name:

<?php foreach ($this->getChildProducts() as $childProduct) : ?>
        <?php $childProductStockQty = $this-> getProductStockQty($childProduct);?>
        <?php if ($childProductStockQty > 0) : ?>

                <?php echo $childProduct->getName() ?>
                <?php echo $childProductStockQty ?>

        <?php endif ?>
    <?php endforeach ?>

In CE 1.9.0.1 this worked perfectly, returning both product names and stock quantities as expected. In CE 1.9.1, it will return the correct stock quantities, but the name returns null.

My question isn't so much 'what's wrong with this extension?', I've sent a question to the developer as well. I'm wondering if any of you are aware if there are changes in CE 1.9.1 in how to retrieve a child product name.

Reading the code down the Mage/CatalogInventory/Block/Stockqty rabbit hole hasn't shed any light that I can detect.

Any and all advice is appreciated.


texts: Add product attributes, From/To, hotel booking

texts:
I am new to magento and now I have a problem.

Using Magento 1.9.2.2

I need to add to the products two date attributes,

  From xxxx/xx/xxTo xxx/xx/xx

It's for a hotel booking, and yes, the products are hotel rooms.

These attributes need to appear in the product description, and are required to add product to the cart.

It also need to be added and showed up in the order, and so in the order e-mail.
Thanks.


texts:
if I put a bundled product into my cart, I do get displayed this correctly in the minicart-preview but the pricing is always on "0". On the other hand, if I head forward to the carts' summary-page (and all other checkout-steps )the price is shown totally correctly. So I guess, the value is used/pushed correctly, just not getting displayed correctly in the minicart.

I use getFinalPrice to display the pricing and it displays anything correctly for configurable and simple products. This is the code I am using:

$finalPrice = $product->getData('final_price');
$finalPrice += $this->getTotalBundleItemsPrice($product, $qty);
$finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice);

as recommended here http://gielberkers.com/how-to-calculate-prices-for-bundled-products-in-magento/ Where would be a good point to check what's wrong? Could I have forgotten a check on the dashboard?


texts: Magento 2 Contact From Create Attachment files and attachment data not received Emails

texts:
Contact us from I have created the Attachment file upload and showing the contact us from Please Check

But In email Not received the attachment files but only received file name Please Check

And I have made the admin side Email Templates use

How to get the file attachment data in the email using admin panel Email templates.


texts: Magento 2: Show pending payment order in store front

texts:
When orders get created, we set it to pending payment status, because the $ amount is only authorized, and won't be processed & invoiced 2 days later (due to requirement)

However, pending payment does not show up on store front & I can't find a way to enable it to show in store front.


texts: Uncaught Exception with no file or line number

texts:
we get an error message like this at the very bottom of our home page

  Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'Mage_Core_Model_Config_Element' is not allowed' in [no active file] on line 0

now the problem is that we can't tell what file is trying to serialize the mentioned class, however the page loads fine and the error seems to disappear when the caches are on

does anyone know how we can debug this


texts: Region dropdown show error "This is a required field" after select the option in Magento2 checkout

texts: Region dropdown shoe error "This is a required field" after select the option in Magento2 checkout page in billing address. I have attach screen shot of that. Can any one please help me for that?


texts: I am using event customer_register_success for sending customer detail to a third party website. I am facing problem in implementation of CURL in event observer. Do you have any example of using CURL in a magento 2 observer?


texts: How to read CSV with multi columns and reside in magento root dir?

texts:
If a csv file with id, name, price columns reside in magento root  dir

How I can read this file and retrieve data using Varien_File_Csv() from custom model?


texts: Category Sorting Product list: How to take off position from attributes?

texts:
Magento 1.9.0.1

In the admin panel, you have the ability to sort categories by attributes as seen here: http://inchoo.net/magento/changing-default-category-sort-order-in-magento/

Now I have sorted products in categories by:

    price (default)
    name
    position

I need to remove position from the menu leaving only price and name

I don't want to edit every single category view from catalago-->manage categories because I have too many categories in the store.

I need to act in configurations


texts: Export data (Products/Categories/Orders/Customers) from one installation to another in Magento 2

texts:
I have a running Magento 2 store and I am planning to make it Headless via PWA (ReactJS)
Since my current Magento has a lot of extensions and modules installed.
I wish to have a fresh new installation with just the required data and no additional module.
Required Data

Categories
Products
Attributes and Sets

Please advice.


texts: Magento Controller override Multiple times

texts:
I am trying to override Mage_Checkout's CartController's action addAction() but its not happening to override. Following is the scenario,

  Community Module overriding just "protected function _goBack()" of Mage of CartController.php

<checkout>
   <args>
      <modules>
           <Idev_OneStepCheckout before="Mage_Checkout">
              Idev_OneStepCheckout
           </Idev_OneStepCheckout>
     </modules>
  </args>
</checkout>

  Local Module overriding just "AjaxController.php"of community Module

<onestepcheckout>
    <args>
      <modules>
         <WoofDigital_OneStepCheckoutPhl before="Idev_OneStepCheckout">
             WoofDigital_OneStepCheckoutPhl
        </WoofDigital_OneStepCheckoutPhl>
     </modules>
   </args>
</onestepcheckout>

untill here everything working fine. But now I am need to override CartController.php 's addAction() in separate local module.

  Second Local Module to override "CartController.php" 's addAction()

<onestepcheckout>
  <args>
    <modules>
        <JakeSharp_Waterlee before="Idev_OneStepCheckout">
            JakeSharp_Waterlee
        </JakeSharp_Waterlee>
    </modules>
  </args>
</onestepcheckout>

CartController.php

require_once  Mage::getModuleDir('controllers', 'Idev_OneStepCheckout').DS.'CartController.php';
class JakeSharp_Waterlee_CartController extends Idev_OneStepCheckout_CartController {
  public function addAction(){
     die('Dead');
  }
}

But its not doing in this controller.. Can anyone please guide me if I am making any mistake... Thanks


texts:
I want to override this file:

  /var/www/magento2/vendor/magento/module-checkout/CustomerData/DefaultItem.php

I guess I have to do this by a module.

How do you override something like this?

Thanks!


texts:
I have used sales_order_place_after observer .
i am trying to get product items but i get more items in data
for exg. i have ordered 2 items but i am getting 4 items in data
foreach ($order->getAllItems() as $item) {
            $imageUrl = $helperImport->init($item->getProduct(), 'product_page_image_small')
                ->setImageFile($item->getProduct()->getSmallImage()) // image,small_image,thumbnail
                ->resize(380)
                ->getUrl();
            $product    = $item->getProduct();
            $products[] = array(
                'magento_product_id' => $product->getId(),
                'product_id'         => $product->getSku(),
                'brand'              => $product->getAttributeText('display_brand'),
                'price'              => $product->getFinalPrice(),
                'regular_price'      => $product->getPrice(),
                'special_price'      => $product->getSpecialPrice(),
                'url'                => $product->getProductUrl(),
                'size_type'          => (strpos($item->getProduct()->getProductUrl(), "plus-size") === false) ? 'Regular' : 'Plus Size',
                'manufacturer'       => $product->getManufacturer(),
                'imageUrl'           => $imageUrl,
                'category'           => $product->getName(),
                'special_category'   => $product->getName(),
                'doll_category'      => $product->getName(),
                'stock_quantity'     => $product->getQty(),
                'name'               => $product->getName(),
                'price'              => $product->getPrice(),
                'sku'                => $product->getSku(),
                'size'               => $product->getAttributeText('size'),
                'swatch'             => $product->getAttributeText('color'),
                'trend'              => $product->getAttributeText('trend'),
                'quantity'           => (float) $item->getQtyOrdered(),
            );

            // or you can retrieve the product object
            $product[] = $item->getProduct();
        }
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/products.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info($products);
        print_r($data);exit;


texts:
I want to include the css for product view page

In catalog_product_view layout:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="XXX_Info::css/optionswatches.css" />
    </head>
</page>

added optionswatches.css file in view/frontend/web/css/optionswatches.css

after flush cache not include the css in header

If anything i want to do it?


texts: While checkout using paypal express checkout ,credit card payment without creating a paypal account is not showing for Switzerland. Is there any configurations to enable checkout using credit card ?


texts: Magento 2 center align product view page image

texts: I have resized all images but still I can't vertically center align the images in product view page. Please take a look at the image. I now we can achieve it using css but I'm willing to know is there any other options magento provides.


texts:
In custom module i m saving product id in my table using that i want to display product name in admin grid

I m trying this code to join table

$collection->getSelect()
    ->joinLeft(
        array('prod' => 'catalog_product_entity'),
        'prod.entity_id = main_table.mageproduct_id',
        array('sku')
    )
    ->joinLeft(
        array('cpev' => 'catalog_product_entity_varchar'),
        'cpev.entity_id=main_table.mageproduct_id ,
        array('name' => 'value')
    );

I am getting sku but name is not display how to get name


texts: Magento 2: Show total items count in Knockout template

texts:
I want to display the total items count using Knockout, in Magento_Checkout::header/minicart.phtml, e.g. if I have 2 items with the same SKU in the basket then the total items count is 1.

I have tried using data-bind="text: getCartParam('items_count')" but this returns the total quantity (i.e. 2).

I could use <?php echo $this->helper('\Magento\Checkout\Helper\Cart')->getItemsCount(); ?> but I'd like to try and use a Knockout binding instead - is this possible?


texts:
I have a 2 links on the product page which both need the modal popup component attaching to them, I have 1 working fine but If I try to add the same script for the 2nd one they both stop working
This is what I have for the first link:
require(
    [
        'jquery',
        'Magento_Ui/js/modal/modal'
    ],
    function(
        $,
        modal
    ) {
        var options = {
            type: 'popup',
            responsive: false,
            innerScroll: true,
            buttons: []
        };

        var popup = modal(options, $('#finance-info'));
        $("#finance-popup").on('click',function(){
            $("#finance-info").modal("openModal");
        });

    }
);

For the second link I have:
require(
    [
        'jquery',
        'Magento_Ui/js/modal/modal'
    ],
    function(
        $,
        modal
    ) {
        var options = {
            type: 'popup',
            responsive: false,
            innerScroll: true,
            buttons: []
        };

        var popup = modal(options, $('#information-mpdal'));
        $("#request-more").on('click',function(){
            $("#information-mpdal").modal("openModal");
        });

    }
);

Both of these scripts are in a custom.js file. Is it possible to have 2 modal popups on the same page?


texts:
Collection data for grid ui component in Magento 2

I want show data by grid but it get all data, how to get it with sku = "VAY", i want show all data have sku = vay

My grid

My collection

class Collection extends

\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection {

    public function _construct(){
        $this->_init("namespace\module\Model\module","namespace\module\Model\ResourceModel\module");
    }
    protected function _beforeLoad()
    {
        parent::_beforeLoad();
        $this->addFieldToFilter('type',['eq'=>2]);
        return $this;
    }

}

di.xml

    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="module_listing_data_source" xsi:type="string">namespace\module\Model\ResourceModel\module\Collection</item>
            </argument>
        </arguments>
    </type>
    <virtualType name="namespace\module\Model\ResourceModel\module\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">stocklog</argument>
            <argument name="resourceModel" xsi:type="string">namespace\module\Model\ResourceModel\module</argument>
        </arguments>
    </virtualType>
</config>


texts: Working with collections, should I use function getData()

texts:
As in subject - while I am working with collections should I (after filtering etc.) get data with function getData()? I've heard an opinion that is rather for debugging, not real coding.

If I use getData() it return an array and if I don't use it I still have an object, so I can use all functions from Magento core to get information I need. Dumping an array I have to use some array methods and often a loop or a few loop with some 'ifs'. I suppose it is rather better to not do it... Am I right?


texts:
I have created shopping website using magento.

Now I want to create Magento Mobile App for same website.

For integrate magento with SOAP API I have write following code :

<?php
try
{
    $proxy = new SoapClient('http://192.168.1.199:8086/index.php/api/v2_soap/?wsdl'); // TODO : change url
    $sessionId = $proxy->login(array('username' => 'myusername', 'apiKey' => 'mypassword')); // TODO : change login and pwd if necessary
    $result = $proxy->catalogCategoryTree($sessionId);
}
catch (Exception $e)
{
    var_dump($e);
}

This code working on live server but not on my local server and return exception as following :

object(SoapFault)#2 (9) { ["message":protected]=> string(11) "Bad Request" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(36) "C:\inetpub\wwwroot\mobile_action.php" ["line":protected]=> int(119) ["trace":"Exception":private]=> array(4) { [0]=> array(4) { ["function"]=> string(11) "__doRequest" ["class"]=> string(10) "SoapClient" ["type"]=> string(2) "->" ["args"]=> array(5) { [0]=> string(692) " df03544f48da6b56fe465c4ad347c22f113 " [1]=> string(54) "http://192.168.1.199:8086/index.php/api/v2_soap/index/" [2]=> string(10) "urn:Action" [3]=> int(1) [4]=> int(0) } } [1]=> array(6) { ["file"]=> string(36) "C:\inetpub\wwwroot\mobile_action.php" ["line"]=> int(119) ["function"]=> string(6) "__call" ["class"]=> string(10) "SoapClient" ["type"]=> string(2) "->" ["args"]=> array(2) { [0]=> string(20) "catalogCategoryLevel" [1]=> array(4) { [0]=> string(32) "df03544f48da6b56fe465c4ad347c22f" [1]=> string(1) "1" [2]=> string(1) "1" [3]=> string(1) "3" } } } [2]=> array(6) { ["file"]=> string(36) "C:\inetpub\wwwroot\mobile_action.php" ["line"]=> int(119) ["function"]=> string(20) "catalogCategoryLevel" ["class"]=> string(10) "SoapClient" ["type"]=> string(2) "->" ["args"]=> array(4) { [0]=> string(32) "df03544f48da6b56fe465c4ad347c22f" [1]=> string(1) "1" [2]=> string(1) "1" [3]=> string(1) "3" } } [3]=> array(4) { ["file"]=> string(36) "C:\inetpub\wwwroot\mobile_action.php" ["line"]=> int(42) ["function"]=> string(17) "getMainCategories" ["args"]=> array(2) { [0]=> object(SoapClient)#1 (5) { ["_soap_version"]=> int(1) ["sdl"]=> resource(5) of type (Unknown) ["httpurl"]=> resource(8) of type (Unknown) ["_cookies"]=> array(1) { ["PHPSESSID"]=> array(3) { [0]=> string(26) "mf57nunfbuj8k1q1cjsi8gktr0" [1]=> string(1) "/" [2]=> string(13) "192.168.1.199" } } ["__soap_fault"]=> *RECURSION* } [1]=> &string(32) "df03544f48da6b56fe465c4ad347c22f" } } } ["previous":"Exception":private]=> NULL ["faultstring"]=> string(11) "Bad Request" ["faultcode"]=> string(4) "HTTP" }

Please tell me How to integrate SOAP API v2 with local server in magento?

Is there another way to Create API for Mobile APP?


texts: SUPEE PATCH - 9767 error in checkout page

texts:
i have applied SUPEE PATCH 9767 into my Magento 1.9 environment. Im using my custom theme for my store, before applying the patch there was no error in the checkout page. But after applying the patch the checkout page freezes at the Billing information . If i fill address and click on Continue - it justs shows the loading next step buffer and nothing happens. I checked in the Console also, there was no error thrown. can anyone explain what is happening?

Note: If i revert back the patch , the checkout is working fine


texts:
In one of our over seas stores, the Invoice PDF Printout is printing what looks like html encoded chars (á), We need to correct this, I have reviewed the following links, but none of it seems to match up or appears to be out of date, especially the first link which looks like the easiest solution.

References:

http://www.magentocommerce.com/knowledge-base/entry/custom-pdf-templates/
http://www.xpcdesign.com/2008/12/edit-the-magento-invoice-pdf-templates/ (2008)
http://inchoo.net/ecommerce/magento/how-to-add-custom-attribute-to-magentos-pdf-invoice/ (2011)
http://www.magentocommerce.com/wiki/5_-_modules_and_development/orders/editing_an_invoice_pdf