texts: Delete Magento orders with all related data

texts:
I have used an extension to delete some test orders from my Magento Store but while I have checked the data tables all related data to a deleted order was not removed, I have found the Query below where it deletes all the orders with the related data to those orders.

what I am want is to customize it where I can deleted the orders based on the  order_id or order incremental_id.

I user Magento 1.9.2.4

SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_order`;
TRUNCATE `sales_flat_order_address`;
TRUNCATE `sales_flat_order_grid`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_order_payment`;
TRUNCATE `sales_flat_order_status_history`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_quote_payment`;
TRUNCATE `sales_flat_quote_shipping_rate`;
TRUNCATE `sales_flat_shipment`;
TRUNCATE `sales_flat_shipment_comment`;
TRUNCATE `sales_flat_shipment_grid`;
TRUNCATE `sales_flat_shipment_item`;
TRUNCATE `sales_flat_shipment_track`;
TRUNCATE `sales_invoiced_aggregated`;
TRUNCATE `sales_invoiced_aggregated_order`;
TRUNCATE `sales_payment_transaction`;
TRUNCATE `sales_order_aggregated_created`;
TRUNCATE `sales_order_tax_item`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;
ALTER TABLE `sales_flat_creditmemo` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_status_history` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_track` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_payment_transaction` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_aggregated_created` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_tax` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_tax_item` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;
SET FOREIGN_KEY_CHECKS=1;


texts: Magento 2.2: Where is the block of template html?

texts:
I need to add a conditional by checking the information of an custom attribute, for example if it is 'S' to show the address, if it is 'B' not to show the address

I need to modify the next template:

  \vendor\magento\module-checkout\view\frontend\web\template\shipping-address\address-renderer\default.html

,

<button type="button"
        class="action edit-address-link"
        data-bind="click: editAddress, visible: address().isEditable()">

</button>

<button type="button" data-bind="click: selectAddress" class="action action-select-shipping-item">

</button>

Where does Magento get the address() object?


texts: How to execute javascript code and pass to it some values after an event is triggered?

texts:
I'm trying to execute some javascript code and pass to it some values after an event (e.g. Add to Cart event) is triggered. To be more specific I'd like to pass:

All logged customer details (Firstname, Lastname, Email, etc.)
Cart details (Product ID, Product Name, amount, price, etc.)

In order to do that, I create my own module like this:
Vendor/Module/registration.php
<?php

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

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

Vendor/Module/etc/events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
   <event name="checkout_cart_save_after">
      <observer name="checkout_cart_save_after" instance="Vendor\Module\Observer\AddToCart" />
   </event>
</config>

...and here I don't know how to move forward...
Vendor/Module/Observer/AddToCart.php
<?php

    namespace Vendor\Module\Observer;

    use Magento\Framework\Event\ObserverInterface;
    use Magento\Framework\App\RequestInterface;

    class AddToCart implements ObserverInterface
    {
        public function execute(\Magento\Framework\Event\Observer $observer) {

        }

    }

I think I should get cart and customer details in some way, then pass them to a view (E.g. Vendor/Module/view/frontend/templates/add_to_cart.pthml) and execute inside it my Javascript code. Am I wrong? How should I proceed?


texts:
I have magento multistore website where store_code is placed after domain name like these below :

http://example.com/code_first/
http://example.com/code_second/

so I want to rewrite store_code url only to be like this :

http://example.com/first/
http://example.com/second/

and I've tried add below code in root magento .htaccess file, but it's still not working :

SetEnvIf Request_URI ^\/first\/ MAGE_RUN_CODE=code_first
SetEnvIf Request_URI ^\/second\/ MAGE_RUN_CODE=code_second

is there any way to rewrite my store_code url ?


texts: Magento 2. how to hide price only for specific categories

texts:
Actually I hide the price using Plugin but now I want to hide price only for specific categories like I only want to hide the Price for bags. I want to do this thing by using Admin configuration like if I enable the extension then there is a option to select where I want to hide the price.

  di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">

        <type name="Magento\Catalog\Pricing\Render\FinalPriceBox">
            <plugin name="price_hide" type="PME\Hideprice\Plugin\Price"/>
        </type>

</config>

  helper\data.php

<?php
namespace PME\Hideprice\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\App\Http\Context;
use Magento\Customer\Model\Context as CustomerContext;

class Data extends AbstractHelper
{

    /**
     * Scope config
     *
     * @var ScopeConfigInterface
     */
    protected $scopeConfig;

    /**
     * HTTP Context
     * Customer session is not initialized yet
     *
     * @var Context
     */

    protected $context;

     /**
     * SalablePlugin constructor.
     *
     * @param ScopeConfigInterface $scopeConfig ScopeConfigInterface
     * @param Context              $context     Context
     */

    public function __construct(
        ScopeConfigInterface $scopeConfig,
        Context $context,
        \Magento\Framework\App\Helper\Context $helpercontext,
        \Magento\Customer\Model\Session $_customerSession
    ) {

        $this->_customerSession = $_customerSession;
        $this->scopeConfig = $scopeConfig;
        $this->context = $context;
        parent::__construct($helpercontext);
    }

    public function isCustomerLoggedIn() {

        return $this->context->getValue(CustomerContext::CONTEXT_AUTH);
        //to check login mean that to check that the customer is logged in or not
    }

    public function getIsEnable(){
        return $this->scopeConfig->getValue('pme_hideprice/general/enabled',
                                            \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }

    public function isEnabled($scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT)
    {
        return $this->scopeConfig->isSetFlag(
            'pme_hideprice/general/enabled',
            $scope
        );
    }
}

  Plugin\Price.php

<?php

namespace PME\Hideprice\Plugin;

use PME\Hideprice\Helper\Data as Helper;

    class Price
    {

        public function __construct (
            Helper $helper,
            array $data = []
        ) {
                $this->helper = $helper;
        }

        function afterToHtml(\Magento\Catalog\Pricing\Render\FinalPriceBox $subject, $result) {

            // echo $this->helper->isCustomerLoggedIn(); exit;
            if($this->helper->getIsEnable())
            {
                if(!$this->helper->isCustomerLoggedIn())
                {

                    return '';
                }
            }
            return $result;
        }

    }


texts:
After upgrading Magento 2 to version 2.2.3 the php bin/magento setup:upgrade stopped working and throws error Failure reason: 'Unable to unserialize value.' Things I have already triex to do...

1: Remove cache:

php rm -rf var/di/* var/generation/* var/cache/* var/page_cache/* var/view_preprocessed/* var/composer_home/cache/*

2: Grant Permissions:

find . -type f -exec chmod -c 644 {} \; && find . -type d -exec chmod -c 755 {} \;    ||||| Working

3: Deploy Static Content:

php bin/magento setup:static-content:deploy -f

4: Compile:

php bin/magento setup:di:compile

But none of the above worked. Any suggestions? Your help would be very much appreciated.


texts:
I am working with the Sass fallback structure and couldn't find any documentation on whether image folder fallbacks are also supported.  I have set up my dev site as follows with 2 custom packages and themes:

skin/frontend/custom_package1/custom_theme1
skin/frontend/custom_package2/custom_theme2

Here is the config.rb file for custom_package1/custom_theme1:

add_import_path "../../../rwd/default/scss"
http_path = "/skin/frontend/custom_package1/custom_theme1/"
css_dir = "../css"
sass_dir = "../scss"
images_dir = "../images"
javascripts_dir = "../js"
relative_assets = true
sourcemap = true

output_style = :expanded
environment = :development

Here is the config.rb file for custom_package2/custom_theme2:

add_import_path "../../../custom_package/custom_theme/scss"
http_path = "/skin/frontend/custom_package2/custom_theme2/"
css_dir = "../css"
sass_dir = "../scss"
images_dir = "../images"
javascripts_dir = "../js"
relative_assets = true
sourcemap = true

output_style = :expanded
environment = :development

The scss files are falling back correctly. If they are not found in custom_package2/custom_theme2.... it checks custom_package1/custom_theme1... if not there it checks rwd/default...

The images do not appear to be falling back.  I have the following file structure:

custom_package2/custom_theme2/images/ contains...
logo.gif

custom_package1/custom_theme1/images/ contains...
icon_sprite.png

When trying to load icon_sprite.png on the page I get a 404 error because it's looking for the image at custom_package2/custom_theme2/images/icon_sprite.png, which doesn't exist.

Questions:

Is image fallback supposed to work the same as scss fallback?
If so, how should I correctly set this up?

So far I've tried adding another import path to each config.rb:

custom_package2/custom_theme2/config.rb:

add_import_path "../../../custom_package1/custom_theme1/images"

custom_package1/custom_theme1/config.rb:

add_import_path "../../../rwd/default/images"


texts:
I am using Magento 2.3.0 and I want the Cart Order Summary always expanded.

All solutions I have found wont work.
Is there any workaround or has something changed in 2.3?


texts: How could I let a date attribute filter by year in layer navigation?

texts:
As the title describe, I want my product has a date attribute(ex. the date this product begin in stock).

And I can filter the products using this attribute's year. For example, if there are 2 products in 2013-09-08 & 2014-10-10, the filter will show two options 2013 and 2014.

Currently I think I can create another attribute to save the year data, but I'm not sure how to set this attribute not show when I create a new product and how do I write in the value when I save this product.

Is there any better solutions?


texts: MageReport scan status Unknown after applying patch SUPEE-5344 successfully

texts: I applied patch SUPEE-5344 successfully for my Magento 1.9.1.0 website. But when i go to MageReport and scan my site I still get status Unknown for Security patch 5344 (Shoplift)?


texts: Converting virtual products in Magento 2

texts: I'm working on a Magento 2 website for a friend and I've now realised that for the 500+ products he's manually added, they're simple products with virtual options? I told him to set the products up as configurable products so I'm not quite sure what's happened (see below image). Is there a way of converting all of these virtual products to a type that will allow for an address to be entered during checkout?


texts: Magento 2 - Where to put images to use in css

texts:
What is the best location to put the images that I use in my custom css file? And what is the best way to get to the image from the css file?

The location of my custom css is:
app/design/frontend/theme/themename/web/css

I have Magento in developer mode.

Magento does something when deploying the files and I don't know if the location of css and image will change...

Regards,
Robert


texts: Magento 2 installation problem in Ubuntu using composer

texts:
I am extremely new and undereducated with Ubuntu. I am trying to install Magento using composer and getting below error:

  Problem 1
    - Installation request for magento/product-community-edition 2.3.0 -> satisfiable by magento/product-community-edition[2.3.0].
    - magento/product-community-edition 2.3.0 requires ext-curl * -> the requested PHP extension curl is missing from your system.
  Problem 2
    - Installation request for magento/magento2-functional-testing-framework 2.3.9 -> satisfiable by magento/magento2-functional-testing-framework[2.3.9].
    - phpunit/phpunit 6.5.0 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.1 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.10 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.11 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.12 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.13 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.14 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.2 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.3 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.4 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.5 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.6 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.7 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.8 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - phpunit/phpunit 6.5.9 requires sebastian/diff ^2.0 -> satisfiable by sebastian/diff[2.0.1].
    - Conclusion: don't install sebastian/diff 2.0.1
    - Installation request for phpunit/phpunit ~6.5.0 -> satisfiable by phpunit/phpunit[6.5.0, 6.5.1, 6.5.10, 6.5.11, 6.5.12, 6.5.13, 6.5.14, 6.5.2, 6.5.3, 6.5.4, 6.5.5, 6.5.6, 6.5.7, 6.5.8, 6.5.9].

I have solved the first problem related to curl extension. However, problem 2 has me stumped.
No idea where to go from here. Any help will be appreciated.


texts: How to change my url from www.xxx.com/Magento to www.xxx.com

texts:
I am running Magento 2.2.7 and my current URL for my store is https://shop.xyz.ca/Magneto and I would like to change it to be https://shop.xyz.ca/

I am set up on Windows Server and using Xampp 3.2.2

I don't recall where the URLs are set (not talking about Magento Admin and base URLs etc) but I assume it is within the Apache portion of Xampp. but I can't figure out where. Any help would be most appreciated as the Magento learning curve is... wow

Cheers


texts:
I am trying to set up an attribute for EOL (end of life) products. The idea is to leave these products on site, but now buying option would be available for them, and also they shouldn't appear on category listing pages and in the datafeeds.

I set up a boolean attribute for this and already did the product page, but I can't figure out how to filter out these products from the category listing. In list.phtml I see that the $_productCollection already contains all products, how can I filter out the products with the eol attribute set to yes?


texts: Magento no emails send from magento fresh installation

texts:
I am using magento 1.9.2 It not sending order and other emails from the system. I setup in the following way,

Admin -> System -> Configuration -> Advanced -> System

Admin -> System -> Configuration -> Sales -> Sales Emails

Like the same way same settings for all sales emails.

After this I set a cron job on my cpanel to send every 5 mints.

Cpanel Cron Job

These settings all done. But no emails send. Do I need any other settings ? How can I send emails ?


texts: Magento 2 Payment method for certain Customer groups

texts:
Is it possible to choose payment method to certain customer groups?
In Magento 1 there are some codes to add payment modules, like that any ways in Magento 2 ? without using plugins?


texts:
How to store Image Path In Database and retrieve from frontend

public function fanbookAction(){
        $img = ''.$this->getRequest()->getPost('img');
                if(isset($_FILES['img']['name']))
                {
                    try{
                        $uploader = new Varien_File_Uploader('img');
                        $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png')); // Your Format Here
                        $uploader->setAllowRenameFiles(true);
                        $uploader->setFilesDispersion(false);
                        $path = Mage::getBaseDir('media').DS.'FanBook'.DS;
                        $uploader->save($path, $_FILES['img']['name']);
                        $img =$path. $_FILES['img']['name'];

                        $collection = Mage::getModel('fanbook/fanbook');
                        $collection ->setData('img',$img);
                        $collection->save();
                         $this->_redirectReferer();
                    Mage::getSingleton('core/session')->addSuccess('Done');
                    }

                    catch(Exception $e) {

                    }

                }
    }

Form.phtml

<form id="Fanbook" action="<?php echo Mage::getUrl('fanbook/index/fanbook') ?>" method="post"
      enctype="multipart/form-data">
      <input type="hidden" value="AQGISNWgIVMWTUnC" name="form_key">

        <input id="img" type="file" name="img">
            <input id="button" type="submit" value="Upload me!" name="submit">
    </form>


texts: How to override an admin theme template?

texts:
I would like to override app/design/adminhtml/default/default/template/page.phtml

i'm currently using an extension that overrides app/design/adminhtml/default/default/template/page/header.phtml
with a file in app/design/adminhtml/default/default/template/extname/page/header.phtml

i have recently made changes to the page.phtml file, but i would like to override it in the right way, but i'm not sure how. i was going through the codes to see how the extension developers override header.phtml but i cant figure it out.

can anyone tell me how to override this specific file?


texts: how to send payment success email after braintree payment gateway return success?

texts:
how to send payment success email when braintree payment gateway return success?
I know this is a bit odd, but my magento is missing order number even the payment was success.
Any suggestion to get alert email or notice by another way?
Thanks


texts: Recently Viewed Products Items not updating for logged user

texts:
I have issues for logged in user only, if not logged in then updating properly.

My code on: Magento_Theme\layout\default.xml

<referenceContainer name="page.bottom.container">
            <block class="Magento\Reports\Block\Product\Widget\Viewed" after="-" name="recently_viewed" cacheable="false" template="Magento_Reports::widget/viewed/content/viewed_grid.phtml" />
        </referenceContainer>

Please help me


texts: Magneto 2 Share a catalog to our privileged customers

texts:
I need to share magento2 products with some of our valued customers first rather than publishing them online.

They will purchase items if they want but in magento2 how can we generate a special URL for the selected products and how can we show products without enabling them online.


texts: Set shipping price to zero based on condition in magento 2

texts: I want to make shipping free of cost if a user shops over a certain amount. My question is how to disable or set shipping price to zero when condition is fulfilled?


texts: Change css and html of address within book.phtml

texts:
I want to change how the address within book.phtml is displayed on frontend. In detail it is this part of code:

<?php echo $this->__('Default Billing Address') ?>

 <address>
   <?php echo $this->getPrimaryBillingAddressHtml() ?>
 </address>

source code shows this:

<address>
   John Doe

   Company

   Street Address

   State, Province Zip Code

   Country

   T: 59874953847983

</address>

I would like to have something like this:

<address>

   John Doe

   Company

   Street Address

   State, Province Zip Code

   Country

   T: 59874953847983

</address>

In which file can I change that?


texts: Magento - Determine what pages is available to handle

texts:
how can i determine what pages is available to handle in magento layout files? after default handle (which shows up on almost every page) there're few handles for example :

<checkout_cart_index translate="label">
........
</checkout_cart_index>

which goes to the checkout cart page.

while the file in app/design/frontend/mypackage/mytheme/template/ contains .phtml for function in each block, how can i know where is the list of php page for the website?

from what i studied at magento Designer guide PDF i only knows that handle itself shows what pages it should show the module inside, which is there's default, or other specific pages we want to show, but i can't understand how can i get the list of pages and what is the tag ex : **

For instance, <catalog_product_view> contains the layout updates for
 the Product View page, while <catalog_product_compare_index> contains
those for the Compare Product page.

this is taken from the pdf itself which is the tag is not the same as the page name also. i'm getting a bit confused here, i have read all of the pdf about the block, the attributes of the block, customizing template module etc and this is the only thing i haven't understand.


texts: How to get first product from category in 1column.phtml?

texts:
I'm searching for a way to get the main image from the first (or random) product from the current category and use it as a background for the category title.

As the title is created in 1column.phtml (or 2columns-left.phtml, 2columns-right.phtml, 3columns.phtml), the code should work there. I've tried all different solutions from this post, but it just gives me errors.

According to the code in 1column.phtml I've tried to get something like this as a first step inside :

...

<?php if (Mage::app()->getFrontController()->getRequest()->getControllerName() == 'category') : ?>

<?php echo $_category->name ?>

<?php echo $_category->getProductCollection()->getFirstItem()->getName(); ?>
<?php endif; ?>

This was an attempt that doesn't give back errors, but has no output at all. I'm pretty sure there is a was, but I'm clueless how to call anything useful within 1column.phtml.


texts: I want to show a button on frontend that is only visible to admins and NOT customers. Is there some way? I've tried getting adminId on frontend but seems like it's not possible as backend and frontend work separately in magento.


texts:
Google has indexed two versions of site's homepage like below. Is there any URL rewrites requires to be added to fix this? Appreciate assistance.

www.abc.com
www.abc.com/home


texts: Slow transaction on /customer/section/load Magento v2.2.5 CE

texts:
I was recently seeing slow response times on our Magento 2.2.5 CE installation, so we installed NewRelic to monitor some site metrics. One thing that instantly stood out to me was the /customer/session/load. It was the the most time-consuming transaction by a huge margin. Under high load it was not unusal to see transactions above 100 second response times (the response times vary from 10-30 seconds under normal load). I opened up all of the traces for this route and they all seemed to hang on Magento\Framework\Session\SaveHandler\Native::read.

I wen around our site and noticed that some pages(category and product) are making 6 called to /customer/section/load. Some of these are from base magento and others are from google tag manager (we are using the magento2-googletagmanager2 module).

Here's what I tried:

First I tried disabling the google tag module
I changed the session storage to Memcache(we were previously on file storage)
I changed the session storage to Redis
I also verified on a bare Magento v2.2.5 installation that the base magento calls to /customer/section/load are happening. But even on that installation some of the requests took 1-1.5 seconds. (Although this is subjective because I was using a MAMP server locally)

Specifications

Server specs: We use a hosting service and we have a 32-core server with 128gb of ram and are not experiencing any memory/cpu load issues. We are also using Mysql on the same server and our DB size is around 3.3gb

Magento Specs: We have a Magento v2.2.5 CE installation with around 80,000 Sku's

Additional Info: We are using Varnish and CDN (cloudfront)

Questions:

Is this normal for the customer/section/load to be the most time-consuming transaction?
Is Magento doing something with the session that is causing a lock? The Redis session storage solution should've eliminated a php lock because it doesn't use a session lock. (unless magento is doing something weird that I have not accounted for)

Additional Diagnostic Information:

command: cat my.cnf
link: my.cnf

command: df -h
link: df -h

command: iostat -xm 5 3
link: iostat -xm 5 3

command: ulimit -a
link: ulimit -a

command: top
link: top

command: show global variables
link: show global variables

command: show global status
link: show global status

Any advice would be greatly appreciated, also if you need me to add more information or clarification please let me know.


texts: After migrating magento 1 to magento2 when try to reindex, i got an error

texts:
Customer Grid indexer process unknown error:

  SQLSTATE[42000]: Syntax error or access violation: 1170 BLOB/TEXT column 'created_in' used in key specification without a key length, query was: CREATE TABLE IF NOT EXISTS customer_grid_flat (
    entity_id int UNSIGNED NOT NULL COMMENT 'Entity ID' ,
    name text NULL COMMENT 'Name' ,
    email varchar(255) NULL COMMENT 'Email' ,
    group_id int NULL COMMENT 'Group_id' ,
    created_at timestamp NULL default NULL COMMENT 'Created_at' ,
    website_id int NULL COMMENT 'Website_id' ,
    confirmation varchar(255) NULL COMMENT 'Confirmation' ,
    created_in text NULL COMMENT 'Created_in' ,
    dob date NULL COMMENT 'Dob' ,
    gender int NULL COMMENT 'Gender' ,
    taxvat varchar(255) NULL COMMENT 'Taxvat' ,
    lock_expires timestamp NULL default NULL COMMENT 'Lock_expires' ,
    shipping_full text NULL COMMENT 'Shipping_full' ,
    billing_full text NULL COMMENT 'Billing_full' ,
    billing_firstname varchar(255) NULL COMMENT 'Billing_firstname' ,
    billing_lastname varchar(255) NULL COMMENT 'Billing_lastname' ,
    billing_telephone varchar(255) NULL COMMENT 'Billing_telephone' ,
    billing_postcode varchar(255) NULL COMMENT 'Billing_postcode' ,
    billing_country_id varchar(255) NULL COMMENT 'Billing_country_id' ,
    billing_region varchar(255) NULL COMMENT 'Billing_region' ,
    billing_street text NULL COMMENT 'Billing_street' ,
    billing_city varchar(255) NULL COMMENT 'Billing_city' ,
    billing_fax varchar(255) NULL COMMENT 'Billing_fax' ,
    billing_vat_id varchar(255) NULL COMMENT 'Billing_vat_id' ,
    billing_company varchar(255) NULL COMMENT 'Billing_company' ,
    PRIMARY KEY (entity_id),
    INDEX CUSTOMER_GRID_FLAT_GROUP_ID (group_id),
    INDEX CUSTOMER_GRID_FLAT_CREATED_AT (created_at),
    INDEX CUSTOMER_GRID_FLAT_WEBSITE_ID (website_id),
    INDEX CUSTOMER_GRID_FLAT_CONFIRMATION (confirmation),
    INDEX CUSTOMER_GRID_FLAT_CREATED_IN (created_in),
    INDEX CUSTOMER_GRID_FLAT_DOB (dob),
    INDEX CUSTOMER_GRID_FLAT_GENDER (gender),
    INDEX CUSTOMER_GRID_FLAT_LOCK_EXPIRES (lock_expires),
    INDEX CUSTOMER_GRID_FLAT_BILLING_COUNTRY_ID (billing_country_id),
    FULLTEXT FTI_76EE125693165A11F2D49A0116049156 (name, email, taxvat, shipping_full, billing_full, billing_firstname, billing_lastname, billing_telephone, billing_postcode, billing_region, billing_city, billing_fax, billing_vat_id, billing_company)
  ) COMMENT='customer_grid_flat' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci


texts: Excluding category by entity_id from the collection of categories

texts:
I need to exclude a single category from a collection of categories. The code I use to get the collection:

$layer = Mage::getSingleton('catalog/layer');
$_category = $layer->getCurrentCategory();
$_parent_category = $_category->parent_category;
$_grandparent_cat = $_parent_category->getParentCategory();
$eid = $_parent_category->entity_id;

and now the code I use to filter the categories

$_new_categories = $_grandparent_cat
    ->getChildrenCategories()
    ->addAttributeToSelect("*")
    ->addAttributeToFilter('entity_id', array('neq'=>$eid));

This should take all child categories of the grandpared_cat and return them, excluding the current cat(the one
with $eid) but it returns all subcategories.
How can I solve this? Thanks :)!


texts: Cart getting empty in Magento2 or Magento2.0.8 cart persistence issue

texts:
In Magento 2.0.8
in cart page if you click more than once Processed Checkout button cart getting empty
but it will not  reproduce 2.1.0 and above


texts:
Is there a way to map the categories?
My wholesale uses another categories that i wanna use.

So on every import i need to change all the categories to my categories

Is there a way to automate this working flow?


texts: Display parent categories on left side bar

texts:
Suppose below is my hierarchy :

Default Category
    Women  (30)
    Men  (50)
    Accessories (25)

Now I want to display women,men and Accessories category in left navigation menu.These categories has not any child categories,just have products.


texts: SKU non-Default label is not reflected on the frontend in Magento 2

texts:
I am trying to change the SKU attribute label from "SKU" to "Item" on the Product Page on the storefront by adding a label to the attribute in Admin Panel by going to

  Stores > Attributes > Product

selecting "SKU" attribute in the grid and adding a label under

  Manage Labels > Default Store View

column.

It seems that the attribute label for SKU which is displayed on the Product Page on the storefront will only change if I modify the Default Label in Admin Panel.

All other attributes are properly reflected on the storefront (e.g. color, size, etc).

During my investigation, I have found out that the template responsible for rendering the SKU is module-catalog/view/frontend/templates/product/view/attribute.phtml. However, the attribute label is not translatable therefore I cannot use translations files to change the attribute label. On the other side, I understand why the attributes displayed via above template are not translatable as - I think - the attributes labels should be changed from the Admin Panel via Manage Labels facility as described above.

Is this a bug?


texts: Why static files are not generated or cached in Default or Production mode in Magento 2?

texts:
As mentioned in this link: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-static-view.html

  Static view files deployment is affected by Magento modes as follows:

  Developer mode: Magento generates them on demand, but the rest are
  cached in a file for speed of access.

  Default and production modes:
  Static files are not generated or cached.

  You must write static view files to the Magento file system manually
  using the command discussed in this topic; after that, you can
  restrict permissions to limit your vulnerabilities and to prevent
  accidental or malicious overwriting of files.

Just wanted to know, why static files are not generated or cached in production mode or default mode as this mode suppose to work faster and do more caching ? Not generating  static files in these modes seems reasonable but I have confusion about why no cache is going to generated in these modes?


texts: Magento2 - Additional_option not coming in Order REST api

texts:
I am creating additional_option so that i can add option in cart and order detail and it is working fine in both way but problem is that when i try to fetch order data using REST api it is not getting that additional_option. Following is working code for adding option:

Step1: Add option in cart

event.xml

 <event name="checkout_cart_product_add_after">
  <observer name="bhupendra_custommodule_observer_process_custommodule" instance="Bhupendra\Custommodule\Model\ProcessOptions"/>
 </event>

ProcessOptions.php(model)

public function execute(Observer $observer)
    {

        /* @var Magento\Quote\Model\Quote\Item $item */
        $item = $observer->getQuoteItem();
        $postdata = $this->_request->getPost();
        $additionalOptions = array();
        $product = $this->_productModel->load($postdata['product']);
        if ($additionalOption = $item->getOptionByCode('additional_options')){
            $additionalOptions = (array) unserialize($additionalOption->getValue());
        }

        $content= $postdata['product_information'];
        if(isset($content)  && $content!='' )
        {

                $additionalOptions[] = [
                    'label' => 'Custom Information',
                    'value' => $content
                ];

        }
        if(count($additionalOptions) > 0)
        {
            $item->addOption(array(
                'code' => 'additional_options',
                'value' => serialize($additionalOptions)
            ));
        }
    }

Step2: convert quote to order

di.xml

 <type name="Magento\Quote\Model\Quote\Item\ToOrderItem">
  <plugin name="bhupendra_custommodule_Sales_Quote_Item_ToOrderItem" type="Bhupendra\Custommodule\Plugin\QuoteItemToOrderItemPlugin" />
 </type>

plugin/QuoteItemToOrderItemPlugin.php

<?php

namespace Bhupendra\Custommodule\Plugin;

class QuoteItemToOrderItemPlugin
{

    public function aroundConvert(\Magento\Quote\Model\Quote\Item\ToOrderItem $subject, callable $proceed, $quoteItem, $data)
    {

        // get order item
        $orderItem = $proceed($quoteItem, $data);

        if(!$orderItem->getParentItemId() && $orderItem->getProductType() == \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE){
            if ($additionalOptionsQuote = $quoteItem->getOptionByCode('additional_options')) {
                //To do
                // - check to make sure element are not added twice
                // - $additionalOptionsQuote - may not be an array
                if($additionalOptionsOrder = $orderItem->getProductOptionByCode('additional_options')){
                    $additionalOptions = array_merge($additionalOptionsQuote, $additionalOptionsOrder);
                }
                else{
                    $additionalOptions = $additionalOptionsQuote;
                }
                if(count($additionalOptions) > 0){
                    $options = $orderItem->getProductOptions();
                    $options['additional_options'] = unserialize($additionalOptions->getValue());
                    $orderItem->setProductOptions($options);
                }
            }
        }

        return $orderItem;
    }
}

Make REST API order call
http://localhost/magento2test/rest/V1/orders/5

All data coming only additional_options are not there in that data. Any help into this ?


texts: How can I redirect a category page to CMS Page using url rewrite system in magento 2.


texts: Change layout for specific category (productpage)

texts:
I got a specific category and I want to change the layout for all the products the category contain.

If I want to change the layout(productpage) for all categories I need to edit the file app\design\frontend\rwd\default\template\catalog\product\view.phtml.
But I just want to edit the layout for one category( the productpage layout)

I saw something with CategoryID but I don't really get it. Hope you can help me!


texts: Magento 2.3.2 Megamenu error Declaration _getHtml

texts:
Megamenu error After Upgrade Magento 2.3.2

Fatal error: Uncaught TypeError: Argument 4 passed to Ibnab\MegaMenu\Block\Html\Topmega::_getHtml() must be of the type array, null given

app\code\Ibnab\MegaMenu\Block\Html\Topmega.php on line 169
Ibnab\MegaMenu\Block\Html\Topmega->_getHtml(Object(Magento\Framework\Data\Tree\Node), 'submenu', 0, NULL)
Ibnab\MegaMenu\Block\Html\Topmega->_addSubMenu2(Object(Magento\Framework\Data\Tree\Node), 0, 'submenu', 0)
Ibnab\MegaMenu\Block\Html\Topmega->_getHtml2(Object(Magento\Framework\Data\Tree\Node), 'submenu', 0)


texts: Changing the path of the "addItem" layout action

texts:
I am using the following code in the Layout Update XML section of a CMS page:

<reference name="head">
    <action method="addItem">
        <type>skin_css</type>
        <name>css/specific_page_style.css</name>
    </action>
</reference>

The path being referred to on the page is: http://www.sample.org/skin/frontend/base/default/css/specific_page_style.css

Since the rest of my skin files are in /skin/frontend/enterprise/sampleorg/*, I would like addItem to be able to point to the CSS directory that resides there. Is it possible to do this with the skin_css type, or do I have to use a different type and place the full path in the name?

Additionally, am I approaching this in the right way, and how would I have figured this out for myself? I could not find the addItem definition in any official docs.

Edit: In System > Configuration > Design, the following fields are set:

Current Package Name: enterprise
Templates: sampleorg
Skin (Images / CSS): sampleorg

There are no package or theme exceptions set.


texts: Error after deleting all cache in Magento 2

texts:
On deleting all cache as

rm -rf var/cache/* var/page_cache/* var/view_preprocessed/* var/generation/*

I got below error

Warning: ltrim() expects parameter 1 to be string, object given in vendor\magento\framework\Code\Generator\EntityAbstract.php on line 152

Notice: Uninitialized string offset: 0 in vendor\magento\framework\Autoload\ClassLoaderWrapper.php on line 81

Notice: Uninitialized string offset: 0 in vendor\composer\ClassLoader.php on line 317

Notice: Uninitialized string offset: 0 in vendor\composer\ClassLoader.php on line 349
exception 'RuntimeException' with message 'Source class "" for   "Magento\Framework\App\Response\Http\Interceptor" generation does not exist.'
in vendor\magento\framework\Code\Generator.php:185 Stack trace:     #0
vendor\magento\framework\Code\Generator.php(112): Magento\Framework\Code\Generator->tryToLoadSourceClass('Magento\\Framewo...', Object(Magento\Framework\Interception\Code\Generator\Interceptor)) #1
vendor\magento\framework\Code\Generator\Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\\Framewo...') #2 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\\Framewo...') #3
vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(93): spl_autoload_call('Magento\\Framewo...') #4
vendor\magento\framework\ObjectManager\Factory\Compiled.php(88): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array) #5
vendor\magento\framework\ObjectManager\Factory\Compiled.php(130): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Framewo...') #6
vendor\magento\framework\ObjectManager\Factory\Compiled.php(67): Magento\Framework\ObjectManager\Factory\Compiled->get('Magento\\Framewo...') #7
vendor\magento\framework\ObjectManager\ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Framewo...', Array) #8
vendor\magento\framework\App\Bootstrap.php(233): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array) #9
index.php(38): Magento\Framework\App\Bootstrap->createApplication('Magento\\Framewo...') #10 {main}

What are the reasons behind this issue?

Can you suggest me the possible solutions for this issue?


texts: Magento Admin - Compare products on-screen or via export (using diff)

texts:
I've taken over the admin of an established magento site, however, I have little magento experience, so I'm hoping this is an easy task!

Is there a way of comparing all of the settings for 2 products? On-screen report or exporting product data to CSV (that I can diff) would be great.

By settings of a product I mean values from each of the left side tabs 1.

Currently we have to manually click on each tab to compare the values, which is very slow!


texts: Change Text in multilingual Magento 1 Store

texts:
How can I change footer links after language shifting in a multilingual Magento 1 Store ?

I am trying to follow this links

https://support.weltpixel.com/hc/en-us/articles/115001957893-How-to-translate-footer-content-different-language-storeview


texts: Does Magento 2's UpgradeSchema Pattern Handle non-contiguous Version Jumps

texts:
Magento 2 replaced Magento 1's Setup Upgrade scripts with a bin/magento setup:upgrade command.

When a module's installed, this command looks for a InstallSchema and InstallData class in a module's Setup folder, and runs both class's install method.

When a module is upgraded, this command looks for an UpgradeSchema and UpgradeData class in a module's Setup folder, and runs these class's upgrade method.  Unlike Magento 1, there is no longer any built-in logic to run through a set of scripts named with version numbers.

The pattern used by Magento 2's core in Upgrade scripts looks like this

public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
    $installer = $setup;
    $connection = $installer->getConnection();
    if (version_compare($context->getVersion(), '2.0.1') < 0) {
        //... upgrade scripts here ...
    }

    if (version_compare($context->getVersion(), '2.0.2') < 0) {
        //... upgrade scripts here ...
    }

    if (version_compare($context->getVersion(), '2.0.3') < 0) {
        //... upgrade scripts here ...
    }

    if (version_compare($context->getVersion(), '2.0.4') < 0) {
        //... upgrade scripts here ...
    }
}

i.e. The Upgrade classes need to include programatic logic for version checks.

Looking over how Magento's coded these in the core though -- it's not clear how this system works.  Is $context->getVersion() the version of am module the user is upgrading from?  Or to?  If you're jumping module versions (from say, 2.0.2 to 2.0.5) does setup:upgrade call this upgrade once, or does it run through the scripts multiple times (one for the 2.0.3 upgrade, again for 2.0.4 upgrade, and again for 2.0.5 ?

This doesn't (seem to be) documented on the dev docs site -- and setup code is pretty tricky to test by trial and error. Does anyone know how these work, and if Magento's implementation is "non-contiguous version upgrade" safe?  If you're tempted to answer of course to the later without testing -- welcome newcomer!


texts: Magento 1.9.3 Order delivery address change history?

texts: When I have edited the delivery address for an order. Can I see what was the delivery address before I made the change again?


texts: How to remove a product from cart using module?

texts:
How to remove/disable an item from the cart using a module?
I want to remove an item from the cart from my module with some conditions.


texts:
Started off building my first module in M2. I'm trying to write a test to prove whether an admin role has the correct resource for the module im building and if not check that the correct return status is received.

First question is - should I actually be testing this? It seemed like a pretty good test in terms of functionality being correct, but then i was thinking that Magento have probably already covered the testing of ACL.

Secondly here is where im at, but don't seem to be having much luck mainly due to not getting my head around fixtures I think:

The test:

    /**
     *
     * @magentoAppArea adminhtml
     * @magentoDataFixture Magento/User/_files/user_with_role.php
     * @magentoDataFixture loadFixture
     */

    public function testLockedAdminHasNoAccessToRoute()
    {
        /** @var User $role */
        $user = $this->objectManager->create(User::class);
        $adminUser = $user->loadByUsername('adminUser');
        /** @var Session $adminSession */
        $adminSession = $this->objectManager->create(Session::class);
        $adminSession->start();
        $adminSession->setUser($adminUser);
        $adminSession->processLogin();
        $loggedInUser = $adminSession->getUser();

        $this->assertFalse($adminSession->isAllowed('Vendor_Module::manage'));
    }

And I am using the magento user_with_role.php fixture to create an admin user, and then using a custom fixture i've written to create a role without access to my modules resource:

<?php
/** @var \Magento\Authorization\Model\Role $model */
$model = Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Authorization\Model\Role');
$model->setName('No Access')
    ->setPid(0)
    ->setRoleType(\Magento\Authorization\Model\Acl\Role\Group::ROLE_TYPE)
    ->setUserType(\Magento\Authorization\Model\UserContextInterface::USER_TYPE_ADMIN)
    ->setUserId(3);
$model->save();

$resource=[
    'Magento_backend::admin',
    'Magento_Sales::sales',
    'Magento_Sales::create',
    'Magento_Sales::actions_view',
    'Magento_Sales::cancel'
];

$rules = Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Authorization\Model\Rules');
$rules
    ->setRoleId($model->getId())
    ->setResources($resource)
    ->saveRel();

The test is pretty self explanatory and all seems to work except the fact that the test always fails as it thinks the user has got access to my resource even though i've assigned the user to my custom role without it.

I think i'm getting confused :(

Any help much appreciated.


texts: Magento 2 - How to sell items separately or as a set?

texts:
We currently have a lot of items that we sell either as a full set or as individual items.

For example say we have a product - Green Marbles. The individual sizes are small,med,large. Or a full set includes 1xLarge, 2xMed, 4xSmall.

Ideally what I would like is to have a single product page that offers:

Customer can edit Qty's for all individual items

Customer Can select - Full Set.

i.e.

Large............qty ?

Med..............qty ?

Small............qty ?

Full Set.........qty ?

I could set up Full Set as a simple product but that means stock qtys would be a nightmare. Is there a way to set this up in Magento 2?


texts: Magento 2: UI Component - Disable Fieldset with condition?

texts: I try it but not working. everyone can help me plz!


texts: Magento Displaying appropriate localisation based on Location

texts:
I'd like to configure the Magento site to be able to recognize the default language and location of the user and display the site in that language and with appropriate localization.

For example:

A user from Russia with the Russian language as default will go directly to the Russian Language website with Rubles as the default currency and prices.

Is this possible?  If so how?


texts: Card payments - order confirmed but no payment taken

texts:
To Be Exact

The problem is intermitant and does not happen with the majority of card payments but too frequent to be ignored.

Customer goes through checkout and sees the order sucessful page and also receives a confirmation email.

On the back end the payment appears as Pending.......there is no money taken.

We rang our merchant services several times who have checked and say there was absolutely no visit to the payment pages and so the problem must lie in the magento configuration.

As said, majority of card payments are fine and those that say pending with no money taken have nothing in common. We are having to ring customers who have their payment marked as pending and on questioning nothing seems to be going wrong for them through the checkout process.

Anyone have any ideas at all for me to be able to sort this?

Thanks in advance


texts: Cron Job status always missed/ not running Magento 2

texts: So I have a magento 2 instance running on ubuntu and I have some confusion about cron jobs. I know that magento 2 needs to have scheduled jobs in order to work correctly, but I am unable to find out how to get it set up correctly. I have read the dev docs, and followed this article. Currently, I'm not getting any errors I can see on the magento side, but I'm having issues with things changing correctly (i.e. changing menu options/product options). I have also changed the Missed if Not Run Within field to be longer than the jobs per this The cron_schedule table has all statuses as missed. I am not trying to do any custom jobs, just whatever default ones it needs to operate.


texts:
Is there a way to link/redirect a product page to a category?

Scenario: I have 70-80 new products that all go into the same category. I can either chose to put one of the products in the "News" category, which will - of course - only show the customer that one product. Or, I can add all the products to the "News"-category, which will most likely make the customer bored before looking thru the entire list.

So, I'd like to create a product that says "Lots of new items from this-and-that manufacturer" and then have that product redirect/link to the category instead of a product page.

Have tried doing it with URL rewrites, but can't really get it working like I'd like it to. At all.

Am I missing something obvious, or is there no straight forward solution to this?

Edit: Magento 2.3.2


texts:
I know most of been gone through the Magento 2's ui_component.

I would like to know that If i add new field in existing ui_component of core code,

  Do i need to write my custom code to save my field's value to db ?

Any one has idea about it ??

Thanks.


texts: Magento 2 When Install Extension From Web Setup Wizard Then Always Check Component Dependency Failed

texts:
I am try to install extension from web setup wizard then always or any extension try to install but give error "Error! You need to resolve these issues to continue." and Check Component Dependency fails.

Please give me help
here is screenshot


texts: Is there any possibilities for 0 quantity place order?

texts: Magento automatically assumes the cart quantity to 1 while the quantity in product is 0 (It's correct way and still a good one), I would like to know the possibilities to send the 0 qty to cart and checkout. let me know which function handle this.


texts:
Example.com/customer/account/login/

This page contains three Templates

Sociallogin.phtml
Login.phtml
Newcustomer.phtml

I know where these files are located.But i don't know where these files are combined and how these files are shown in a single page.I want to change position of social login buttons into login box.


texts:
I have been facing this issue since ui upgraded my magento site form 2.0.7 to 2.1.5.
When trying to run magento setup:upgarde command to install extension it gives uncaught error class magento/indexer/model/config/reader in abstractFactory.php

Php version i am currently using is 7.0.17 . I have tried using di:compile also but of no use.

If some one can give a solution it will be of great help.

Thanks


texts: error : add foreign keys in UpgradeSchema

texts:
I am trying to give foreign keys in Upgrade Schema but it is still not working

class UpgradeSchema implements UpgradeSchemaInterface
{
    public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        if (version_compare($context->getVersion(), '1.0.2', '<'))
        {
            $setup->getConnection()->modifyColumn(
                $setup->getTable('faq_data'),
                'cat_id',
                ['type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, 'nullable' => false]);

            $setup->getConnection()->addForeignKey(
                $setup->getFkName('faq_data', 'cat_id', $setup->getTable('faq_cat_data'), 'cat_id'),
                $setup->getTable('faq_data'),
                'cat_id',
                $setup->getTable('faq_cat_data'),
                'cat_id',
                \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE);
        }
        $setup->endSetup();
    }
}


texts: Is it possible to remove elements in a page layout in Magento2?

texts:
When I read the documentation on page-layouts (http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/layout-types.html#layout-types-page) I see that the following instructions in this XML document are allowed:

<container>
<referenceContainer>
<move>
<update>

Since <referenceBlock name="block.name" remove="true" /> isn't one of the allowed instructions how can I remove a certain element in a specific page layout?

What I want for the top-categories is a whole other page design. I don't need certain containers and blocks for this design. For these categories I only want to show child categories and not the products.

The thing I've done now is, added the following lines in my page layout:
(in design\frontend\Vendor\Name-of-theme\Magento_Theme\page_layout\catalog-blocks.xml)

<move element="category.image" destination="delete"></move>
<move element="category.description" destination="delete"></move>
<move element="category.products" destination="delete"></move>
<move element="page.main.title" destination="delete"></move>

In the design\frontend\Vendor\Name-of-theme\Magento_Theme\layouts.xml I addded:

<layout id="catalog-blocks">
    <label translate="true">Catalog Blocks</label>
</layout>

I gave all the top-categories this catalog-blocks page layout in the admin.

Then in the main layout (design\frontend\Vendor\Name-of-theme\Magento_Theme\layout\default.xml) I added:

<referenceBlock name="delete" remove="true" />

So the whole delete block will be deleted, with all the things I moved here, in the page layout. This works well! It achieves exactly what I want but the whole thing seems to me a little hackish.

Is this considered being a good practice? If not, what would be a good alternative?

Edit 1: Changed the remove-tag in my question with the right one to avoid confusion.

Edit 2: Some more information about the files and file-locations.


texts: Table customer_grid_flat delted after reindex magento

texts:
I have my project in amazon server. when I run indexer_reindex the table customer_grid_flat is deleted and I get an error as below

  Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid
  attribute name: path


texts: Store code in URL for every store view except for default

texts:
I've enabled System > Config > Web > Add Store Code to URLs and I've setup a new Store View for Canada (/ca/).

I'd like to ideally have example.com/ca/ load the Canada Store View, but still have example.com (without the default store code in there) for the default store.

I've noticed that the home page works just fine in this regard, but when I go into a product page, Magento automatically includes the store code in the URL.

The main reason that I'm hesitant to change our current URLs for our default store is just because I'd hate to see them lose any link juice.  I know that theoretically as long as I setup 301 redirects, I should be fine, but I think I've read somewhere that a small amount of juice is still lost.

Also, I think this is probably somewhat better from a usability perspective.  If the bulk of your traffic is to your default store, and your customers are used to the regular URL, why bother them with the additional /default/ (or /us/ or whatever) in the URL.

I've tried disabling Add Store Code to URLs and simply changing the Base URL for my Canada Store View to example.com/ca/, but that didn't seem to do anything.  I'm assuming it needs the setting enabled in order to pick up the store code in the URL and do anything at all with it.


texts: Unset custom data from product attribute

texts:
I am trying to update a product with some custom attributes. I need to unset data that is being passed to set the value to none. I am currently on Magento 2.1

...
 $updatedProduct->unsetData($customAttributeA);
 $updatedProduct->save();

I added a break-point after unset the data, customAttributeA row is indeed gone from the product data array. However, after calling the save function, customAttributeA comes back into the array, with the value previously set.

Is there a way to persist the unsetData during the save function? I have also tried

$product->setData($customAttributeA , "");
And
$product->setCustomAttribute($customAttributeA , "");

However, none of them seems to work.

  The attribute type i am trying to unset is a dropdown type.

Cheers

  edit- this is a snapshot of the code i am using to set/unset the data

 foreach ($listTypes as $key => $value) {
    if (isset($params[$value])){
       if(isset($params[$value . '_mid'])) {
           $product->setCustomAttribute($value, $params[$value.'_mid']);
       }else{
           // unset data here
       }
    }
 }

 $product->save();


texts: Hide grouped/configured product with zero visible sub-products

texts:
I have a site running Magento EE 2.2.2 and I have lots of Grouped and Configured Products. I turned off "Display Out of Stock Products". As expected, when a sub-product is out of stock, it is not displayed.

However, when all the sub-products of a given grouped-product are out of stock, it still displays the parent grouped product with no sub-products listed.

How do I hide grouped or configured products whose sub-products are all out of stock?


texts: What is the difference between Mage:getModel and Mage:getModelInstance?

texts:
I am using almost all time Mage:getModel. But surprisingly i found somewhere about Mage:getModelInstance.

Can you please tell me where to use Mage:getModelInstance and what is the difference between these two ?


texts: Magento 1.9.01 update to 1.9.1.0 results in ''There has been an error processing your request'' LOG FILES uploaded

texts:
Ok, so let me explain the complete story:
I have a VPS with a magento webshop installed, the Magento shop is being maintained by Installatron, as Installatron makes backups and does the updates when needed.

I was on 1.9.01 before and updated to 1.9.1.0 without problems, but because we had some issue's with the skin (allready present in 1.9.01) which we tried fixing after the update somehow the whole webshot crashed.

So i placed back the backup of 1.9.0.1

Website working as before, but now i cannot update anymore, the update completes, in installatron is says 1.9.1.0 but the website shows the error mentioned in the title:

There has been an error processing your request
Exception printing is disabled by default for security reasons.

Error log record number: 1198252680343

The error log number changes, when trying to enter admin-url for example.
I've have a copy of the logs here:
https://dl.dropboxusercontent.com/u/32681465/error%20logs.zip

I've checked them and seems to be a mail issue?
Not sure though, but think it's a MYSQL problem.

Hope someone can help me.


texts: How to get customer group id by username without login?

texts:
I have been creating one custom module for block some customer group to wholesale store.
we can get customer group id by current session like

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

 // Get the Customer Group ID.

$group_id = $session->getCustomerGroupId();

But i want to block those customers before login. How to get customer group id by $login['username'] before setting session? Anybody have an idea? Please help me guys!


texts: Help with PayPal Payflow Pro on Magento 2.3.4

texts:
I am having the same exact issue as described here:
Nothing Happens When Paying With PayPal Payflow

In fact, my /var/log/payment.log file looks identical to the one in that post:

[2020-02-02 03:53:51] main.DEBUG: array (
  'request' =>
  array (
    'user' => '****',
    'vendor' => 'MYVENDORID',
    'partner' => 'PayPal',
    'pwd' => '****',
    'verbosity' => 'HIGH',
    'BUTTONSOURCE' => 'Magento_Cart_Community',
    'tender' => 'C',
    'trxtype' => 'A',
    'amt' => 0,
    'currency' => 'USD',
    'createsecuretoken' => 'Y',
    'securetokenid' => 'L5dVE9KHJWYeI7XmosYItMbkciK3R5VS',
    'returnurl' => 'https://www.flytrapcare.com/store/paypal/transparent/response/',
    'errorurl' => 'https://www.flytrapcare.com/store/paypal/transparent/response/',
    'cancelurl' => 'https://www.flytrapcare.com/store/paypal/transparent/response/',
    'disablereceipt' => 'TRUE',
    'silenttran' => 'TRUE',
    'firstname' => 'Matt',
    'lastname' => 'Miller',
    'street' => '1290 Greenmeadows Way',
    'city' => 'Ashland',
    'state' => 'OR',
    'zip' => '97520',
    'country' => 'US',
    'email' => 'matt@flytrapcare.com',
    'shiptofirstname' => 'Matt',
    'shiptolastname' => 'Miller',
    'shiptostreet' => '1290 Greenmeadows Way',
    'shiptocity' => 'Ashland',
    'shiptostate' => 'OR',
    'shiptozip' => '97520',
    'shiptocountry' => 'US',
  ),
  'result' =>
  array (
    'result' => '0',
    'securetoken' => '1oAtqrZ6NekKu32BIzag2yArH',
    'securetokenid' => 'L5dVE9KHJWYeI7XmosYItMbkciK3R5VS',
    'respmsg' => 'Approved',
    'result_code' => '0',
  ),
) [] []

Looking at the one answer from the person who posed the question, I can see that I have done items #1 and #2.  However, I can't figure out how to change the return URLS in PayPal Manager to POST.

Can someone point me in the right direction?

How can I change the return URLS in PayPal Manager to always POST?

EDIT FOR UPDATE:
I have finally logged into manager.paypal.com and found where to update the return URLs through the instructions found here:
https://docs.magento.com/m2/ce/user_guide/payment/paypal-payflow-pro.html#setting-up-paypal-payflow-pro

However, following step #2, I navigate to the "Service Settings" page in PayPal Manager and all I see is a blank page with no options to update anything.  See the screenshot:

Any suggestions for next steps as to where to update the settings for Payflow Pro?


texts:
Is there anyone can suggest the best solution for having multiple pricing on a product page.

I am looking to have a drop-down. this would serve brand new item price (default) and also open-box item price at discounted price....any idea how I can implement this?


texts:
All address form template files call new RegionUpdater in the end of file. For example template\customer\form\address.phtml has following line:

new RegionUpdater('country', 'region', 'region_id', countryRegions, undefined, 'zip');

What exactly this RegionUpdater does? Why it does it and how ? Is it necessary?


texts: WordPress integration set odd/even class for posts

texts:
I'm using Fishpig's wordpress integration for magento.

I need to set even and odd class for posts in category list.
Category page is written by post/list.phtml - code is below.

For basic magento catalog/category in my custom theme I use this script which works nicely.

This is post/list.phtml and decorateList nor decorateGeneric functions don't work because in front end I get

<?php $posts = $this->getPosts() ?>
<?php if (count($posts) > 0): ?>

            <?php foreach($posts as $post): ?>
                <li class="item<?php if ($post->isSticky()): ?> featured is-sticky<?php endif; ?> <?php echo $post->getPostFormat() ?>">
                    <?php echo $this->getPostRenderer($post)->toHtml() ?>

            <?php endforeach; ?>

        <?php echo $this->getPagerHtml() ?>

<?php endif; ?>

Does anyone know what could work for me?

Thank you in advance


texts:
On product page im getting white border on top and bottom of my product images.

Reading the doc and some other questions here and here, i think this should be the solution:

theme_dir/etc/view.xml:

<image id="product_page_image_medium" type="image">
    <width>700</width>
    <height>700</height>
    <aspect_ratio>true</aspect_ratio>
    <frame>false</frame>
</image>

While changing width and height does exactly what to be expected, frame does exactly nothing.

Magento 2.3.0


texts: Where do I see the registered users in magento 2 admin panel?

texts: I cannot see the users registered on my Magento 2 website in the customers tab of the admin panel. There is just one entry of the sample data. I am creating accounts but cannot find them in the admin panel.


texts:
I have created a .phtml that I added to the homepage through the adminpanel (CMS->Sites->Home->Design):

<reference name="content">
      <block type="core/template" name="sidebar"  template="sidebar/sidebar.phtml" />
</reference>

So now I wanted this .phtml to be displayed on every page of my site and I've followed this Answer: https://stackoverflow.com/questions/4449832/magento-create-a-fixed-block-in-all-pages

But it does not work, my .phtml does not get loaded.
Here is my code:

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Psp_SideBar>
            <version>1.0.0</version>
        </Psp_SideBar>
    </modules>
    <global>
        <blocks>
            <psp_sidebar>
                <class>Psp_SideBar_Block</class>
            </psp_sidebar>
        </blocks>
        <helpers>
            <psp_sidebar>
                <class>Psp_SideBar_Helper</class>
            </psp_sidebar>
        </helpers>
        <models>
            <psp_sidebar>
                <class>Psp_SideBar_Model</class>
            </psp_sidebar>
        </models>
        <resources>
            <psp_sidebar_setup>
                <setup>
                    <module>Psp_SideBar</module>
                </setup>
            </psp_sidebar_setup>
        </resources>
    </global>
    <frontend>
        <layout>
            <updates>
                <psp_sidebar>
                    <file>sidebar.xml</file>
                </psp_sidebar>
            </updates>
        </layout>
    </frontend>
</config>

sidebar.xml

<?xml version="1.0"?>
<frontend>
    <layout>
        <default>
            <reference name="content">
                <block type="core/template" name="psp.sidebar" template="sidebar/sidebar.phtml" />
            </reference>
        </default>
    </layout>
</frontend>


texts: Magento 2: get sub categories with limit

texts:
I have number of sub categories under main category. I have to get only four sub categories of main category. Any solution for this?

Here is the code for get sub categories:

$catId = 3; // Parent Category ID
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$subcategory = $objectManager->create('Magento\Catalog\Model\Category')->load($catId);
$subcats = $subcategory->getChildrenCategories();
    foreach ($subcats as $subcat) {
        echo $subcat->getName();
    }
}


texts: What is the scope of source model extend and implement?

texts:
What is the scope of source model extend and implement between these two?

\Magento\Eav\Model\Entity\Attribute\Source\AbstractSource

\Magento\Framework\Data\OptionSourceInterface

Attribute options are loaded via the attribute’s source class. The source class must extend \Magento\Eav\Model\Entity\Attribute\Source\ AbstractSource. which further extend Magento\Framework\Option\ArrayInterface.

but when to implement \Magento\Framework\Data\OptionSourceInterface


texts: How to setup copy of Venia Concept to work locally

texts:
I'm exploring PWA Studio and one thing I'm interested in finding out is how it can be easily used by copying Venia-Concept and using it as a  stand alone REACT app. Rather than downloading the entire monorepo which includes all the other packages.

So far I've tried the below but it exits with an error saying it can't find babel, I'm not sure why as it works when I follow the instructions to install it as a monorepo.

git clone https://github.com/magento-research/pwa-studio.git venia-temp
cd venia-temp
cp -R packages/venia-concept ../
cp babel.config.js ../venia-concept/
cp browserslist.js ../venia-concept/
cd ../venia-concept/
yarn install
cp .env.dist .env
yarn run build

$ yarn run clean && yarn run build:esm && yarn run validate-queries && yarn run build:prod
$ rimraf dist esm
$ BABEL_ENV=development babel src --out-dir esm --root-mode 'upward' --source-maps --copy-files
/bin/sh: babel: command not found
error Command failed with exit code 127.

Any ideas on what's causing this issue to occur and how I can get it working?

I know I could use the venia-consumer-example or fallback-studio, but I'm interested in seeing how it can work this way too.

UPDATE

If I run yarn add babel-cli -D i get past the last error but a new one occurs...

$ yarn run build
yarn run v1.13.0
$ yarn run clean && yarn run build:esm && yarn run validate-queries && yarn run build:prod
$ rimraf dist esm
$ BABEL_ENV=development babel src --out-dir esm --root-mode 'upward' --source-maps --copy-files
SyntaxError: src/RootComponents/CMS/CMS.js: Unexpected token (6:15)
  4 | export default class CMS extends Component {
  5 |     render() {
> 6 |         return <CategoryList title="Shop by category" id={2} />;
    |                ^
  7 |     }
  8 | }

UPDATE 2

I have found that if I run yarn add -D babel-plugin-module-resolver the yarn watch command works, but the yarn build command still does not :(


texts: How to get old id of customer group in observer (Magento 2)

texts:
I am trying to create an observer in which when admin will change the group of a customer, then customer will recieve a notification via mail that his/her group has been changed.

For this I will have to find both old group id and current group id of customer but I am unable to find old group id. It was working in Magento version 1.x but not in 2.x

I have written following code in changeGroup.php

 <?php
   namespace Arshad\NotifyOnGroupChange\Observer;
   use Magento\Framework\Event\ObserverInterface;

   class changeGroup implements ObserverInterface
   {
     protected $_objectManager;

     public function __construct(
     \Magento\Framework\ObjectManagerInterface $objectManager
    )
     {
         $this->_objectManager = $objectManager;
     }

     public function execute(\Magento\Framework\Event\Observer $observer)
     {
        $event = $observer->getEvent();
        $customer = $event->getCustomer();
        $customer = $observer->getEvent()->getCustomer();
        $old_id = $customer->getOrigData('group_id');
        echo $old_id;
        die;
     }
}
?>

My events.xml file

      <?xml version="1.0"?>
        <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"                          xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
          <event name="customer_save_after">
             <observer name="Arshad_NotifyOnGroupChange_Customer_Save_After" instance="Arshad\NotifyOnGroupChange\Observer\changeGroup" />
          </event>
        </config>


texts:
I'm trying to enable our ssl certificate on wijnmaat.nl it is working for the frontend but the backend is giving us an error:

  ERR_TO_MANY_REDIRECTS

This is when I try to reach the backend trough https://www.wijnmaat.nl/admin. this is when ssl is enabled in the config in the backend & frontend and when it is off. Can somebody please help us with this?

We also checked and edited the secure base url to https://www.wijnmaat.nl

thanks,

Brent


texts: Custom Theme XML Files Changes 2.2 to 2.3

texts:
Does anybody know if there have been changes to the way XML files from custom themes are included in Version 2.3?  I have a very simple XML file to modify the Magento Advanced Search page.  The custom .phtml file works fine from my version 2.2 mod, but the XML file doesn't seem to work since the upgrade.

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <css src="css/AdvancedSearch.css" media="all and (min-width: 1px)" />
    </head>
    <body>
        <referenceBlock name="page.main.title" display="false" />
    </body>
</page>

The above is the custom XML file that worked fine in 2.2 but does not seem to work in 2.3.  All it does is removes the pages title and includes a custom CSS file

EDIT----------------------------------------
I copied the above code into the core XML file at /vendor/magento/module-catalog-search/view/frontend/layout and it is working as expected.  However it doesnt work from the custom theme, even though the .phtml is fine and it worked in 2.2.  Is there a reason why custom theme XML files might not be included?


texts: Display selected child product instead of parent product in order email

texts:
In Magento 2.3, customer selects specific product from configurable product and place order. Now every where(checkout, order and invoice) child product shows but in order email confirmation parent product showing instead of that child product.
Please anybody can help me where I need to make changes.
Thank you


texts: How to change authenticate method: Magento 2

texts:
I have create my NewLoginPost Controller action with extends LoginPost
in the execute function i call to authenticate method where i pass (email, password).
    $customer = $this->customerAccountManagement->authenticate($identifier, $login['password']);
 In the authentification a had this

public function authenticate($customerId, $password)
{
    $customerSecure = $this->customerRegistry->retrieveSecureData($customerId);
    $hash = $customerSecure->getPasswordHash() ?? '';
    if (!$this->encryptor->validateHash($password, $hash)) {
        $this->processAuthenticationFailure($customerId);
        if ($this->isLocked($customerId)) {
            throw new UserLockedException(__('The account is locked.'));
        }
        throw new InvalidEmailOrPasswordException(__('Invalid login or password.'));
    }
    return true;
}`

Also i create customer attribute new_pass.
Where magento get password_hash field in db?

What i can do to CHANGE validation on standart password and password_hash field to my attribute (new_pass). Please help.


texts: Argument in DI.xml cannot resolve 'array' to a type definition for element 'argument'

texts:
Im new in magento 2. using DI.xml I'm creating a price adjustment. Weird to find that argument -> inside arguments is displayed in red with error cannot resolve 'array' to a type definition for element 'argument'.

any idea if it changed in the last release?.

UPDATE--------------------------------------------------------------
I realized  in C:\Zend\Apache2\htdocs\magento2\lib\internal\Magento\Framework\ObjectManager\etc\config.xsd is not defined. error says 'URI is not registered'


texts: Asynchronous sending emails for sales order in magneto2

texts: I want to sent sales order email at 2 mins of interval. If i enable Asynchronous sending means mail is not triggered. Whether we need to configure any cron job for this process if yes means please tell me the steps.


texts: Create Product Atrribute for Specific Type

texts:
I want to create an attribute for simple,virtual,downlodable and configurable products only. Below is my code.

$model=Mage::getModel('eav/entity_setup','core_setup');
$data=array(
    'group'             => 'Prices',
    'label'             => 'Test3',
    'type'              => 'int',
    'input'             => 'boolean',
    'source'            => 'eav/entity_attribute_source_boolean',
    'global'            =>     Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible'           => 1,
    'required'          => 1,
    'user_defined'      => 1,
    'searchable'        => 0,
    'filterable'        => 0,
    'comparable'        => 0,
    'visible_on_front'  => 0,
    'visible_in_advanced_search'    => 0,
    'unique'            => 0,
    'default'           => 0,
    'is_used_for_promo_rules' => 1,
    'apply_to'          => array('simple', 'configurable', 'virtual', 'downloadable'),
    'is_configurable'   => false
);
$model->addAttribute('catalog_product','test3',$data);

But issue is attribute is created for all product type.


texts: What are TYPE_ORDER and TYPE_PAYMENT transactions?

texts:
\Magento\Sales\Api\Data\TransactionInterface has several transaction types. While I do understand the association between authorization, capture, void and refund with the payment methods' commands, it's still a mystery for me what other two types (TYPE_ORDER and TYPE_PAYMENT) do.
I have found this method in \Magento\Sales\Model\Order\Payment where TYPE_ORDER used:

public function canCapture()
{
    if (!$this->getMethodInstance()->canCapture()) {
        return false;
    }
    // Check Authorization transaction state
    $authTransaction = $this->getAuthorizationTransaction();
    if ($authTransaction && $authTransaction->getIsClosed()) {
        $orderTransaction = $this->transactionRepository->getByTransactionType(
            Transaction::TYPE_ORDER,
            $this->getId(),
            $this->getOrder()->getId()
        );
        if (!$orderTransaction) {
            return false;
        }
    }

    return true;
}

From here, it is not clear for me:

What TYPE_ORDER transaction represents?
Why it is required to decide whether payment method allowed to capture?
What is the relation between authorization and order transactions?


texts: Magento2: Add product to parent and child categories on import

texts:
I am trying to import products in Magento2.2.5 Products have many categories :
e.g
Default Category/A1/A2/A3, Default Category/B1/B2/B3

When i check the product configuration, the product only has A3 and B3 checked as categories when it should have all the following categories checked for the product:

Default Category
Default Category/A1
Default Category/A1/A2
Default Category/A1/A2/A3

Default Category/B1
Default Category/B1/B2
Default Category/B1/B2/B3

Let me know the solution for adding parent categories checked on child categories


texts: How to add js libraries that require Jquery to magento 2 using requireJs

texts:
I am having a bit of strange behaviour with Magento 2 require.

What I trying to do is to use glide.js to load carousel image. I create custom.js and here is my code.

require(['jquery', 'lib/glide'], function($){
    $(function(){
        var carousel = $('#Glide').glide({ //instantiating glide
            type: 'carousel',
            startAt: 1,
            touchDistance: 2,
            autoplay: true,
            animationDuration: 800
        });
    });
});

This kind of works 90% of the time but it's temperamental. sometimes it gives error: Uncaught ReferenceError: jQuery is not defined and Uncaught TypeError: jQuery(...).glide is not a function.

The library needs jquery so it seens that sometimes something goes wrong and it can't find jquery lib.

Does anyone came across this before or I am doing something wrong.

Your help is appreciated. Thank's


texts:
I moved a magento(1.5.1) site to a new server.
In local.xml I replaced <session_save><![CDATA[memcache]]></session_save> with <session_save><![CDATA[files]]></session_save> the login  (front and admin admin throws this message "Invalid Form Key. Please refresh the page." Also when I add a product to the cart it does not get added is there something else I need to do?


texts: How to send attribute values in invoice mail in magento-1.9.1.1

texts: I have developed one website on magento-1.9.1.1. I need to add the weight attribute values along with order information in invoice email.


texts: Attributes are not updated in configurable goods

texts:
I have 2 attributes (size,colors) set in my configurable products (and showing in select list) and I need delete one of them. I did it and, for new goods, new settings, it works. But old products still have 2 attributes, how can I reset attributes for existing goods?

Note : Re-index does not help.


texts:
I have problem with Check Component Dependency

How to fix this error? I moved the Internet and nothing helped.


texts: Programmatically create site categories using an install script

texts:
Using Magento 1.9.0.1 I am trying to script my entire sites config and settings using install scripts so I can keep the whole site under version control.

I am now at the point of creating my categories.

I have seen many ways of doing this however nothing really non 'hacky'. Taking the following example category structure and keeping in mind I will have a maximum of only 20-30 categories what is the recommended way of approaching this? I would also like the script to Update if the category already exists.

- Public Catalog
    - Mens
        - Tops
        - Bottoms
    - Womens
        - Dresses
        - Shoes

I also want to be able to insert a category thumbnail and image which I have not found an example of.

Thanks


texts: Magento 2 : How to change input tags value dynamically which is rendered by knockout js?

texts:
I need to change product enable option to keep in disabled by default. I used data-index in css to hide the input which works fine but I need to change input tags value. My phtml to switch check box to false is below

<?php
    $role_id = 1 ; //get user's role id from system configuration
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $adminSession = $objectManager->get('Magento\Backend\Model\Auth\Session');
     $current_adminuser =    $adminSession->getUser()->getRole()->getRoleId();
    if($role_id == $current_adminuser): ?>

  <script>

     var inputs = document.getElementsByTagName('input');

for(var I = 0; i<inputs.length; i++){

  if(typeof inputs[i].getAttribute === 'function' && inputs[i].getAttribute('class') === 'admin__actions-switch-checkbox'){

    inputs[i].checked = false;

    break;

  }
}

  </script>
      <style>
    [data-index=status] {
            display: none;
        }
        </style>
    <?php endif; ?>


texts: How can I setup a product shipping for magneto2 based on attributes or categories? A Unique Scenario

texts:
We have 3 categories CAT A, CAT B and CAT C. CAT A and CAT B product mixed in other categories also so we can't apply via categories i think. CAT C product is not mixed in other categories.

TRANS-PORTION/SHIPPING cost APPLY AS BELOW

CAT A < 150$

IF TOTAL PURCHASED AMOUNT IS

UNTIL 50$-----10$

UNTIL 100$---15$

UNTIL 149$---20$

CAT B IF TOTAL PURCHASED AMOUNT IS

UNTIL 50$-----10$

UNTIL 100$---15$

UNTIL 150$---20$

MORE THAN 150$---25$

In CAT B only the assemble cost also apply 13% or minimum $15.
In Cat C if customer will be first product the Shipping cost is $20 and if buy next product in same order then shipping cost will be add $10 only.
I am trying to share a order scenario as below:
SL  Product Name         Product Cost    Shipping Cost apply

Product A from CAT A      cost $50    shipping $ 10
Product B from CAT B    cost $50 Shipping $ 10 if assemble then cost
$15 for assemble the product
Product C from CAT C    cost $50 Shipping $ 20
Product D from CAT C    cost $50 Shipping $ 10
Product E from CAT A    cost $50 Shipping $ 5

(Now the product SL No 1 already added in our cart so total shipping will be take on basis of total cost that is $100. I added here only $5 as $10 we take above.)
If customer wants to pick products from the store then there is no shipping or assemble cost will be apply on cart.
My questions how can I do the above for Magento 2 requirements and which is the best via categories or attributes   to do it.


texts: Can anyone help me in making an extra page in magento which is not in the theme by default?

texts:
I want to add an extra button  "ADD Prescriptions"  to my product page within Add to cart button, my website is about eye glasses. just like this: http://www.fashioneyewear.com/oliver-peoples-gregory-peck-ov5186.html

This button leads to an extra page which is not included in my theme by default. This page is very muck like: http://www.fashioneyewear.com/prescription/index/index/id/31460/?super_attribute[233]=342979&super_attribute[194]=328200

Can anyone helps me in making this page in magento as i can't do this??


texts: Setting prices in different websites in Magento 2

texts:
I'm trying to set upp three websites in Magento 2, which all sholud have different prices and different currencies.

Under Stores > All Stores, I have set up the following:

Swedish website     Sweden Store     Swedish Store View
Danish website      Denmark Store    Danish Store View
Norw. website       Norway Store     Norw. Store View

Under Stores > Configuration > Catalog > Price > Catalog Price Scope, I have selected "Website".

On the product edit page, the Price field is marked [WEBSITE].
To set the price for the Danish website, I click the All Store View dropdown. But here I only find the Swedish Website. Which means that I cant find any way to set different prices for the product in the websites.

Anyone have any idea about how to get the other websites available in Store View dropdown?


texts: Magento 2 set store_id and website_id in crontab

texts:
I have written cron to crate customer, but while running code through cron, I am getting error as

A customer website ID must be specified when using the website scope

code to get website id:

$websiteId  = $this->storeManager->getWebsite()->getWebsiteId();

$this->storeManager is instance of class:

\Magento\Store\Model\StoreManager

But that code always return 0(zero) as website id which result in error.
Is there any way to get website or store id in cron?


texts: Are index tables relevant when developer mode is on? If so which ones?


texts: Error while creating shipment with FedEx

texts:
I've configured FedEx in magento and when I'm going to create shipment with create shipment label it's giving error like this

  RequestedShipment shippingChargesPayment - Payor is required

How can I fix this Issue?


texts: Some times totals not updating after ajax remove and update quantity

texts: In basket page I'm trying to update product quantity totals not getting update in ajax request. If I refresh page totals showing correct. This issue i'm facing only sometimes


texts: Allow customer to attach Multiple files on product page using custom options


texts: Create custom options in event observer magento 2

texts:
I want to create new custom option for quote item in my observer. How can I do that? Here is my code:

public function execute(\Magento\Framework\Event\Observer $observer) {
    $item = $observer->getEvent()->getData('quote_item');
    $item = ( $item->getParentItem() ? $item->getParentItem() : $item );
        $price = '100'; //set your price here
        $item->setCustomPrice($price);
        $item->setOriginalCustomPrice($price);
        $item->getProduct()->setIsSuperMode(true);
}

I am setting custom price but I also need to set some custom options. I have created observer on checkout_cart_product_add_after event.


texts: magento 2 : product attribute file upload

texts:
in magento 2 i want to add custom pdf to my product attribute,  i tried creating new attibute in product but can not find file upload in same ,can any one help from where can i enable this settings.
i can see only below options.


texts: Replicate demo content homepage magento 2

texts:
I wanted to replicate the demo content layout of the homepage in a fresh install.

I copied the markup from content > blocks > homepage

But it looks different from the demo content, the text does not get superimposed on images etc.

                                     ****VS****

I read that it may be because sample content uses custom modules, is there a specific module or a specific fix for this so we can get the same layout?

I'm assuming it's one of the following extensions that does this (copied from the terminal while installing the sample data)

magento/module-catalog-sample-data
magento/module-bundle-sample-data
magento/module-theme-sample-data
magento/module-cms-sample-data
magento/module-customer-sample-data
magento/module-downloadable-sample-data
magento/module-grouped-product-sample-data
magento/module-msrp-sample-data
magento/module-offline-shipping-sample-data
magento/module-product-links-sample-data
magento/module-review-sample-data
magento/module-catalog-rule-sample-data
magento/module-sales-rule-sample-data
magento/module-configurable-sample-data
magento/module-sales-sample-data
magento/module-swatches-sample-data
magento/module-tax-sample-data
magento/module-widget-sample-data
magento/module-wishlist-sample-data
magento/sample-data-media


texts:
I followed the official documentation from this url
https://magento.github.io/pwa-studio/venia-pwa-concept/setup/

But when I run npm run build I get the following error

lerna ERR! npm run build -s exited 1 in '@magento/venia-concept'


texts: What is the best way to install the update of an existing extension?

texts: I got to install the update of an already existing extension (in the community code) in my project. So, I got the files gathered in a zip file. I've got files for the code, for the shell, js, skin. Anyway, there are a lot of files, and I was wondering (since it is gonna be my first time to update an extension) whether I should just replace all the files, that already exist, with the files that I've been given, by copy-paste, or there is a simpler way?


texts: Magento 2: Product Image Watermark Size Not Changing

texts: Magento 2: I want to change watermark image size but change is not reflecting on the product view page.


texts: How can I overwrite Mage_Adminhtml_Block_Cache?

texts:
I'm trying to add a button on the cache page, next to the "Flush Cache Storage" button. My approach is to overwrite the block "Mage_Adminhtml_Block_Cache". But I can't get it to work. Does anyone know what I'm doing wrong?

Mymodule/FlushImages/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Mymodule_FlushImages>
            <version>1.0.0</version>
        </Mymodule_FlushImages>
    </modules>
    <global>
        <blocks>
            <adminhtml>
                <rewrite>
                    <cache>Mymodule_FlushImages_Block_Adminhtml_Cache</cache>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
</config>

Mymodule/FlushImages/Block/Adminhtml/Cache.php

<?php

    class Mymodule_FlushImages_Block_Adminhtml_Cache extends Mage_Adminhtml_Block_Cache
    {
        /**
         * Class constructor
         */
        public function __construct()
        {
            $this->_addButton('flush_magento', array(
                'label'     => Mage::helper('core')->__('Flush Images'),
                'onclick'   => 'setLocation(\'' . $this->getFlushImagesUrl() .'\')',
                'class'     => 'delete',
            ));

            parent::__construct();
        }

        /**
         * Get url for delete Images
         */
        public function getFlushImagesUrl()
        {
            return $this->getUrl('*/*/flushImages');
        }
    }

Note: I did create the module config file in app/etc/modules.

Help is highly appreciated.


texts: Magento 1.14 - Chrome new Update - Cookie Samesite=none issue

texts:
Our website is in Magento 1.14 enterprise edition. Some of the pages of the website are embedded in an external iframe HTML website. But, after the latest update of chrome, all the features in the website pages inside the iframe stopped working.
In an analysis, I found that even the frontend cookie is also blocked by the chrome browser. No cookies are generated in the browser.
Everything is working fine in Mozilla.
Please help us to proceed here?
My PHP version is 5.5
Server - Nginx


texts: Magento 1.9 - Store Hours of Operation not available for CMS

texts:
Under Admin->System->Configuration->General, there is a field called Store Hours of Operation.

Referencing to this field using {{config path="general/store_information/hours"}} in a static block outputs nothing, while other fields ouput correctly, such as {{config path="general/store_information/phone"}}.

If you click Insert Variable from the editor, you'll see other variables but not Store Hours either.

Any idea why Store Hours is hidden from CMS? How can I display it?


texts: Magento 2 - AWS automatic codeDeploy via GitHub webhook

texts:
Can u please suggest me how effective is AWS codeDeploy for Magento 2
?
Is there any problems i need to overcome?

Sharing your experience would be helpful for me. Thankyou.


texts: Fetch Category Image from collection object without loading category object

texts:
I am trying to get the category image from the below code

      $collection = $this->_categoryCollectionFactory->create();
      $collection->addAttributeToSelect('name','image')
                ->addAttributeToFilter('is_popular', array('eq' => 1))
               ->addAttributeToFilter('is_active',array('eq' => 1))
               ->addAttributeToSort('category_sort_no', 'ASC')
               ->setPageSize(12)
               ->load();

and i am looping through these but i am not getting category image.I can get category id from the collection and load the category object and get the image.But it is affecting the performance like below:

$category = $objectManager->create('Magento\Catalog\Model\Category')->load($categoryId);
$imgUrl = $category->getImageUrl();

Is there any way we can fetch the category image from the collection object?

Thanks!


texts: How do I search what this "MAGETWO-45654" refers to on magento2 github

texts:
I'm working on an issue on magento 2.1-develop branch. I was going through this integration test dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/OptionRepositoryTest.php

This test is skipped as the first line of test says

$this->markTestSkipped('Test skipped due to MAGETWO-45654');

It seems like "MAGETWO-45654" refers to an issue. How do I search for this issue. I tried searching for it by using Github issues filter. I couldn't find the issue. I would like to know how to search for an issue by "MAGETWO-" kind of label.


texts: Category URL Key Field showing as disabled non editable Magento 2.2.3

texts:
On my Magento 2.2.3 store, I'm adding new categories. But it seems that on all new, but also the old existing categories. I'm unable to change the URL Key under the 'Search Engine optimization' tab.
The URL is shown, but it's greyed out and the input field is disabled. my website has 4 stores.
Anyone can suggest this. I am not getting any solution.


texts: Payment method option not visible on backend (under sales) Magento 2.3.3

texts:
We are facing an issue that Payment method under Sales from admin side gone...
You can see on my screen shot, no error or somthing from the logs.

I belive it is configuration on code that changed, to be unvisible on admin side.
By the way from front end, I still see the correct payment method show up as we configured before...

Please let me know if someone have suggestion, where can I check configuration from admin side(backend).


texts: How can I customize Login Page in Magento 2?

texts:
How can I customize the Login Page for Admin in Magento 2?
I want to change the Logo and CSS Styles there.


texts:
I want to add a Cart Price Rule in Magento2, which is negative:

Actions: Fixed amount discount
Discount amount: -2

However, when I save it says:

  Please choose a valid discount amount.

How can I remove the 'negative discount amount check'?

Additional explanation: I want to add $2 (instead of discount) in some cases, depending on product attributes.


texts: Magento2 why does magento take 10 min to consider cart as abandoned

texts: Can someone guide me on why it says that it takes around 10 min for magento to consider the cart abandoned?


texts:
I want to have a downloadable link in my admin form. I want to fetch file name from my table and file is located under Magento_Root/pub/media/ directory.
Note: this form is being used for just edit few fields (mainly informative)