texts: Multi website and multi store view with custom url in magento 2

texts:
I have a magento 2 installed and configured the following:
1) default website with 1 store view called us_en
2) eu website with 1 store view called eu_en

When I change base url to store view like domain_name/us/en or domain_name/eu/en that store view fails to load, even the cms pages located in http://localhost/about_us not loading.

I suspect I am missing a step with respect to magento router.

Any pointers?


texts: Adding new column in the orders grid issue in Magento1

texts:
I am using the Gridcontrol to add/remove new columns.

This is my XML:

<sales_order_grid>
.....
<customer_increment_id>
    <add>
        <header>Customer ID</header>
        <type>text</type>
        <index>customer_increment_id</index>
        <join table="customer/entity" condition="main_table.customer_id={{table}}.entity_id" field="increment_id as customer_increment_id"/>
     </add>
     <after>scheduled_at</after>
</customer_increment_id>
.....
</sales_order_grid>

This is the query generated:

SELECT `main_table`.*, `customer/entity`.`increment_id` AS

`customer_increment_id` FROM `sales_flat_order_grid` AS `main_table`

INNER JOIN `customer_entity` AS `customer/entity`

ON main_table.customer_id=`customer/entity`.entity_id

The query returns me values. I want to get the customer_increment_id, but for some reason I m getting empty results in my grid for this column. Why?


texts: How can i add images into menu popup area


texts:
It seems only an invoice-level or order-level refunds are possible (for partial refunds).

Is it possible for Magento to process a partial refund against a specific product of an invoice and if so, what would I need to look at extending if I wanted to enable this? Are there any extensions out there that would provide this functionality?


texts: How to set the option type area in Magento 2?

texts:
In Magento 1

($optionType == Mage_Catalog_Model_Product_Option::OPTION_TYPE_AREA):

But, in Magento 2, I have to pass responsible class object type in constructor.

How I change this in Magento 2?


texts:
Hi there I use this script to get product list to csv file but the product image path does not come right. It gives the url but not the actual image path.

It exports like this http://dev.com/media/catalog/product
the problem is $product['image'] is empty

Can you please help me about this? Thanks.

magento versiong is 8.1.0

while($pages>=$count){
            // -- if this is the start, put the header in.
            if($count == 0){
                Mage::getModel('core/session')->setUsedPids(array());
                $txt .= "Product ID,Product Name,Product Price,Product URL,Product Description,Product Image URL,Product Category\n";
            }
            echo 'Pages: '.$pages.' Count: '.$count.' Start: '.$start.' Limit: '.$limit.'<Br />';
            $products = $this->getProductsData($limit, $start);
            foreach($products as $product){
                if(!in_array($product['entity_id'], Mage::getModel('core/session')->getUsedPids())){
                    $txt .= '"'.str_replace('"', '', $product['entity_id']).'","'.
                                str_replace('"', '', $product['name']).'","'.
                                str_replace('"', '', $product['final_price']).'","'.
                                str_replace('"', '', Mage::getBaseUrl().$product['url_path']).'","'.
                                str_replace(array('"', "\n", "\r"), '', $product['description']).'","'.
                                str_replace('"', '', Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'catalog'.DS.'product'.$product['image']).'","'.
                                $product['category'][0]['category']['category_name'].'",'."\n";

                    if(!$used = Mage::getModel('core/session')->getUsedPids()){
                        $used = array();
                    }
                    $used[] = $product['entity_id'];
                    Mage::getModel('core/session')->setUsedPids($used);
                }
            }
            if($count==0){ $start_file = true; } else { $start_file = false; }
            $count++;
            $start = $start+$limit;
            $file = $this->toFile('csv', 'PaidOnResults', $txt, $start_file);
            $txt = '';
            ob_flush();
            flush();
        }


texts: 500 server error while trying to Checkout

texts: I have a magento shop which is under development. While Im trying to checkout any product, it is giving me a 500 error. It started when i tried to implement Cash on Delivery from admin backend, payment methods. It gave me 500 error. So i tried to install another Cash on Delivery extension which gave me 500 error in entire checkout process. I tried to change the app folder, yet the error persists, so i believe its either server error or DB error. How can i Fix it


texts:
Under my account page, I need to change the Account Navigation from left to right, along with My Orders block. My Account Dashborad will be on left side.

Also I need to add My Cart Block above My Orders Block.

For example:

My Account Dashboard                        My Account
                                            Account Dashboard
Recent Orders Block                         Account Information
                                            Address Book
                                            My Orders
                                            Billing Agreements
Account Information                         My Product Reviews
                                            My Tags

                                            My Cart Info
                                            My Cart Block

                                            My Orders Info
                                            My Orders Block

I tried changing the layout from 2columns-left.phtml to 2columns-right.phtml but its not working.

Also I have a blog extension with 2columns-right.phtml layout, so is it going to affect account navigation layout too.


texts: M2- How to get thumbnails of associated products on a grouped product from image cache

texts:
I'm trying to bring simple products thumbnails of a grouped product on product detail page. I can show their thumbnails easily in Magento1 but I am not able to do this in Magento2.

In Magento1, My simple products can be shown like this :

So I tried this code at below located file

  app/design/frontend/[VendorName]/default/Magento_GroupedProduct/templates/product/view/type/grouped.phtml

<?php
/**
 * Copyright Â© 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/**
 * Grouped product data template
 *
 * @var $block \Magento\Catalog\Block\Product\View\BaseImage
 * @var $block \Magento\GroupedProduct\Block\Product\View\Type\Grouped
 */
?>
<?php $block->setPreconfiguredValue(); ?>
<?php $_product = $block->getProduct(); ?>
<?php $_associatedProducts = $block->getAssociatedProducts(); ?>
<?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); ?>
<?php $imageHelper  = $objectManager->get('\Magento\Catalog\Helper\Image');?>

            <?php $image_url = $imageHelper->init($_item, 'grouped_list_product_thumbnail')->setImageFile($_item->getFile())->resize(100, 100)->getUrl(); ?>
            <img src="<?php echo $image_url; ?>">

If I run this code, my code gets images as placeholder, not from cache. so it doesn't come out. Actually, we did migrate from Magento1 and media folder also was migrated manually. I want to get these image from cache folder. How can I do that?

Thank you


texts:
Here is my code.
require_once('ripcord-master/ripcord.php');
$url = "http://localhost:8069";           //ODOO  Server Url
$db ="test";                   //Database Name
$username = "test1@gmail.com";  //UserName
$password = "password";                 //Password
$common = ripcord::client("$url/xmlrpc/2/common");
$uid = $common->authenticate($db, $username, $password, array());
print_r($uid);  //1

I an getting below response:
Array ( [faultCode] => 1 [faultString] => Traceback (most recent call last): File "/odoo/odoo-server/odoo/addons/base/controllers/rpc.py", line 69, in xmlrpc_2 response = self._xmlrpc(service) File "/odoo/odoo-server/odoo/addons/base/controllers/rpc.py", line 49, in _xmlrpc result = dispatch_rpc(service, method, params) File "/odoo/odoo-server/odoo/http.py", line 140, in dispatch_rpc result = dispatch(method, params) File "/odoo/odoo-server/odoo/service/common.py", line 56, in dispatch return g[exp_method_name](*params) File "/odoo/odoo-server/odoo/service/common.py", line 27, in exp_authenticate return res_users.authenticate(db, login, password, {**user_agent_env, 'interactive': False}) TypeError: 'list' object is not a mapping )

Please help me with this issue.


texts: where to change responsive media breakpoint 767px in magento 2

texts:
I am working on responsive navigation menu in magento 2.4 version.
When I set width 768px in a browser it changes layout to desktop view. So I wanna keep this responsive menu design  till 1024px which and where I have to change the code to achieve this ?
I changed the code from 767px to 1024px in lib\web\mage\menu.js and pub\static\frontend\Magento\luma\en_US\mage\menu.js line number 25
mediaBreakpoint: '(max-width: 1024px)'

but nothing happened. So where I have to change the code to make responsive menu till width 1024px


texts: Is installing Magento through Softaculous considered a composer install?

texts:
Obviously, this is not a repo install from Github.  And although this may be a very simple question, there is nothing that I found that explicitly states what type of install it is.

I installed through Softaculous, whether it's frowned upon or not.  I did not use composer as it was done through CPANEL and completed through the web app.  But when I research problems, solutions, etc. there are always only 2 methods for everything; a composer install, or a github repo install.  Which one of these methods does a Softaculous install fall under.  To state the obvious, extending files, along with folder architecture, are affected by the type of install.

Thanks in advance, and apologies for a newb question.


texts: Variable for "Sales Representative" in Email Templates

texts:
In all the email templates, I have:

{{depend store_email}}
    Email: {{var store_email}}
{{/depend}}

However, this is outputting the "Customer Support" email address.

How can I change that so it is show the "General Contact" or "Sales Representative" email address in the template?
Why is the "Customer Support" email address the one that is output for the variable store_email?


texts: $product->getDisableAddToCart() magic method questions

texts:
I've run into an issue where $product->getDisableAddToCart() is returning bool(true) for some products, but I can't find a declaration of that method, nor can I find an attribute disable_add_to_cart in eav_attributes.

The method is called in

app\code\core\Mage\Wishlist\Controller\Abstract.php line 103
app\code\core\Enterprise\CatalogPermissions\Model\Observer.php line 323, 380, 540 (Enterprise 1.14.0.1)
app\code\core\Enterprise\Checkout\Model\Cart.php line 1021 (Enterprise 1.14.0.1)

Can anyone tell me where this is defined?


texts: Category does not exists in rows solution

texts:
I have an export of like 1.3k products.. so I selected only the first two from it.

I go to, System > Import / Export > Import ( Products , Append Complex Data ) just to check the file, uploading this file, imp1.csv containing the following:

sku,_type,_attribute_set,_product_websites,_root_category,_category,name,size,price,special_price,description,short_description,image,small_image,thumbnail,status,visibility,tax_class_id,qty
"3108831022134","simple","Default","base",2,165,"Garnitura oala sub presiune","","132.00","","Garnitura din cauciuc pentru oala sub presiune. Daca vechea dumneavoastra garnitura pentru oala sub presiune s-a stricat, inlocuiti-o cu una noua si folositi din nou oala. Potrivita pentru oale de 4, 6, 8 si 10 litri.","","/022134 garnitura oala sub presiune sitram_1.jpg","/022134 garnitura oala sub presiune sitram_1.jpg","/022134 garnitura oala sub presiune sitram_1.jpg","1","4","4","10"
"3367305120848","simple","Default","base",2,165,"Oala fonta aluminiu 24 cm","0-10 l","305.00","","Oala cu capac din sticla, realizata dintr-un aliaj de fonta si aluminiu. Interiorul este perfect finisat. Manerele sunt din bachelita de culoare neagra. Se preteaza tuturor tipurilor de plite, inclusiv cea cu inductie. Diametru: 24 cm.","","/120848 oala fonta aluminiu 24cm GERS _1.jpg","/120848 oala fonta aluminiu 24cm GERS _1.jpg","/120848 oala fonta aluminiu 24cm GERS _1.jpg","0","4","4","10"

And then, this happens:

I have checked the category ID's ( currently 165 ) and it exists:

What can I do.. I have changed and even removed the _root_category from "Frarom" ( originally "Default" ) to its ID, 2.

I have no idea what to do.. I have tried other answers here but it was a matter of quotes.. what is to be done here ? Thanks in advance !


texts:
I know that if I add a helper to my module I need to declare it in config.xml using:

<helpers>
    <module>
        <class>Namespace_Module_Helper</class>
    </module>
</helpers>

But, what if I want to add more helpers, how do I tell Magento about their existence?


texts:
Is it possible to add a select input to a product where the options are dynamic?

I've specified the path like so:

$eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'manufacturer',
        [
            'type' => 'int',
            'backend' => '',
            'frontend' => '',
            'label' => 'Manufacturer',
            'input' => 'select',
            'class' => '',
            'source' => 'Amrita\Catalog\Model\Config\Source\Options',
            'global' => Attribute::SCOPE_GLOBAL,
            'visible' => true,
            'required' => true,
            'user_defined' => false,
            'default' => 0,
            'searchable' => false,
            'filterable' => false,
            'comparable' => false,
            'visible_on_front' => false,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to' => ''
        ]
    );

In Options.php i've injected the manufacturerCollectionFactory like so

 public function __construct(OptionFactory $optionFactory, CollectionFactory $manufacturerCollectionFactory)
    {
        $this->optionFactory = $optionFactory;
        $this->manufacturerCollectionFactory = $manufacturerCollectionFactory;
        //you can use this if you want to prepare options dynamically

    }

I've then tried to add the options in a loop after retrieving the manufacturer collection. I need to set the value and the label of the option by getting the id and title of the manufacturer object, but i'm not sure how to do this using OptionFactory. setLabel() setValue() doesn't work, is there anything equivalent?

    public function getAllOptions()
    {
        $manufacturers = $this->manufacturerCollectionFactory->create();
        foreach ($manufacturers as $manufacturer) {
            $option = $this->optionFactory->create();
//            $option->setLabel();
//            $option->setValue();
//            array_push($this->_options, $option);
        }

        return $this->_options;
    }


texts:
I'm using tabs.phtml on my product pages.

This is the code

    <?php foreach ($tabsCollection as $_index => $_tab): ?>
        <?php if($this->getChildHtml($_tab['alias'])): ?>
            <li id="extra_tabs_<?php echo $_tab['alias'] ?>" class="<?php echo !$_index?' active first':(($_index==count($tabsCollection)-1)?' last':'')?>"><?php echo $_tab['title']?>

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

<?php foreach ($tabsCollection as $_index => $_tab): ?>
    <?php if($this->getChildHtml($_tab['alias'])): ?>
        <div class="extra-tabs-content" id="extra_tabs_<?php echo $_tab['alias'] ?>_contents"><?php echo $this->getChildHtml($_tab['alias']) ?>

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

However, this also shows if there are no attributes assigned to the product, so I need the tab not to show if there are no attributes assigned to the product.

Any ideas?


texts:
I wanna make City optinal. I was made in JS a Dropdown so i can select the city. I put "city" textbox in display:none in CSS and next, copy onchange the dropbox text into this city textbox so the process don't broken.

But i see if i copy the text, the Magento mark me as "required" fiel.

The process is:

User select "Bogotá"
Script copy "Bogota" from de dropbox to the "City" textbox
User click "place order"
Magento 2 warning Textbox are empty (wen no, i check it)

If i remove a letter from the textbox (Bogotá to Bogot) and next put it again, the process continue without problem.

For this, i wanna make City optional cause i validate the textbox aren't empty.

Thanks.

Magento 2.3.0


texts: Can't override list.phtml in Magento 2.4

texts:
I try to override the list.phtml in Magento 2.4 but it's not working.
Here is the path to my new file :
app/design/frontend/Magento/timeote/Magento_Catalog/templates/product/list.phtml

All the other phtml that I edit in the same path are working, such as this one :
app/design/frontend/Magento/timeote/Magento_Catalog/templates/product/image_with_borders.phtml

Am I missing something with list.phtml ?
Thank you for your answers because I'm stuck with this ...


texts:
In our production site using Magento 2.3.4 and Smile-SA elasticsuite extension with elasticsuite 6.x. After manual reindex site working well. But some time shows an error.

main.CRITICAL: catalog_product index does not exist yet. Make sure
everything is reindexed.
{"report_id":"f338fd2af9106c0ec4b09c83855f9a3ca4424092acd1f25958036944b2915173","exception":"[object]
(LogicException(code: 0): catalog_product index does not exist yet.
Make sure everything is reindexed. at
/var/www/html/vendor/smile/elasticsuite/src/module-elasticsuite-core/Index/IndexOperation.php:117)"}
[]

Then show nothing in category page and admin panel category edit panel. But after manual reindex, it works again normally. But after some time again show that error. What happens their or how to resolve it.


texts: How to add a datepicker field in Shipping address step at Customized checkout?

texts:
In the checkout page, we have two of the options. First one is School and the second one is Private person. Customer can order via school option and as well as the private person. In both the option, we have shipping address step and payment step.

Now, we want to add a datepicker field in shipping address step at school option. How to do it?

Could anyone please give me your suggestion?


texts: Unautorized Url added in all cms block Magento 1.9

texts:
All cms blocks inserted an unauthorized link with js call
as below
https://kinfirighbetted.host/d/domain.com.js


texts:
I'm trying to add a checkbox in the newsletter template edit form. Modifying the class Mage_Adminhtml_Block_Newsletter_Template_Edit_Form works, but of course I would rewrite the form in my own module to preserve upgradeability.
I've added this code in config.xml

 <blocks>
            <adminhtml>
                <rewrite>
                    <newsletter_template_edit_form>Apedic_NewProductsByMail_Block_Adminhtml_Template_Edit_Form</newsletter_template_edit_form>
                </rewrite>
            </adminhtml>
        </blocks>

Copied the original class to Apedic_NewProductsByMail_Block_Adminhtml_Template_Edit_Form and added the checkbox

$fieldset->addField('cron', 'checkbox', array(
                'name' => 'cron',
                'label' => Mage::helper('newsletter')->__('Cron'),
                'value' => 1
            ));

However the checkbox doesn't appear. Where I'm wrong? thanks


texts: Admin layout file not loading in custom module

texts:
I'm trying to load in a block on one of my admin pages in a custom module, but it doesn't appear to be loading. At first I thought it was a handle issue, but I've found out that the handle is adminhtml_bar_index through the controller. I know it's not loading because I have debug mode on, and, when I break the XML, no error whatsoever gets thrown or logged. What else could be wrong?
/app/code/local/Foo/Bar/etc/config.xml
<?xml version="1.0"?>
<config>
<!-- ... -->
    <adminhtml>
        <layout>
            <updates>
                <bar>
                    <file>foo_bar.xml</file>
                </bar>
            </updates>
        </layout>
    <!-- ... -->
    </adminhtml>
<!-- ... -->
</config>

/app/design/adminhtml/default/default/layout/foo_bar.xml
<?xml version="1.0"?>
<layout>
    <adminhtml_bar_index>
        <reference name="content">
            <block type="foo_bar/adminhtml_profiles_grid" />
        <reference>
    </adminhtml_bar_index>
</layout>

Thanks in advance!
Edit: I've managed to make it load. I don't know how, but I did. I think it was a handle issue still.


texts: Get function/value from php file in .phtml

texts:
I'm trying to do something similar to this:

include/require php file within phtml template file

I have a .phtml file but need to get the return value from another php file by calling it from said .phtml file. How can this be achieved in Magento 2?

I tried using require, include and require_once with the path relative to the location of the .phtml file but this doesn't work (returns 500 error on page).

To make things somewhat clearer (I'm using a custom module):

I have a Settings.php file in a folder called Helper (folder located in root of custom module, so Vendor/Module/Helper)
Following, I have a template.phtml file under view/frontend/templates
I want to get the return value from a function in Settings.php


texts: What is Mage Titans MX - Certification Promo discount in Magento 2 Certified Associate Developer Exam certification ?


texts: customer_visitor magento 2.1.5 errors : 1205 Lock wait timeout exceeded; try restarting transaction

texts:
I am getting below error every nigth at 00:00. Problem with clean customer visitor. How i can

a:4:{i:0;s:198:"SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: INSERT INTO `customer_visitor` (`customer_id`, `session_id`, `last_visit_at`) VALUES (?, ?, ?)";i:1;s:12982:"#0 /var/www/html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php(95): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array)
#2 /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)

How can I cleaning up customer_visitor table log. is it creates any problems if cleaning up this table


texts: Magento 2 How can I add 2columns-left in container area like the one I have shared

texts:
I want to add 2 columns one for the menu and other for the text in container

Page.top is the menu container which I have move into a new container
Now In that new container page top after banner
I want to make two columns
1 which is the menu and the other which is text as seen in picture

<referenceContainer name="page.top">
        <block class="Magento\Framework\View\Element\Template" name="navigation.sections" before="-" template="Magento_Theme::html/sections.phtml">
            <arguments>
                <argument name="group_name" xsi:type="string">navigation-sections</argument>
                <argument name="group_css" xsi:type="string">nav-sections</argument>
            </arguments>
            <block class="Magento\Framework\View\Element\Template" name="store.menu" group="navigation-sections" template="Magento_Theme::html/container.phtml">
                <arguments>
                    <argument name="title" translate="true" xsi:type="string">Ekelund 1692</argument>
                </arguments>
                <block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="Magento_Theme::html/topmenu.phtml" ttl="3600" before="-"/>
            </block>

            <block class="Magento\Framework\View\Element\Template" name="store.settings" group="navigation-sections" template="Magento_Theme::html/container.phtml">
                <arguments>
                    <argument name="title" translate="true" xsi:type="string">Settings</argument>
                </arguments>
                <block class="Magento\Store\Block\Switcher" name="store.settings.language" template="Magento_Store::switch/languages.phtml">
                    <arguments>
                        <argument name="id_modifier" xsi:type="string">nav</argument>
                        <argument name="view_model" xsi:type="object">Magento\Store\ViewModel\SwitcherUrlProvider</argument>
                    </arguments>
                </block>
                <block class="Magento\Directory\Block\Currency" name="store.settings.currency" template="Magento_Directory::currency.phtml">
                    <arguments>
                        <argument name="id_modifier" xsi:type="string">nav</argument>
                    </arguments>
                </block>
            </block>
        </block>
        <container name="top.container" as="topContainer" label="After Page Header Top" htmlTag="div" htmlClass="top-container"/>
        <block class="Magento\Theme\Block\Html\Breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
    </referenceContainer>
<move element="page.top" destination="page_top_after_banner"/>
     <referenceContainer name="page_top_after_banner">
              <block class="Magento\Framework\View\Element\Template" name="menu-text">
                 <arguments>
                <argument name="block_id" xsi:type="string">menu-text</argument>
            </arguments>
            </block>
            </referenceContainer>


texts: How to customise header template in magento 2

texts:
Here is what i have already done.

Installed Magento 2
Created custom theme in magento 2
Applied that theme
Created "templates directories" to override template files

I have copied header.phtml

from my-magento-directory\vendor\magento\module-theme\view\frontend\templates\html

and pasted it to my-magento-directory\app\design\frontend\my-package\my-theme\Magento_Theme\templates\html

I have this default luma theme header, please see the image below.

And i want to make it like this, please see the image below.

EDIT


texts: Magento 1.9.2 - Display 6 or 8 products in the same row

texts:
I declared a specific category in the dashboard of account in Magento but the list shows only 4 products for row. How can I display 6 or 8 products for row?

This is my code

echo $this->getLayout()->createBlock("catalog/product_list")->setTemplate("catalog/product/list.phtml")->setCategoryId('105')->toHtml();

Thanks


texts:
I added a DateColumn component to my backend grid which looks like this
    <column name="booking_from" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="editor" xsi:type="array">
                    <item name="editorType" xsi:type="string">date</item>
                </item>
                <item name="visible" xsi:type="boolean">true</item>
                <item name="filter" xsi:type="string">dateRange</item>
                <item name="dataType" xsi:type="string">date</item>
                <item name="dateFormat" xsi:type="string">MMM dd, YYYY</item>
                <item name="label" xsi:type="string" translate="true">Booking From</item>
                <item name="sortOrder" xsi:type="number">11</item>
            </item>
        </argument>
    </column>

My problem is that when I try to sort the date column that it sorts after the day number and not the date itself. Also the editor config doesn't allow me to edit the date, too.


texts: Translate recaptcha errors? Magento 1.9.3.8

texts:
The following piece of code implements error messages for recaptcha. The location is app/code/local/Magecomp/Recaptcha/Model/Observer.php

public function Customercreate($observer)
{

    try {

        if (Mage::helper('recaptcha/data')->showOnRegister()) {
             $g_response = Mage::app()->getRequest()->getParam('g-recaptcha-response');
            if (isset($g_response) && !empty($g_response)):
                if (!(Mage::helper('recaptcha')->Validate_captcha($g_response))):
                    Mage::getSingleton('core/session')->addError('Please click on the reCAPTCHA box.123');
                    $url = Mage::helper('core/http')->getHttpReferer() ? Mage::helper('core/http')->getHttpReferer() : Mage::getUrl();
                    Mage::app()->getFrontController()->getResponse()->setRedirect($url);
                    Mage::app()->getResponse()->sendResponse();
                    exit;
                endif;
            else:
                $observer->getEvent()->setData(null);
                Mage::getSingleton('core/session')->addError('Please click on the reCAPTCHA box.456');
                $url = Mage::helper('core/http')->getHttpReferer() ? Mage::helper('core/http')->getHttpReferer() : Mage::getUrl();
                Mage::app()->getFrontController()->getResponse()->setRedirect($url);
                Mage::app()->getResponse()->sendResponse();
                exit;
            endif;
        }
    } catch (Exception $e) {
        Mage::log("Captcha Error :" . $e->getMessage(), null, "recaptcha.log");
    }
}

How could I translate the texts "Please click on the reCAPTCHA box.123"  and "Please click on the reCAPTCHA box.456" into another languages? I know that modifying core files is not recommended.


texts: Magento2 add custom attributes to Rest API index.php/rest/V1/orders?searchCriteria

texts:
In my custom extension, I added custom attributes to api index.php/rest/V1/orders/:id and it works like in this documentation dev docs

But attribute does not show in api for orders list index.php/rest/V1/orders?searchCriteria...

How can I add attributes to orders list ?


texts:
I have a situation where I'd like to completely disable one of Magento's core indexers (cataloginventory_stock).  I don't want this index to ever be rebuilt, maintained or altered in any way.

Is it possible to disable or "unregister" an indexer?

Things I've tried:

See if there's a way to disable it via config xml (there isn't).
Look for events around config xml loading that might permit me to remove the indexer's definition in XML before it can be used.  There isn't, and that's logical as until the XML is loaded there's no way to define event observers!

What does seem to work is to rewrite the Mage_CatalogInventory_Model_Indexer_Stock class and replace most of it's methods with versions that either return false (matchEvent and matchEntityAndType) or are otherwise NoOps.  While this works, it doesn't seem like a particularly elegant solution.  Is there a better way?

Please Note: I am aware that there will be many flow on effects from disabling this particular indexer, and I've dealt with most of them already.


texts: How to create a custom CMS static block programmatically and have it be displayed on homepage?

texts: I am able to create CMS Static Block from admin and display it on the homepage, but is there a way to do it programmatically so I can create custom widgets(basically custom HTML/CSS) and display it on the homepage? What's the best way to go about displaying Custom HTML/CSS on the homepage programmatically? Or is modifying the Content in Content>Pages>Home Page is the only way?


texts: Change Price Layered navigation Query string structure

texts:
How to change the price layered navigation URL Query string from

https://example.com/category.html?price=2%2C10_3%2C10

to

https://example.com/category.html?price=12-24

as I want to make Price slider. so any suggestions ?


texts:
I am currently doing a lot of tests in Magento so I can get familiar with it. Unfortunately the database is extremely cluttered with my tests. I wish to clear up the database so I can start over again. This means doing the following:

Clearing all products
Clearing all attributes
Clearing all attribute sets
Clearing all categories
Clearing all orders, shipments, transactions etc.

I have found a post on the Magento forums for clearing the products, which is the following SQL:

SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE `catalog_product_bundle_option`;
TRUNCATE TABLE `catalog_product_bundle_option_value`;
TRUNCATE TABLE `catalog_product_bundle_selection`;
TRUNCATE TABLE `catalog_product_entity_datetime`;
TRUNCATE TABLE `catalog_product_entity_decimal`;
TRUNCATE TABLE `catalog_product_entity_gallery`;
TRUNCATE TABLE `catalog_product_entity_int`;
TRUNCATE TABLE `catalog_product_entity_media_gallery`;
TRUNCATE TABLE `catalog_product_entity_media_gallery_value`;
TRUNCATE TABLE `catalog_product_entity_text`;
TRUNCATE TABLE `catalog_product_entity_tier_price`;
TRUNCATE TABLE `catalog_product_entity_varchar`;
TRUNCATE TABLE `catalog_product_flat_1`;
TRUNCATE TABLE `catalog_product_link`;
TRUNCATE TABLE `catalog_product_link_attribute`;
TRUNCATE TABLE `catalog_product_link_attribute_decimal`;
TRUNCATE TABLE `catalog_product_link_attribute_int`;
TRUNCATE TABLE `catalog_product_link_attribute_varchar`;
TRUNCATE TABLE `catalog_product_link_type`;
TRUNCATE TABLE `catalog_product_option`;
TRUNCATE TABLE `catalog_product_option_price`;
TRUNCATE TABLE `catalog_product_option_title`;
TRUNCATE TABLE `catalog_product_option_type_price`;
TRUNCATE TABLE `catalog_product_option_type_title`;
TRUNCATE TABLE `catalog_product_option_type_value`;
TRUNCATE TABLE `catalog_product_super_attribute_label`;
TRUNCATE TABLE `catalog_product_super_attribute_pricing`;
TRUNCATE TABLE `catalog_product_super_attribute`;
TRUNCATE TABLE `catalog_product_super_link`;
TRUNCATE TABLE `catalog_product_enabled_index`;
TRUNCATE TABLE `catalog_product_website`;
TRUNCATE TABLE `catalog_product_relation`;
TRUNCATE TABLE `catalog_category_product_index`;
TRUNCATE TABLE `catalog_category_product`;
TRUNCATE TABLE `cataloginventory_stock_item`;
TRUNCATE TABLE `cataloginventory_stock_status`;
TRUNCATE TABLE `cataloginventory_stock_status_idx`;
TRUNCATE TABLE `cataloginventory_stock`;
TRUNCATE TABLE `core_url_rewrite`;
INSERT  INTO `catalog_product_link_type`(`link_type_id`,`code`) VALUES (1,'relation'),(2,'bundle'),(3,'super'),(4,'up_sell'),(5,'cross_sell');
INSERT  INTO `catalog_product_link_attribute`(`product_link_attribute_id`,`link_type_id`,`product_link_attribute_code`,`data_type`) VALUES (1,2,'qty','decimal'),(2,1,'position','int'),(3,4,'position','int'),(4,5,'position','int'),(6,1,'qty','decimal'),(7,3,'position','int'),(8,3,'qty','decimal');
INSERT  INTO `cataloginventory_stock`(`stock_id`,`stock_name`) VALUES (1,'Default');
TRUNCATE TABLE `catalog_product_entity`;
SET FOREIGN_KEY_CHECKS = 1;

I would need the same for the others mentioned. Unfortunately I don't know which tables are holding all the different data, otherwise I would've done it by myself. I also don't want to clear the wrong tables by accident. I hope you can help me!


texts: Magento 1.9 : I am unable to generate session using soap api v2

texts:
Can anyone help me, regarding soap api v2 , I am unable to generate session using v2 version, is there any changes to change?

I am getting below error message:

  Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Client] Error
  cannot find parameter in

code below:

 <?php
/**
 * Connection API v2 + WSI-Compliance
 */
error_reporting(E_ALL);
ini_set('display_errors', '1');

//for indicom
$proxy = new SoapClient('https://magento.com/api/v2_soap/?wsdl');
$sessionId = $proxy->login('test','test@123');
echo $sessionId;

Thanks


texts: System attributes set to not display on product page are displaying on product page?

texts:
I wrote a simple code for a custom tab to display all atrributes that had a value. But it's returning system attributes that clearly should not be displayed. In the attributes management page in Admin, I checked and triple checked to make sure these attributes were set to NOT display. I refreshed all indexes and flushed all cache, but still showing. Any ideas why this is happening?

Code below, for reference.

$_product = $this->getProduct();
$attributes = Mage::getResourceModel('catalog/product_attribute_collection')
    ->getItems();
foreach ($attributes as $attribute){

    $productAttributeCode=$attribute->getAttributeCode();
    $productAttributeData=$_product->getData($productAttributeCode);

    if ($productAttributeData > ""){
        if ($productAttributeCode != "status"){
            echo '
';
            echo $attribute->getFrontendLabel();
            echo ': ';
            //echo $productAttributeCode;
            //echo ': ';
            echo $productAttributeData;
            echo '
';
            }
        }
    }


texts: Magento 2: Missing Invoice Sequence Id's

texts:
I'm currently running an Magento 2.2.9 shop and investigate an issue where invoice sequence numbers gone missing.

For example we have an order and by simply clicking the send invoice button, the System creates an new invoice with the old one nowhere to be found.

So I investigated this in the Database:

SELECT entity_id,increment_id FROM `sales_invoice` where increment_id BETWEEN 'OS-R-045315' and 'OS-R-045317'

As you can see OS-R-045316 is clearly missing.

So my questions are:

Why does magento delete invoices? What could trigger such an behavior?
Is there any audit trail, where i can find missing invoice sequences?
Is there an way to ensure all invoice numbers could be found within magento?


texts: White space on right hand side of site upon screen resize and right scroll

texts:
I have an with a Magento site at www.lovetobenatural.co.uk running Magento 1.7.0.2.

Looking at the site in any browser, when I shrink the screen width (to test display for mobile), and then scroll right (with the browser still at the reduced width) the right-hand side of the site is 'cut-off', and just shows white.

I had thought it was something to do with .main-container {overflow: hidden};, however changing this to scroll; or auto; has had no effect.

I wondered if anyone could point me in the right direction as to the cause?


texts: page/template_links block not behaving; aParams missing and url deformed

texts:
I've inserted a links block to the footer via local.xml:

    <reference name="footer">
        <block type="page/template_links" name="footer.social.links" as="footerSocialLinks">
            <action method="setTitle"><title>Finn oss på...</title></action>
            <action method="setName"><name>footer-social</name></action>
            <action method="addLink" translate="label title">
                <![CDATA[Facebook]]>
                <url>https://www.facebook.com/xxxxx</url>
                <title>Besøk vår Facebook-side</title>
                <aParams>target="_blank"</aParams>
                <position>10</position>
                <prepare/>
            </action>
            <action method="addLink" translate="label title">
                <![CDATA[Twitter]]>
                <url>https://twitter.com/xxxxx</url>
                <title>Følg oss på Twitter</title>
                <aParams>target="_blank"</aParams>
                <position>20</position>
                <prepare/>
            </action>
            <action method="addLink" translate="label title">
                <![CDATA[Google+]]>
                <url>https://plus.google.com/+xxxxx</url>
                <title>Besøk vår side på Google Plus</title>
                <aParams>target="_blank"</aParams>
                <position>30</position>
                <prepare/>
            </action>
            <action method="addLink" translate="label title">
                <![CDATA[Youtube]]>
                <url>https://www.youtube.com/user/xxxxx</url>
                <title>Se på vår innhold på Youtube</title>
                <aParams>target="_blank"</aParams>
                <position>40</position>
                <prepare/>
            </action>
        </block>
    </reference>

This produces the following html:

Finn oss på...

Facebook

Twitter

Google+

Youtube

The main problems here are that the urls are horribly malformed and the aParams missing. I don't know where or what magento has done to the urls; in the first 3 cases the user part of the link is missing, and in the 4th link (youtube) there is a mysterious "index" added.

I have tried to wrap the url with CDATA, I've tried removing the empty  tag, to no avail. The block code and template provide very few hints.

Maybe I'm just wasting time trying to do something "properly" when I could just include a static block. Meh!


texts: Create store and other programatically and after reindex from admin my mysql stop working

texts: I am working on my module. I create a store , website and other related information programatically. It is successfully created. But when i reindex data from admin panel my mysql stop working. I don't know what is problem. Let me know how can i solve this problem.


texts: Magento 2 create admin config table with custom rows and columns

texts:
I want to create admin config with a table to take the data and save in config for that I followed this link.

But I also want to create custom rows in that table programmatically and also without the last action column and add button. Please refer the image

I was unable to find any solution on the web regarding the same nor the file \Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray that we extend gave any clues.

Could have easily done this via jquery but want to implement the standard solution.

Code:

<?php
namespace Abc\Paymentmethod\Block\Adminhtml\System\Config\Form\Field;

class Feetable extends \Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray
{
    /**
     * @var \Magento\Framework\Data\Form\Element\Factory
     */
    protected $_elementFactory;

    /**
     * @param \Magento\Backend\Block\Template\Context $context
     * @param \Magento\Framework\Data\Form\Element\Factory $elementFactory
     * @param array $data
     */
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Framework\Data\Form\Element\Factory $elementFactory,
        array $data = []
    )
    {
        $this->_elementFactory  = $elementFactory;
        parent::__construct($context,$data);
    }
    protected function _construct(){
        $this->addColumn('noi', ['label' => __('NOI'),'readonly'=>'readonly']);
        $this->addColumn('fixed', ['label' => __('Fixed')]);
        $this->addColumn('percent', ['label' => __('Percent')]);
        $this->_addAfter = false;
        $this->_addButtonLabel = __('Add More');
        parent::_construct();
    }

    protected function _prepareArrayRow(\Magento\Framework\DataObject $row) {
        $options = [1,2,3];
        $row->setData('option_extra_attrs', $options);
    }

}

system.xml

<field id="abc_fee_table" translate="label comment tooltip" sortOrder="17.4" showInDefault="1" showInWebsite="1" showInStore="0">
                    <label>Abc Fee by Number of Installments(NOI)</label>
                    <frontend_model>Abc\Paymentmethod\Block\Adminhtml\System\Config\Form\Field\Feetable</frontend_model>
                    <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
                </field>


texts: Ordering Modules that both use sales_order_place_after observer

texts:
I'm writing two custom modules that act independently on the sales_order_place_after event observer and modify order state and status. One module (Module A) will act on every order and update the state, status (pending dispatch) and create a shipment, and the other module (Module B) will only apply an action if some criteria is present (a fraud check) and mark the order back to another status (suspected fraud).

Currently it appears that they are firing in the order Module B then Module A when it needs to be the other way around. I get the impression this is what's occurring because the order history of an order that fulfils the criteria for ModuleB an order will go from pending->suspected_fraud->pending_dispatch when it should be going from pending->pending_dispatch->suspected_fraud

Is it possible to make Module A fire first and then Module B to fire second without combing the modules into 1?


texts: Export a large catalog with over 300,000 skus

texts:
I am trying to export all products with Dataflow - Profiles/Export All Products and when I click on Run Profile in Popup the page loads and loads and finishes loading on a blank screen, and it doesn't create any file in /var/export.
Seems to me like the server can't handle this much data.

Do you have any idea how to solve this?


texts: how to add the block from other xml file

texts:
I have a custom xml file which has the block which i am targeting and it is productalert.xml as fallow:

<catalog_product_view>
    <reference name="content">
        <reference name="product.info">
            <reference name="alert.urls">
                <block type="productalert/product_view" name="productalert.price" as="productalert_price" template="productalert/product/view.phtml">
                    <action method="preparePriceAlertData"/>
                    <action method="setHtmlClass"><value>alert-price link-price-alert</value></action>
                    <action method="setSignupLabel" translate="value"><value>Sign up for price alert</value></action>
                </block>
                <block type="productalert/product_view" name="productalert.stock" as="productalert_stock" template="productalert/product/view.phtml">
                    <action method="prepareStockAlertData"/>
                    <action method="setHtmlClass"><value>alert-stock link-stock-alert</value></action>
                    <action method="setSignupLabel" translate="value"><value>Sign up to get notified when this product is back in stock</value></action>
                </block>
            </reference>
        </reference>
    </reference>
</catalog_product_view>

I want to include this two blocks in catalog.xml in product view so I am doing it here:

<reference name="content">
            <block type="scosche_catalog/product_view" name="product.info" template="catalog/product/view.phtml">
      <block type="productalert/product_view" name="productalert.price" as="productalert_price" template="productalert/product/view.phtml">
                        <action method="preparePriceAlertData"/>
                        <action method="setHtmlClass"><value>alert-price link-price-alert</value></action>
                        <action method="setSignupLabel" translate="value"><value>Sign up for price alert</value></action>
                    </block>
                    <block type="productalert/product_view" name="productalert.stock" as="productalert_stock" template="productalert/product/view.phtml">
                        <action method="prepareStockAlertData"/>
                        <action method="setHtmlClass"><value>alert-stock link-stock-alert</value></action>
                        <action method="setSignupLabel" translate="value"><value>Sign up to get notified when this product is back in stock</value></action>
                    </block>
      </block>
    </reference>

then in catalog/product/view.phtml I called one of these two blocks as fallow:

<?php $this->getChildHtml('productalert_stock');?>

It is not working seems that I updated the catalog.xml wrong. how should i do it?


texts:
This snippet works fine except that it returns a different set of product collection, mainly due to is anchor attribute:

$category = Mage::getModel('catalog/category')->load(1371);
$collection = Mage::getModel('catalog/product')
    ->getCollection()
    ->addCategoryFilter($category);

The snippet above returns the complete products including the child category products. However, when running through cron, it returns only a small amount of items. I could simulate what the cron is getting by defining:

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

I want to get the collection that includes the sub category products. How can I achieve this?


texts: How to remove collection filter from Magento 1.9?

texts:
I want to add filter to grid. When I add filter to sales_billing_agreement, I got the following error.

SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'store_id' in where clause is ambiguous, query was: SELECT COUNT(*) FROM `sp_sales_billing_agreement` AS `main_table`
 INNER JOIN `sp_customer_entity` AS `ce` ON ce.entity_id = main_table.customer_id
 LEFT JOIN `sp_customer_entity_varchar` AS `firstname` ON firstname.entity_id = main_table.customer_id AND firstname.entity_type_id = 1 AND firstname.attribute_id = '5'
 LEFT JOIN `sp_customer_entity_varchar` AS `middlename` ON middlename.entity_id = main_table.customer_id AND middlename.entity_type_id = 1 AND middlename.attribute_id = '6'
 LEFT JOIN `sp_customer_entity_varchar` AS `lastname` ON lastname.entity_id = main_table.customer_id AND lastname.entity_type_id = 1 AND lastname.attribute_id = '7' WHERE (`store_id` IN(2))

Here is the PHP code

$this->getCollection()->addFieldToFilter('store_id', array('in' => $storeIds))->load();

Due to the error above, I update the PHP code to this,

try {
        $this->getCollection()->addFieldToFilter('store_id', array('in' => $storeIds))->load();
        } catch (Zend_Db_Statement_Exception $e) {
            $this->getCollection()->addFieldToFilter('main_table.store_id', array('in' => $storeIds))->load();
    }

And then, the same error occurred, and I found that the previous filter is still there. Here is the new error.

SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'store_id' in where clause is ambiguous, query was: SELECT COUNT(*) FROM `sp_sales_billing_agreement` AS `main_table`
 INNER JOIN `sp_customer_entity` AS `ce` ON ce.entity_id = main_table.customer_id
 LEFT JOIN `sp_customer_entity_varchar` AS `firstname` ON firstname.entity_id = main_table.customer_id AND firstname.entity_type_id = 1 AND firstname.attribute_id = '5'
 LEFT JOIN `sp_customer_entity_varchar` AS `middlename` ON middlename.entity_id = main_table.customer_id AND middlename.entity_type_id = 1 AND middlename.attribute_id = '6'
 LEFT JOIN `sp_customer_entity_varchar` AS `lastname` ON lastname.entity_id = main_table.customer_id AND lastname.entity_type_id = 1 AND lastname.attribute_id = '7' WHERE (`store_id` IN(2)) AND (`main_table`.`store_id` IN(2))

Is there a way to remove the previous filter before adding the new filter?

Thanks in advance.


texts: root is taking ownership of generated files?

texts:
I am trying to setup a new Magento 2.3 site.  I keep seeing weird issues where some of the permissions have ownership set to root.  It seems like some of the files are getting generated as root.  I have a script that fixes the permissions, and things continue to work as expected for a while, but I'd like to understand why it is happening in the first place.

I extract the tarball as the site user.  I start the install, but then I hit a writable problem in the file system.  I can fix the permissions, and it will install, but why are those files owned by root?

File Permission Check
1 file permission not met. Hide detail

The best way to resolve this is to allow write permissions for files in the following Magento directories and subdirectories. The exact fix depends on your server, your host, and other system variables.
For help, see our File Permission Help or call your hosting provider.

"/var/www/vhosts/steamspeed.com/httpdocs/app/etc" - Writable.
"/var/www/vhosts/steamspeed.com/httpdocs/var" - Not writable, change the permissions. Show details
"/var/www/vhosts/steamspeed.com/httpdocs/pub/media" - Writable.
"/var/www/vhosts/steamspeed.com/httpdocs/pub/static" - Writable.
"/var/www/vhosts/steamspeed.com/httpdocs/generated" - Writable.

The site user can't delete the files.

sw@ss:~/httpdocs$ rm -rf *
rm: cannot remove ‘generated/code/Composer/Console/ApplicationFactory.php’: Permission denied
rm: cannot remove ‘generated/code/Symfony/Component/Console/Input/ArrayInputFactory.php’: Permission denied
rm: cannot remove ‘generated/code/Symfony/Component/Console/Helper/TableFactory.php’: Permission denied
rm: cannot remove ‘generated/code/Symfony/Component/Console/Question/QuestionFactory.php’: Permission denied
rm: cannot remove ‘generated/code/Magento/Indexer/Model/Indexer/CollectionFactory.php’: Permission denied
rm: cannot remove ‘generated/code/Magento/Framework/Config/Composer/PackageFactory.php’: Permission denied
rm: cannot remove ‘generated/code/Magento/Framework/App/ResourceConnection/Config/Proxy.php’: Permission denied
rm: cannot remove ‘var/composer_home/cache/repo/https---repo.packagist.org’: Permission denied
rm: cannot remove ‘var/composer_home/cache/repo/https---repo.magento.com’: Permission denied
rm: cannot remove ‘var/composer_home/cache/.htaccess’: Permission denied
rm: cannot remove ‘var/composer_home/cache/files’: Permission denied
rm: cannot remove ‘var/composer_home/.htaccess’: Permission denied
sw@ss:~/httpdocs$ ll generated/code/Symfony/Component/Console/Helper/TableFactory.php
-rw-rw-r-- 1 root root 1114 Dec 24 02:54 generated/code/Symfony/Component/Console/Helper/TableFactory.php

When I watch what php processes are running, it looks like most of them run as php-fmp as the site user.  I also see php processes running as root.

What is wrong with my php configuration?


texts: Attempting to merge a different shopping cart with Magento

texts:
I have an ambitious goal of merging about 1000 orders from a custom, shopping cart solution (not Magento) that we used before my company switched to Magento. This is for the sake of customer service reps who are having to bounce back and forth between two systems to find an order but it would also help with reporting. The plan was to create an additional column in Magento's order grid that represented the previous shopping cart's order number as Magento uses a different numbering system.

I see sales_flat_order and sales_flat_order_grid contain a large amount of order data. I attempted at first just to populate these two tables, create sequential entity_ids and increment_ids (order number) but my orders didn't show.

Question: What is the minimum number of tables that must be populated in order for Magento to show orders on the order grid? I may not necessarily have shipping information or customer information however I can populate those additional tables if necessary.


texts: Magento2 Display out of stock products at last

texts:
We have to display out of stock products at last in the list pages.

Let me if anybody have an idea.

Thanks


texts: Email template settings are not changing - magento 2

texts: I am trying to change the order comment email template from backend Sale->sales email -> Order comment -> selecting an email template but not getting saved.


texts: How can I request a external website with my data in observer and get back the response?

texts:
Actually am getting my total amount of product in Observer of event

  sales_order_invoice_save_after

Now I need to place this amount in a url and access the particular url and get back the response. How can be it done?

And also in this observer how can i get the product attribute values?

$observer->getEvent()->getInvoice()->getOrder() -> getData();

By the above code am getting the order details, but i need to get the product details.

Thanks


texts: Magento 2 how to billing address fields under shipping address in shipping page

texts: As i need custom fields for billing address under shipping address in shipping page and text entered should display as billing address all over website where billing address will display


texts: Redirect user to login page from store Magento 1.9

texts:
I'm trying to rediect the user to login page after the store is opened the url for the store is

e.g mysiteabc.com/store1

I want the user redirect to login page if he/she visits the store 1
I am trying this code as Reference but it doesnot work for me . Tell me What i'm doing wrong here

config.xml

 <frontend>
     <events>
         <controller_action_predispatch>
             <observers>
                 <client_controller_action_predispatch>
                     <type>singleton</type>
                     <class>Vendor_Module_Model_Observer</class>
                     <method>preDispatch</method>
                 </client_controller_action_predispatch>
             </observers>
         </controller_action_predispatch>
     </events>
</frontend>

Observer.php

class Vendor_Module_Model_Observer {
    public function preDispatch(Varien_Event_Observer $observer)
    {
        $controller = $observer->getControllerAction();
        if (Mage::app()->getStore()->getId() == STORE_ID) {

            if ('customer' === $controller->getRouteName()) {
                return $this;
            }

            if (!Mage::getSingleton('customer/session')->authenticate($controller)) {
                $controller->setFlag('', 'no-dispatch', true);
            }
        }
    }
}


texts: ScopeConfig is not working in 'checkout_cart_update_items_after' observer

texts:
I use an observer checkout_cart_update_items_after to update the price of a product.In Vendor\Module\Observer\PriceRule\UpdateObserver my observer code resides.In this class I need to use ScopeConfigInterface. But when I declare it in the constructor like this--

 public function __construct(
    Session $session,

    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
) {
    $this->scopeConfig = $scopeConfig;
    $this->customerFactory = $customerFactory;

My observer stop working.But when I remove this two line--

\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
$this->scopeConfig = $scopeConfig;

it works fine.But I need to use scope config to implement my logic.
Please help me in this regard.


texts: How to add a span tag to template in the onepage checkout?

texts:
I need to add a span-Tag next to the radio-Buttons in the payment template of the checkout.
And my question is HOW DO I DO THAT?
I can't find any template that matchs. There are several templates for payment but no matter which template I change in the CORE there is no visible change in the frontend when I call setup:static-content:deploy to create the new templates.
I also cleared all caches.


texts: Change the layout for a specific product

texts:
I've taken over maintenance of a multi-site Magento store & need to create a new layout to be used on certain products. I know I can select a custom layout in the design tab of the Product Information page in the back-end. What I don't quite understand is how I make a new layout to appear in the drop-down list here. I've looked at tutorials but nothing really seems to cover this. Am I right in thinking that I need to create something like newlayout.phtml in the theme's layout folder?

Any help, tips, advice, or tutorials would be gratefully received.


texts:
I keep receiving this error in my exception log:

2016-10-14T09:20:43+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'Invalid webservice adapter specified.' in /homepages/22/d123456/htdocs/mysite/app/Mage.php:595
Stack trace:
#0 /homepages/22/d123456/htdocs/mysite/app/code/core/Mage/Api/Model/Server.php(127): Mage::throwException('Invalid webserv...')
#1 /homepages/22/d123456/htdocs/mysite/api.php(84): Mage_Api_Model_Server->initialize(NULL)
#2 {main}

Also, this line is uncommented in my .htaccess:

###########################################
## rewrite API2 calls to api.php (by now it is REST only)

RewriteRule ^api/rest api.php?type=rest [QSA,L]


texts: Magento 2 - CSS not loading after module install

texts: My css isn't loading after I installed and enabled a module in command line, can anyone help with how I can fix this?


texts: Magento Dashboard QR Code instead of Graph! Google API Failure?

texts:
When I log into Magento & get redirected to the dashboard, I see a QR code where once there was a chart. Has anybody ever experienced this? I can see that that the image itself refers to:

/dashboard/tunnel/key/

The problem is intermittent. Has anybody experienced this before? Am I losing my mind?

Edit: I can see that Google's API is referenced in app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php.

Round about line 40:

const API_URL = 'http://chart.apis.google.com/chart';

Could this be related to an issue with Google?

Edit 2: When scanning the QR code, it points to the following url: http://www.wisknow.com/books/?p=5556

Edit 3: I've spoken to Nexcess, and got the following response:

  Your site has not been hacked. Magento uses google charts API and it
  appears they are having an issue. We are also seeing weird results
  with google images search. As soon as we get more details, we will
  update you.


texts: Add product to cart ignoring custom options

texts:
I'm working in a module that will add products to cart via chatbot, and I'm having some issues when the product has custom options. Since do not know the possible options required to the product, I'm trying to "force" add a product with custom option (or not) to the cart, but everytime I'm getting a message asking to specify some product custom option:

2017-02-26T17:24:28+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'Please specify product link(s).' in /home/werules/testbots.tk/store/app/Mage.php:595
Stack trace:
#0 /home/werules/store/app/code/core/Mage/Checkout/Model/Cart.php(287): Mage::throwException('Please specify ...')
#1 /home/werules/store/app/code/community/Werules/Chatbot/Model/Chatdata.php(243): Mage_Checkout_Model_Cart->addProduct(Object(Mage_Catalog_Model_Product), Array)

Here is my code so far:

$product = Mage::getModel('catalog/product')->load($prodId);
$product->setSkipCheckRequiredOption(true);
$cart->addProduct($product, array());
$cart->save();
$checkout->setCartWasUpdated(true);

I'm using setSkipCheckRequiredOption but it dosen't seems to be working.

How can I accomplish that? Either ignoring any requirements or setting them to any default value would work for me.

Best


texts: What is the role of the `load()` method in the collection class?

texts:
In Magento\Framework\Data\Collection there is a method getFirstItem which calls $this->load()

public function getFirstItem()
{
    $this->load();
...}

load method from the same class:

/**
 * Load data
 *
 * @param bool $printQuery
 * @param bool $logQuery
 * @return $this
 */
public function load($printQuery = false, $logQuery = false)
{
    return $this->loadData($printQuery, $logQuery);
}

loadData from this class:

/**
 * Load data
 *
 * @param bool $printQuery
 * @param bool $logQuery
 * @return $this
 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
 */
public function loadData($printQuery = false, $logQuery = false)
{
    return $this;
}

it seems that load does nothing useful but when I comment it out it affects execution of code. How does calling this method trigger any action?

Are there any magic php methods that are executed on return $this;?


texts: Magento 2 - Recently viewed product collection from Model

texts:
Please read description carefully before marking it as duplicate

I want to get recently viewed product collection from Model instead of Block

I have check similar post but no one answered it correctly
How to get recently viewed product collection in magento2?


texts: Magento migration product error: UiComponentFactory->argumentsResolver('created_by', NULL)

texts:
I'm trying to migrate my Magento 1.9.3.4 to Magento 2.2.2 with the data-migration-tool.

I did it and the store is working in localhost; I have the customers, sales, static pages and products.

I receive this fatal error when I tried to edit one product:

  Fatal error: Uncaught TypeError: Argument 2 passed to
  Magento\Framework\View\Element\UiComponentFactory::argumentsResolver()
  must be of the type array, null given, called in
  D:\xampp\htdocs\magento2\vendor\magento\framework\View\Element\UiComponentFactory.php
  on line 212 and defined in
  D:\xampp\htdocs\magento2\vendor\magento\framework\View\Element\UiComponentFactory.php:164
  Stack trace:

  0 D:\xampp\htdocs\magento2\vendor\magento\framework\View\Element\UiComponentFactory.php(212):
  Magento\Framework\View\Element\UiComponentFactory->argumentsResolver('created_by',
  NULL)

  1 D:\xampp\htdocs\magento2\vendor\magento\module-ui\Component\Form\Field.php(84):
  Magento\Framework\View\Element\UiComponentFactory->create('created_by',
  '', Array)

  2 D:\xampp\htdocs\magento2\vendor\magento\framework\View\Layout\Generator\UiComponent.php(159):
  Magento\Ui\Component\Form\Field->prepare()

  3 D:\xampp\htdocs\magento2\vendor\magento\framework\View\Layout\Generator\UiComponent.php(156):
  Magento\Framework\View\Layout\Generator\UiComponent->prepare in
  D:\xampp\htdocs\magento2\vendor\magento\framework\View\Element\UiComponentFactory.php
  on line 164

Some suggestion?


texts: how to integrate reward extension in a magento code

texts:
I have an issue how to integrate extension in a Magento, extension work fine in a website, I want to do same functionality from outside the Magento programmatically. Suppose I am using add to cart code , how i am using this extension in it

   <?php
   $id = '100'; // Replace id with your product id
   $qty = '2'; // Replace qty with your qty
   $_product = Mage::getModel('catalog/product')->load($id);
   $cart = Mage::getModel('checkout/cart');
   $cart->init();
   $cart->addProduct($_product, array('qty' => $qty));
   $cart->save();
   Mage::getSingleton('checkout/session')->setCartWasUpdated(true);
   ?>


texts: Allow only one qty of item into cart in Magento 2

texts:
I have created a custom controller in my module and calling via ajax to add the item to cart.

Below is my controller code.

<?php

 namespace {Vendor}\{Module}\Controller\Product;
 class AddProduct extends \Magento\Framework\App\Action\Action
{
 protected $formKey;
 protected $cart;
 protected $product;
 protected $checkoutSession;
 public function __construct(
 \Magento\Framework\App\Action\Context $context,
 \Magento\Framework\Data\Form\FormKey $formKey,
 \Magento\Checkout\Model\Cart $cart,
 \Magento\Catalog\Model\ProductFactory $product,
 \Magento\Checkout\Model\Session $checkoutSession,
 array $data = []) {
  $this->formKey = $formKey;
  $this->cart = $cart;
  $this->product = $product;
  $this->checkoutSession = $checkoutSession;
  parent::__construct($context);
  }
  public function execute()
  {
  $productId = 1;
  $customPrice = 150;
  $params = array(
    'form_key' => $this->formKey->getFormKey(),
    'product_id' => $productId, //product Id
    'qty'   => 1 //quantity of product
  );
  $_product = $this->product->create()->load($productId);
  $this->cart->addProduct($_product, $params);

  $productItem = $this->getProductQuote($_product);
  $productItem->setCustomPrice($customPrice);
  $productItem->setOriginalCustomPrice($customPrice);
  //Enable super mode on the product.
  $productItem->getProduct()->setIsSuperMode(true);
  $this->cart->save();
  echo "success";
 }

 public function getProductQuote($product)
 {
  $quote = $this->checkoutSession->getQuote();
  $cartItems = $quote->getItemByProduct($product);
  return $cartItems;
 }
}

The above code adds the product of qty 1 to the cart with a custom price whenever it is called.

I want to add only 1 qty of product to the cart. suppose if its called two or three times, only one qty should be present in cart. Need to remove previously added qty from the cart.

Is something can be done programmatically? There is a product setting in backend "Maximum qty allowed in cart", we can set this value but I am looking for the code how it can be done programmatically.

Can anyone look into it and help me, please. Thanks


texts: M2 Enterprise: How to add Special Price for product from date to date programmatically?

texts:
I want to add a Special Price for a product from date to date programmatically by code but don't know how.

I can set in admin but I want to use code to save multiple products.

I use Enterprise Edition and don't have the date fields. Instead the content staging feature is used to schedule price changes.

in EE using scheduled:

in Scheduled:


texts:
Need a script where current existing products needs to unlink and link to other categories.
let me know the process also


texts: Product Prices are mismatch in invoice and invoice PDF magento 2.2.1

texts:
I am getting different price in invoice and invoice PDf for the bundle product. Actually, The prices in the invoice pdf are wrong. I am getting right price in order, order email, invoice, invoice email or everywhere in the application, but invoice PDf price is wrong only Bundle product.
Please see the attach screen shot.

Invoice:

Invoice Pdf:

Please suggest, who can I solve this?


texts: Update shipping rates on changing postcode on checkout page

texts:
I'm trying to create a module with custom shipping method. So I've followed this tutorial to create it. This link and this link, to configure shipping carrier validations.

The problem is, if I change the zip/postcode, the shipping's value does not change. My question is, how can I update the shipping cost value when customer update its address information (postcode to be more specific)? Or when we use the guest-checkout and there is no address information?

Thanks in advance.


texts:
I was looking for validation for multiple fields. There are a lot of tutorials/articles with single field validation. But how to create fully-working validation for combined fields - 2 (or more fields) with one message. For example, I'd like to validate:
XX YYY
where XX and YYY are different (input type text) fields.
I have created custom Validation.add() but there is still problem with adding/removing classes from both fields.
My code looks like this:

Validation.add('validate-postcode', Translator.translate('Please enter a valid post code.'), function (v, elm) {
    var elem1 = jQuery(elm),
        relatedElem = jQuery('#' + elem1.attr('data-related-field')),
        passed = false;
    if (typeof relatedElem !== 'undefined') {
        relatedElem.removeClass('validation-failed');
        relatedElem.removeClass('validation-passed');
        elem1.removeClass('validation-failed');
        elem1.removeClass('validation-passed');
        passed = !Validation.get('IsEmpty').test(elem1.val()) &&
                !Validation.get('IsEmpty').test(relatedElem.val()) &&
                /^\d{3}$/.test(elem1.val()) &&
                /^\d{2}$/.test(relatedElem.val());
        if (!passed) {
            relatedElem.addClass('validation-failed');
            elem1.addClass('validation-failed');
        }
    }
    return passed;
});

In this source data-related-field is the attribute for one field to be related with another - value of this attribute is id of related field.


texts: Magento 2 - Add reviews list in theme template

texts:
I need to show a list of latest reviews on magento 2 homepage.
I did it this way

<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$reviewCollection = $objectManager->create('Magento\Review\Model\ResourceModel\Review\CollectionFactory');
$collection = $reviewCollection->create()->load();

foreach ($collection as $review){
 echo $review->getTitle().'<br>';
}  ?>

But I feel like its a bad practice, is there a better solution?


texts: I am working on script which is used in outside of magento. I am using this link for creating category tree structure but it gives me only those category collection which are active in admin section for particular store. It not gives me other categories which are active in subadmin panel but inactive in admin panel. I want all active category tree structure on the basis of subadmin active condition on categories.


texts: how much time a Magento team will take to check submitted extension?

texts: I want to know that Generally..how much time a Magento team will take to check submitted extension ? And within how many days after submitted my extension i get reply from magento team about my extension status...??


texts: get review rating star by product id magento

texts:
I need to show rating star on my page.

How to display rating star and review on my page ?


texts: Will Website Restrictions restrict customer import too?

texts: I drilled this official document to no avail. I know the frontend customer registration will be restricted. And I tried on admin panal, the restriction take effect too. So if website restriction turn on, customer import will also blocked?


texts:
Does anyone have a script for importing custom customer list form a csv or xml ?
i found the next script for magento 1: https://gist.github.com/peterjaap/5955852, but for magento 2 i can't find anything.

Can anyone give me the answer to this?
Or maybe a customer database diagram?


texts: How to get Customer gender from customer id?

texts:
I tried to extract customer System->Import/Export->dataflow-Profles, due to large no of data it will stop the running and did not retrieve any csv file in the export folder.

I manually tried to get the data by a query,below is my approach for the result.

//resources
$resource = Mage::getSingleton('core/resource');
// db access
$db_read = $resource->getConnection('core_read');
$db_write = $resource->getConnection('core_write');
// support table prefix if one is being used
$table_prefix = Mage::getConfig()->getTablePrefix();
// count the customers
$numberof_customers = $db_read->fetchOne("SELECT COUNT(*) AS num FROM {$table_prefix}customer_entity WHERE is_active = 1");

$customers = $db_read->fetchAll("SELECT cus.* FROM {$table_prefix}customer_entity AS cus WHERE cus.is_active = '1'");

for($i=0; $i < intval($numberof_customers); $i++){

  $entity_id = $customers[$i]['entity_id'];
  $items = $db_read->fetchAll("Select * from {$table_prefix}customer_entity as CE
           JOIN {$table_prefix}customer_entity_varchar as CEV
           ON CE.entity_id=CEV.entity_id
           WHERE CEV.attribute_id=162
           AND CE.entity_id=$entity_id");//where 162 is one of attribute id for my selection
foreach ($items AS $item) {
  $cus_id =  $item['entity_id'];
  $obj = Mage::getModel('customer/customer');
  $_custom = $obj->load($cus_id);
  echo $_custom->getId()."-".$_custom->getName()."-".$_custom->getPrimaryBillingAddress()->getCity()."-".$_custom->getEmail()."-".$_custom->getMobile();

My question is , i want to retrieve gender for the specific customer in my out put.
How can i retrieve gender?
Great thanks for your help.. :)


texts: Get Breadcrumb Path in Custom controller Magento 2

texts:
I am trying to get breadcrumb path in my controller by using this helper

public function __construct(\Magento\Catalog\Helper\Data $catalogData, ) {
$this->catalogData = $catalogData;
}
$path = $this->catalogData->getBreadcrumbPath();

When I print $path it's giving me an empty array. But when I get this helper function in any product phtml file like this

$helper = $this->helper('\Magento\Catalog\Helper\Data');
$values = $helper->getBreadcrumbPath();

it's giving me the full path in phtml. How can I access this function in my controller as well?


texts: Magento2: Issue with getPublicName from custom module

texts:
I have custom module.
app/code/Ced/Marketplace/view/frontend/templates/vendor.phtml
Code:
    <?php
    $vendorData = $block->getVendorData();
    if ($vendorData->getId()) {?>

<?= /* @noEscape */ __('od').' ';?>
            <a href=<?= /* @noEscape */ $vendorData->getVendorShopUrl();?>><?= /* @noEscape */ $vendorData->getPublicName(); ?>

    <?php } ?>

This file is called in: app/code/Ced/Marketplace/view/frontend/layout/catalog_product_view.xml
<referenceContainer name="product.info.main">
        <block class="Ced\CsMarketplace\Block\Catalog\Product\View"
            name="product.view.extra"
            template="Ced_CsMarketplace::vendor.phtml" before="-">
        </block>
    </referenceContainer>

and working correct on product page.
Description Issue:
Now I try copy code to our .phtml template example: app/design/frontend/theme/mytheme/Magento_Catalog/product/view/view-info.phtml to get example:
vendorData->getPublicName

But when I paste this code to our template I get issue:
Error: Call to a member function getId() on null in /home/fsgroup/domains/webbb.pl/public_html/app/design/frontend/MageBig/martfury/layout01/Magento_Catalog/templates/product/view-info.phtml:138 Stack trace: #0 /home/fsgroup/domains/webbb.pl/public_html/vendor/magento/framework/View/TemplateEngine/Php.php(71): include() #1 /home/fsgroup/domains/webbb.pl/public_html/vendor/magento/framework/View/Element/Template.php(273): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\View\Description), '/home/fsgroup/d...', Array) #2 /home/fsgroup/domains/webbb.pl/public_html/vendor/magento/framework/View/Element/Template.php(303): Magento\Framework\View\Element\Template->fetchView('/home/fsgroup/d...') #3 /home/fsgroup/domains/webbb.pl/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(1111): Magento\Framework\View\Element\Template->_toHtml() #4

I found one code  in phtml file from app/code/Ced/Marketplace and when  I copy to our template .phtml  copy to (app/design/frontend/MageBig/martfury/Magento_Catalog/product/view/view-info.phtml )
which working correct and  not get any issue and get vendor data.
Code:
<?php $_product = $block->getProduct();  ?>
<?php $vendorId = $block->getVendor(); ?>
<?php $isMessagingEnableForAllProduct = $this->helper('Ced\CsMarketplace\Helper\Data')->getStoreConfig('ced_csmarketplace/csmessaging/enable_messaging_forallproduct');?>

<?php if ($_product->getEnableMessaging() || $isMessagingEnableForAllProduct) : ?>
    <a href="<?php if ($vendorId == \Ced\CsMessaging\Helper\Data::ADMIN_ID) {
        echo $this->getUrl('csmessaging/customer/vcompose',['admin'=>true,'product_id'=>$_product->getId()]);
    } else {
        echo $this->getUrl('csmessaging/customer/vcompose',['vendor_id'=>$vendorId,'product_id'=>$_product->getId()]);
    }?>"><?php echo __('Zapytaj o produkt');?>
<?php endif; ?>

So can someone help me to implement this code to get it vendor PublicName?


texts: Google doesn't ignore ?SID when its disallowed in robots.txt

texts: I have disallowed? SID in my robots.txt but Google still likes to show them in search results.


texts: Can't set additional options for configurable product in Magento 2

texts:
I'm using following code to set additional options for configurable product in magento 2
<?php
namespace Company\ModuleName\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\Event\Observer as EventObserver;

class AdditionalOptions implements ObserverInterface
{

    /**
     * @var \Magento\Framework\View\LayoutInterface
     */
    protected $_layout;
    /**
     * @var \Magento\Store\Model\StoreManagerInterface
     */
    protected $_storeManager;
    protected $_request;
    /**
     * @param \Magento\Store\Model\StoreManagerInterface $storeManager
     * @param \Magento\Framework\View\LayoutInterface $layout
     */
    public function __construct(
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\View\LayoutInterface $layout,
        \Magento\Framework\App\RequestInterface $request
    )
    {
        $this->_layout = $layout;
        $this->_storeManager = $storeManager;
        $this->_request = $request;
    }
    /**
     *
     * @param EventObserver $observer
     * @return void
     */
    public function execute(EventObserver $observer)
    {
        /* @var \Magento\Quote\Model\Quote\Item $item */
        $item = $observer->getQuoteItem();

        $additionalOptions = array();
        if ($additionalOption = $item->getOptionByCode('additional_options')){
            $additionalOptions = (array) unserialize($additionalOption->getValue());
        }
        $post = $this->_request->getParam('custom_options');
        if(is_array($post))
        {
            foreach($post as $key => $value)
            {
                if($key == '' || $value == '')
                {
                    continue;
                }
                $additionalOptions[] = [
                    'label' => $key,
                    'value' => $value
                ];
            }
        }
        if(count($additionalOptions) > 0)
        {
            $item->addOption(array(
                'product_id' => $item->getProductId(),
                'code' => 'additional_options',
                'value' => serialize($additionalOptions)
            ));
        }
    }
}

Above code works when customer is not logged in and I get following result.

Additional Option labelled Testing Option is shown in the image above.
But, when the customer is logged in, and when I land on checkout/cart page, the additional option is rendered on the screen just like above image, looking into the tables, I see a record with additional_options in quote_item_option table as shown below

but one function is called after rendering the checkout/cart page named loadCustomerQuote() in vendor/magento/module-checkout/Model/Session.php
This function deletes all the entries of that quote id from quote_item and quote_item_option table and clone them with new ids.
New records are inserted after the function is called as shown below.

The record with code additional_option is not cloned or added after deletion just like rest of the records.
Can anyone help me out why this happens for only configurable product while customer is logged in?
Above code works for simple product with and without customer logged in.


texts:
I have 4 store with different domain name. and I want to share cart for 4 stores I have research and implement this url :

http://marius-strajeru.blogspot.ro/2013/01/share-cart-between-websites.html

but it doesn't work. cart still separate. anyone has experience on sharing on Magento 1.9.1 .

Please help.


texts: magento 2 error : while Compiling getting following error

texts:
Errors during compilation:

Magento\Ccavenuepay\Block\Transparent\Form
    Incompatible argument type: Required type: \Magento\Payment\Model\Config. Actual type: \Magento\Ccavenuepay\Model\Config;
    File:
    /home/bhushankamble90/public_html/magento2/app/code/Magento/Ccavenuepay/Block/Transparent/Form.php

    Magento\Ccavenuepay\Helper\Backend\Data

    Incompatible argument type: Required type: \Magento\Framework\View\LayoutFactory. Actual type: \Magento\Store\Model\StoreManagerInterface; File:
    /home/bhushankamble90/public_html/magento2/app/code/Magento/Ccavenuepay/Helper/Backend/Data.php

    Magento\Ccavenuepay\Controller\Ccavenuepay\Place
    Incompatible argument type: Required type: \Magento\Checkout\Model\Session. Actual type: \Magento\Framework\Registry; File:
    /home/bhushankamble90/public_html/magento2/app/code/Magento/Ccavenuepay/Controller/Ccavenuepay/Place.php

    Total Errors Count: 3


texts: Magento-2 : How to move breadcrumbs and maincontent in custom div on category page

texts:
I need to create one custom div and move below div inside custom div

Category page html structure like this

...

...

I need to something like this

...

    ...


texts:
Migrated from Magento 2.1 to 2.3

magento setup:upgrade
magento setup:di:compile
magento setup:static-content:deploy -f en_US en_GB

Ran without any errors. However, when I try to open a product it goes to 404

When I click on Add from Admin panel, it says Class "Magento\Catalog\Model\Product\Attribute\Backend\Media does not exist"

and when I try to Edit, it says 'Product does not exist'.

tail exception.log
[2018-12-31 11:10:50] main.CRITICAL: Class Magento\Catalog\Model\Product\Attribute\Backend\Media does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Catalog\\Model\\Product\\Attribute\\Backend\\Media does not exist at /home/magentowebmaster/public_html/kd/vendor/magento/framework/Code/Reader/ClassReader.php:19)"} []
[2018-12-31 11:14:34] main.CRITICAL: Class Magento\Catalog\Model\Product\Attribute\Backend\Media does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Catalog\\Model\\Product\\Attribute\\Backend\\Media does not exist at /home/magentowebmaster/public_html/kd/vendor/magento/framework/Code/Reader/ClassReader.php:19)"} []

What I tried:

2 queries.

UPDATE `mag_eav_attribute` SET `backend_type` = 'static' where `attribute_code` = 'media_gallery';

UPDATE `mag_eav_attribute` SET `backend_model` = NULL where `attribute_code` = 'media_gallery';


texts: How to display currency code in invoice template?

texts: I want to display currency code which was used for payment in invoice template. Currency code like CAD, USD . I have not found any directive for this. Please help me.


texts: MagenImage Upload File Extention JS Validation?

texts:
I'm new to Magento 2.3, i want to validate file upload field.

Allowed file formats: jpeg.

I put a method in lib\web\mage\validation.js

require([
        'jquery',
        'jquery/ui',
        'jquery/validate',
        'mage/translate'
    ], function ($) {
    //Validate Image Extensions

    $.validator.addMethod(
            'validate-fileextensions', function (v, elm) {

                var extensions = ['jpeg'];
                if (!v) {
                    return true;
                }
                with (elm) {
                    var ext = value.substring(value.lastIndexOf('.') + 1);
                    for (i = 0; i < extensions.length; i++) {
                        if (ext == extensions[i]) {
                            return true;
                        }
                    }
                }
                return false;
            }, $.mage.__('Disallowed file type.'));
});

and add this class validate-fileextensions in file > input, in this file app\code\{vendor_name}\{module_name}\Block\Adminhtml\Form\Edit\Tab\Main.php

        $fieldset->addField(
            'filename',
            'image',
            [
                'label' => __('File'),
                'title' => __('File'),
                'name' => 'filename',
                'required' => true,
                'disabled' => $isElementDisabled,
                'class' => 'validate-fileextensions'
            ]
        );

but its not working for me, also when i inspect on file > input, i can't see my custom class their. see below image.


texts: Magento2 Modify search criteria response that is available by Rest API

texts:
Magento2 How can I modify & pass only limited data to the Response of Magento Default Response API
http://ayz.arjun.local/rest/V1/products/?
searchCriteria[filter_groups][0][filters][0][field]=carpet_colours&
searchCriteria[filter_groups][0][filters][0][value]=12&
searchCriteria[filter_groups][0][filters][0][condition_type]=eq


texts: Customer account creation, save boolean value in attribute

texts:
So, as the title says, i've added some new attributes in my customer entity, one of which is a boolean, as you can see from the code in setup/InstallData.php

$customerSetup->addAttribute(\Magento\Customer\Model\Customer::ENTITY, 'azienda', [
        'type' => 'int',
        'label' => 'Azienda',
        'input' => 'boolean',
        'source' => '',
        'required' => false,
        'visible' => true,
        'position' => 333,
        'system' => false,
        'backend' => ''
    ]);

and i've also created the frontend layout override for "customer_account_create", everything works fine, other text fields i've added  are saved correctly but i can't get it to save in my database this "azienda" attribute which is a boolean. I've tried checkboxes, radiobuttons, textfields with "yes", "true" and "1", whatever i put in that field the boolean attribute will be always unchecked (false) after registration.

Hope i've explained my issue well enough, thank you for your help :)


texts: Shipping Rates on Magento - up to 20kg and over 20kg

texts:
I have a Magento installation running Magento Community.  I need to set up shipping classes based on a weight system.  Any item up to the weight of 20kg needs to be £5.00GBP for delivery, anything over 20kg needs to be £29.99GBP for delivery.

Currently the site is running shipping so that every 1kg is £5.00GBP but everything over 20kg is £29.99GBP so I have a slight problem with it, its also adding shipping for every item and not a total weight on the cart.

Is it possible to do the above at all?

Any help would be great!

Thanks.


texts: How to send Magento cron job customer email

texts: I have been trying to no avail to have Magento send a email to a customer after they make a order. I can go into the customers order in the Sales Orders and send them a email, but the auto sender is not working. I know I have to do something with cron job to send the queue of emails, I just dont know were to start looking. Any help would be appreciated, thanks!


texts: Magento 2 Reindex Fail `Unknown column 'entity_value.value'` in 'field list'

texts:
I am having this error when running php bin/magento indexer:reindex also failing when loading the product:

SQLSTATE[42S22]: Column not found: 1054 Unknown column
'entity_value.value' in 'field list', query was: SELECT `entity`.`sku`,
`product_entity`.`entity_id` AS `product_id`,
`attribute`.`attribute_code`, `entity_value`.`value` AS `value_index`,
`attribute_label`.`value` AS `super_attribute_label`,
IFNULL(option_value.value, default_option_value.value) AS
`option_title`, `default_option_value`.`value` AS `default_title` FROM
`catalog_product_super_attribute` AS `super_attribute`
INNER JOIN `catalog_product_entity` AS `product_entity` ON
product_entity.entity_id = super_attribute.product_id
INNER JOIN `catalog_product_super_link` AS `product_link` ON
product_link.parent_id = super_attribute.product_id
INNER JOIN `eav_attribute` AS `attribute` ON attribute.attribute_id =
super_attribute.attribute_id
INNER JOIN `catalog_product_entity` AS `entity` ON entity.entity_id =
product_link.product_id
INNER JOIN `catalog_product_entity` AS `entity_value` ON
entity_value.attribute_id = super_attribute.attribute_id AND
entity_value.store_id = 0 AND entity_value.entity_id = entity.entity_id
LEFT JOIN `catalog_product_super_attribute_label` AS `attribute_label`
ON super_attribute.product_super_attribute_id =
attribute_label.product_super_attribute_id AND attribute_label.store_id
= 0
LEFT JOIN `eav_attribute_option_value` AS `option_value` ON
option_value.option_id = entity_value.value AND option_value.store_id =
1
LEFT JOIN `eav_attribute_option_value` AS `default_option_value` ON
default_option_value.option_id = entity_value.value AND
default_option_value.store_id = 0 WHERE (super_attribute.product_id =
1721) AND (attribute.attribute_id = '')

In backend I get error:

I have disabled it because categories where having the exception also.

I am not sure but this product is missing something is some table any ideas where to start cause I can't even deleted unless got direct in mysql but again how may table entry to delete a product !

Any ideas any help apreciated. thanks


texts: Key issue when attempting to install Magento 2 EE with composer

texts:
Attempting to install Magento 2 EE for a client according to this documentation: http://devdocs.magento.com/guides/v2.0/install-gde/prereq/integrator_install_ee.html

I ran the command:

composer create-project --repository-url=https://repo.magento.com/ magento/project-enterprise-edition enterprise-instance

As stated in the documentation, I was prompted for my private/public key pair which I retrieved from my magento.com account. As I'm just the developer and this is not the client's key pair, I received the expected error:

"[InvalidArgumentException]
  Could not find package magento/project-enterprise-edition with stability stable."

The documentation states: "If you receive this error after creating authentication keys as discussed previously, your account might not be authorized to download Magento EE. Contact Magento support to resolve the issue."

Not a problem, I realized that I should have provided the client's key pair which they then provided.

The issue I'm running into now is that composer is not prompting me to put in a new key pair, I just keep getting the same error message about not being able to find the stable package.

Question: How do I get composer to prompt me for a new key pair? Is there an argument that needs to be passed in the composer statement?


texts:
Many times i am debugging SQL Query in Magento. But i am little confuse about usages of main_table in SQL query in Magento.

I can't find any table named with  "main_table" in database.

Can anyone tell me the concept about main_table in Magento.


texts: list.phtml not overriding/ not reflecting the changes : Magento 2

texts:
all I am trying to override list.phtml to customize product listing on every product listing pages.
I tried this way.
I have app/code/<Vendor>_<Module>/view/frontend/layout/catalog_category_view.xml file and copy list.phtml into my app/code/<Vendor>_<Module>/view/frontend/templates/product/list.phtml

But I see no changes to listing even after I run all the upgrade, cache, compile, deploy commands.

catalog_category_view.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="category.products.list">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Vendor_Module::product/list.phtml</argument>
        </action>
    </referenceBlock>
</body>


texts: Magento2 Migrated custom customer attribute is not saving the value

texts: I have migrated Magento data from version 1.9.0.1 to version 2.3.5-p1. In 1.9.0.1 setup there was a custom customer attribute created called mobile_no. The data and the attribute automatically created in my M2 setup. The mobile_no data is also visible in the M2 admin. But when I try to edit the number and save it, It saves the old value its not taking the updated one. Can anyone help me with this? I have to call this attribute in the frontend registration form.


texts:
I have 1 problem with Magento 2.3.3
All products save fine, but only 1 item XYZ cannot save.
I have seen in Magento\Catalog\Controller\Adminhtml\Product => function execute(), $product->save(); don't work for this product
It show this error
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 2, query was: SELECT `main_table`.*, `cp_table`.`type_id` FROM `cataloginventory_stock_item` AS `main_table` INNER JOIN `catalog_product_entity` AS `cp_table` ON main_table.product_id = cp_table.entity_id WHERE (`main_table`.`website_id` = '0') AND (`main_table`.`product_id` IN())

Please help me <3 Thanks all, happy coding


texts: Does Magento newsletter system process bounces?

texts:
Does Magento newsletter system process mail bounces?

Or do I need a plugin for this?


texts: Magento 2: display shipping option initially

texts:
I have only one shipping method in my store (DHL). It comes with a lot of additional options. But those only show once I click on the method's radio button.

This is where the magic somehow happens:

<div id="onepage-checkout-shipping-method-additional-load">
    <!-- ko foreach: getRegion('shippingAdditional') -->
    <!-- ko template: getTemplate() --><!-- /ko -->
    <!-- /ko -->
</div>

How can I get magento to display those options initially without the need of a click on the radion button?


texts: Difference between getModel('catalog/product') and getSingleton('catalog/product')

texts:
I have seen both function in Magento Files,

What is deference between both function. and also where I use one of them function.

Which is best to load Product Collection.


texts: Magento 2 How to add custom class to the country and state select box container in all forms in the frontend?

texts: I need to add a custom class to the country and state select box container in all forms expecially in shipping and billing address form on frontend?


texts: How to change compareProducts view page layout in magento2

texts: I want to change the product compare page layout form 1column to 2column-left please give me suggestions


texts: Add product to cart programmatically invalid request for adding product to quote

texts:
I'm trying to create a controller to add a product to the cart programmatically in magento 1.9, like this:

<?php
class Namespace_Module_IndexController extends Mage_Core_Controller_Front_Action{

    public function indexAction(){
    try {
      $productId = '146';

      $options = array('92'=>'49','144'=>'21');
      $insertData = array(
        'product_id' => $productId,
        'qty' => '1',
        'options' => $options
      );
      $cart = Mage::getSingleton('checkout/session')->getQuote();
      $product = Mage::getModel('catalog/product')->load($productId);
      $cart->addProduct($product, $insertData);
      $cart->save();
      Mage::getSingleton('customer/session')->setCartWasUpdated(true);
    } catch (Exception $e) {
      print_r($e->getMessage());
    }
    }
}

But when I check the cart, it's still empty and I get an error like this:

Invalid request for adding the product to quote.


texts: Error occurs during magento version upgrade from 2.3.4 to 2.3.6

texts:
I have a codazon theme installed in my magento website , it works well in magento 2.3.4 , eversince i am upgraded to magento 2.3.6 , i am getting following error in my home page slider of codazon .
"Error filtering template: Type Error occurred when creating object: Codazon\ProductFilter\Block\Product\ProductsList\Interceptor"
After upgrade all my functionalities works well , but got this error in my home page slider .
So, anyone facing above error .
Thanks in advance


texts: How to get details of products in a catalog search page?

texts: How to get details of products that are displaying in a catalog search page. I want to get Product SKU, Name, Category, Brand etc.


texts: Change attribute when currency is changed

texts: I want to change the attribute when currency is changed on product view page. For example when someone selects $ it changes to US sizes.


texts: Magento 2 get total_ordered_qty and total_qty_shipped

texts: How to get the total ordered qty and total shipped qty on phtml by order_id?