texts: In magento2 how to override a add to cart button in both product list and product details page in custom module

texts:
Product detail page:

Category Product list

  catalog_product_view.xml

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceContainer name="content">
            <referenceBlock name="product.info.addtocart" template="Cm_Preorder::product/view/addtocart.phtml" />
            <referenceBlock name="product.info.addtocart.additional" template="Cm_Preorder::product/view/addtocart.phtml" />
        </referenceContainer>

</page>

  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="Cm_Preorder" setup_version="1.0.1" schema_version="1.0.1">
        <sequence>
            <module name="Magento_Catalog"/>
        </sequence>
    </module>
</config>

  app/code/Cm/Preorder/view/frontend/templates/product/view/addtocart.phtml

<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/** @var $block \Magento\Catalog\Block\Product\View */
?>
<?php $_product = $block->getProduct(); ?>
<?php $buttonTitle = __('Pre order'); ?>
<?php if ($_product->isSaleable()): ?>

        <?php if ($block->shouldRenderQuantity()): ?>

            <?php /* @escapeNotVerified */ echo __('Qty') ?>

                <input type="number"
                       name="qty"
                       id="qty"
                       maxlength="12"
                       value="<?php /* @escapeNotVerified */ echo $block->getProductDefaultQty() * 1 ?>"
                       title="<?php /* @escapeNotVerified */ echo __('Qty') ?>" class="input-text qty"
                       data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"
                       />

        <?php endif; ?>

            <button type="submit"
                    title="<?php /* @escapeNotVerified */ echo $buttonTitle ?>"
                    class="action primary tocart"
                    id="product-addtocart-button">
                <?php /* @escapeNotVerified */ echo $buttonTitle ?>
            </button>
            <?php echo $block->getChildHtml('', true) ?>

<?php endif; ?>

<?php if (!$block->isRedirectToCartEnabled()) : ?>

<?php endif; ?>


texts: Can Any one Describe a Basic CRUD Operation in Magento Front Side

texts: I want to Know what is the process of ADD Update Delete in Magento from front side. so can any one help with code.


texts: How to show new category products on home page?

texts:
I  have search but cant find anything than can help me understand how to make this possible
i want to show the New products from each category on my home page
I'm using Magento CE 1.8.1 and Fortis Template
i'v managed to show the New product in my home page but cant seem to Get them split by categories
since i don't know so much of this ''coding'' stuff if possible i would appreciate some help


texts:
for some reason, in recent weeks my customers are getting "password does not match" errors when making accounts etc.

I know there is a known issue on 1.9.1.0, but I am using 1.9.0.1

Does anyone have a fix or workaround that applies to 1.9.0.1?


texts:
I just upgraded to Magento 2.1.3 and I'm getting the following error message when I go to the design configuration section:

  SQLSTATE[42S02]: Base table or view not found: 1146 Table
  'db.design_config_grid_flat' doesn't exist, query was: SELECT COUNT(*)
  FROM `design_config_grid_flat` AS `main_table` WHERE
  (`store_website_id` = '1') AND (`store_group_id` IS NULL)

1st UPDATE:

This is what happens after I run the indexer:reindex command

2nd UPDATE:

This is my list of tables in the database and you can see that there is no table to drop even though I get that error message from the reindex method

3rd UPDATE:

This is what I see when I try to run the create table sql command


texts:
Checkout page error in Magento 2

Expected Result:

Actual Result:

In the frontend checkout page, it shows an error.

Source code in GitHub: https://github.com/sd2894/OrderAttributes

how to define shippingMethodListTemplate  and shippingFormTemplate in js file how to override shipping.js in custom module in magento 2


texts:
I have a vagrant box with a Magento installation. My var folder is set to 777 (not recommended I know but I'm trying everything). When I try to login to the admin, nothing happens. I see empty session files in the var/session folder.

I have checked the following:

cookie domain in db (set to empty)
vagrant box server time equals my local time zone
use of localhost (I'm not using localhost, i'm using a local.XXXX.com domain)
cleared all my cookies
tried various browsers
tried incognito browser

I keep seeing this in the logs:

Warning: Unknown: Failed to write session data (files). Please verify
that the current setting of session.save_path is correct [path to
correct var/session folder]

but there are empty session files in that folder.

I tried deleting the session folder, and Magento creates it anew but with the empty session files.

I had the same configuration running perfectly, but I had to destroy and rebuild the vagrant box. That is when it started happening.


texts:
I'm not a programmer and I am in charge with a Magento online store developed a year ago by someone else.

I have to solve a problem and need to know if it can be done without programming (in order to solve it fast) or I must wait until hire a Magento programmer.

Problem:
The store has several categories (fragrances, cosmetics, drinks, tobacco, accessories, sweets and toys).

Products in each categories has separate attribute sets.
For each attribute set, there is a brand attribute (for example, in fragrances's attribute set I have brand, in drinks's attribute set I have drink_brand and so on).

I want to unify all brands (frangrance, drinks, accessories, toys, a.s.o) under only one attribute named brand.

Can I add to the existing brand attribute (which, by the way, contains only the fragrance brands) all other brands (for drinks, accessories, toys...) an then replace this attribute in all attribute sets?


texts: How to display sub-category from one category? New .phtml for left navigation

texts:
How to display category from one category? I created a new file .phtml But I do not know how to write code in phtml file. I watched Google and other issues, but have not found a friendly solution. Please, help.

I have this code.


texts: Magento 2 Share cart between multiwebsites

texts:
I have two websites like abc.com and bcd.com. Each website have seperate store.
Now i want to share the cart items between both the websites. That means now customer login from abc.com and added one product to cart and logout from abc.com. And same customer login from bcd.com and i want to show product in cart which was added from abc.com.


texts: Why would the Blocks HTML output cache need to be refreshed daily?

texts:
I've noticed that our Blocks HTML output cache regularly needs to be refreshed, every day even when no one has been working on the Backend of Magento?

Why would this cache become invalid so frequently when no one has been updating CMS pages, static blocks, products etc?

What happens when the cache is invalid?  Does Magento go to the file system rather than the cache when a cache is invalid?

We're using redis Backend cache, I'm thinking that perhaps redis does not have enough memory allocated to it.

Could this have something to do with this bug regarding Blocks HTML output cache on 1.9 https://www.magentocommerce.com/bug-tracking/issue/index/id/870


texts:
I'm trying to speed up the process of updating the description and category image in a few hundred categories in 16 storeviews. Each storeview has an different description and category image.

Using the save()-Method on the category object works ok, but is quite slow.

I tried using

$_category->getResource()->saveAttribute( $_category, "description" );

but that does not work for me.

Is there any other way for faster updating of single category attributes, maybe something like

Mage::getSingleton('catalog/resource_product_action')

(i could not find anything similar for categories)?


texts: prefix/postfix route with database value

texts:
In the magento admin area there is a random key generated which is required as part of the route. I would like to recreate this with a value that is held in my database. But I don't know where to start.

I have looked online but cant find anything covering this subject and I cant find where and how the code is generated in the core.

what i currently have is

http://myStore.local/index.php/prefs/index/edit/id/174

What i'd like

http://myStore.local/index.php/prefs/index/edit/id/174/someKeyFromTheDatabase

How do I recreate this type of route?


texts: Magento 2.2 : getcollection is not working in the Block

texts:
My custom collection is not working in block file Helloworld.php

<?php
namespace New\MyModule\Block;

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

class Helloworld extends Template
{
    protected $_modelFactory;

    public function __construct(Context $context,
                                New\MyModule\Model\DataFactory $modelFactory,
                                array $data = array())
    {
        $this->_modelFactory = $modelFactory;
        parent::__construct($context, $data);
    }

    public function getHelloCollection()
        {
            return $this->_modelFactory->create()->getCollection();
        }
}

Model files:

  Model\Data.php

<?php

namespace New\Model;

use Magento\Framework\Model\AbstractModel;

    class Data extends AbstractModel
    {
        protected function _construct()
        {
            $this->_init('New\MyModule\Model\ResourceModel\Data');
        }
    }

Resource model:

  Model\ResourceModel\Data.php

<?php

namespace New\MyModel\Model\ResourceModel;

use \Magento\Framework\Model\ResourceModel\Db\AbstractDb;

class Data extends AbstractDb

{

    protected function _construct()

    {

        $this->_init('blog_posts', 'post_id');

    }

}

Collection file:

  New\MyModule\model\ResourceModel\Data\Collection.php

<?php

namespace New\MyModule\Model\ResourceModel\Data;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;

class Collection extends AbstractCollection

{

    protected function _construct()
    {

        $this->_init(
        'New\MyModule\Model\Data',
        'New\MyModule\Model\ResourceModel\Data');

    }

}

I need to get the collection into my block to fetch the database values. pls help me.


texts: How to add bulk quantity option in Product ? -- Magento 2.3

texts: I want to create this type of product (see attached ScreenShot) in Magento 2. If anybody knows please help ..!!


texts: Add Configurable Product To Cart Via Query String In 1.7

texts:
Note: This is a X-Post from StackOverflow, I put it there before remembering this subexchange existed so apologies for the double-up.

My issue is surrounding the Add To Card method for configurable products and whether a configurable product via URL / querystring is possible.

The Magento Wiki has a resource for adding a product to cart via Query String for Magento < 1.3 HERE

This quotes a method using this example:

http://www.your_domain.com/checkout/cart/add?product=68&qty=1&super_attribute[528]=55&super_attribute[525]=56

It also mentions that this was valid up to version 1.3.

I have been playing around with this in 1.7 and have noticed a Major difference in 1.7 is the encrypted key in the ->getAddUrl() method for the Form Action Attribtue so now the URLs look more like

http://www.your_domain.com.au/checkout/cart/add/uenc/aHR0cDovL3d3dy5jdWx0dXJla2luZ3MuY29tLmF1L2FjY2Vzc29yaWVzL3NvbC1yZXB1YmxpYy90cmFja3Mtb24tZWFyLWJsYWNrLTM1OTg5Lmh0bWw_X19fU0lEPVU,/product/35900/

With the product ID being the 35900.

If I use this URL in the browser it will direct me to the product page with a message saying Please specify the product's option(s).

I have been trying to pass the desired attribute options value in the URL to add the product to the cart with no success. (For the sake of saving space I'm omitting the URL up to and including the encrypted key) I've tried methods these to no avail:

/product/35900/super_attribute/49265/4834
/product/35900/super_attribute/49265=4834
/product/35900/49265=4834
/product/35900/49265/4834

My question is: Is it possible to add a configurable product via URL to the cart in Magento and if so, what is the format for passing the super_attribute id and Attribute Option Value?


texts: Magento 2: How to add Join query in a custom module

texts:
want to add join query in getPost function in a single view

 public function getPost()
    {
        if ($this->_post === null) {
            /** @var Post $post */
            $post = $this->_postFactory->create();

           $post->getSelect()->join( array('customer_entity'=> 'customer_entity'), 'customer_entity.entity_id = main_table.entity_id');

            $post->load($this->_getPostId());

            if (!$post->getId()) {
                throw new LocalizedException(__('Trails not found'));
            }

            $this->_post = $post;
        }
        return $this->_post;
    }

getting error

PHP Fatal error:  Uncaught Error: Call to a member function join() on null

Magento CLI version 2.2.3

block page

namespace xxxx\Trails\Block;

use \Magento\Framework\Exception\LocalizedException;
use \Magento\Framework\View\Element\Template;
use \Magento\Framework\View\Element\Template\Context;
use \Magento\Framework\Registry;
use \xxxx\Trails\Model\Post;
use \xxxx\Trails\Model\PostFactory;
use \xxxx\Trails\Controller\Post\View as ViewAction;

class View extends Template
{
    /**
     * Core registry
     * @var Registry
     */
    protected $_coreRegistry;

    /**
     * Post
     * @var null|Post
     */
    protected $_post = null;

    /**
     * PostFactory
     * @var null|PostFactory
     */
    protected $_postFactory = null;

    /**
     * Constructor
     * @param Context $context
     * @param Registry $coreRegistry
     * @param PostFactory $postCollectionFactory
     * @param array $data
     */
    public function __construct(
        Context $context,
        Registry $coreRegistry,
        PostFactory $postFactory,
        array $data = []
    ) {
        $this->_postFactory = $postFactory;
        $this->_coreRegistry = $coreRegistry;
        parent::__construct($context, $data);
    }

    /**
     * Lazy loads the requested post
     * @return Post
     * @throws LocalizedException
     */
    public function getPost()
    {
        if ($this->_post === null) {
            /** @var Post $post */
            $post = $this->_postFactory->create();
            $post->getSelect()->join( array('customer_entity'=> 'customer_entity'), 'customer_entity.entity_id = main_table.entity_id');
            $post->load($this->_getPostId());
            if (!$post->getId()) {
                throw new LocalizedException(__('Trails not found'));
            }
            $this->_post = $post;
        }
        return $this->_post;
    }

    /**
     * Retrieves the post id from the registry
     * @return int
     */
    protected function _getPostId()
    {
        return (int) $this->_coreRegistry->registry(
            ViewAction::REGISTRY_KEY_POST_ID
        );
    }

}


texts: How to handle custom_attributes from REST API data?

texts:
When dealing with the Magento v2 API, I faced a problem where getting product details have inconsistent data from REST API.

Example 1:

Example 2:

These are Note 8 and iPhone 8 data and we can see that the custom_attributes[10] is having different attribute code.
The Note 8's custom_attrbutes[10] is url_key.
The iPhone 8's custom_attributes[10] is country_of_manufacture.

Can i have some suggestions how to handle this kind of data?


texts: Custom styling for product attribute select boxes with jQuery

texts:
We have implemented the jQuery FancySelect script (http://code.octopuscreative.com/fancyselect/) to transform all the select boxes in our webshop. This works fine except for the select boxes on the product page to choose the options for product attributes.

The script changes the markup as follows:

Before

<select>
    <option value="">Choose an Option...</option>
    <option value="optionId">Option</option>
    <option value="optionId">Option</option>
</select>

After

<select>
    <option value="">Choose an Option...</option>
    <option value="optionId">Option</option>
    <option value="optionId">Option</option>
</select>

Choose an Option...

Option

Option

Although the custom styling is ok, we lose the standard Magento functionality to dynamically fill the additional select boxes with the available options when we have more then one product attribute.

This is probably due our new markup but we don't know how to solve this.


texts:
$feature = Mage::getResourceModel('catalog/product_collection');
    Mage::getModel('catalog/layer')->prepareProductCollection($feature);
        $feature->addAttributeToSort('created_at', 'desc');
        $feature->addStoreFilter();
        $feature->addAttributeToFilter('feature', array('eq' => 'Yes'));
        //$feature->setPage(1, 6)->load();

I have the following code to filter custom attribute 'feature', some how the collection it return, it's not the same as 'feature' define in backend.

EDIT it spit out about 5-10 product, I can't find any correlation between them  (sales? new?)

example

  foreach($feature as $product) {
       print_r($product['feature']); // return 0
       print_r($product->getFeature()); // return 0
  }

I reindex and cached is disable.  how do I debug this?

this is $feature->getSelect(); hope this help.

SELECT `e`.*, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position`, `at_feature`.`value` AS `feature` FROM `catalog_product_entity` AS `e` INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0 INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '2' INNER JOIN `catalog_product_entity_int` AS `at_feature` ON (`at_feature`.`entity_id` = `e`.`entity_id`) AND (`at_feature`.`attribute_id` = '133') AND (`at_feature`.`store_id` = 0) WHERE (at_feature.value = 'Yes') ORDER BY `e`.`created_at` desc


texts:
How to get Custom attribute in listing page

I Have Mobile Category all Mobile Product Under Mobile Attribute Set under that all product only 2 attributes are Filterable Attribute. I am using Custom .pthml for some category with 1colums.phtml

How to Get that 2 filterable attribute in that custom.phtml


texts: Magento 1.7 or Switch to Magento 2 for PCI complience

texts:
Today received notification in Magento Admin Notification panel suggesting to upgrade to Magento 2.0 for (better and faster PCI comlience).
Given that 1.7.0.2 is the version I run my site, how long do you guys think I can still run Magento on 1.7 version before forcefully be required to upgrade to the latest version Magento 2.0.

To me 1.7 is only 3 years old, but in tech world it could be soon outdated.

Appreciate all suggestions.


texts: Magento 2: How to change Advanced Search from "AND" to "OR"?

texts:
I'm stuck with this situation:

I have 2 select-type attributes: A and B for example
In both of the attributes, I have the same list of Options (but they are different option ids)

For example
In attribute A, I have these options:
Option_1, option id = 1
Option_2, option id = 2
Option_3, option id = 3

In attribute A, I have these options:
Option_1, option id = 4
Option_2, option id = 5
Option_3, option id = 6

Now I have this advanced search query for "Option_1": http://domain/catalogsearch/advanced/result/?A[]=1&B[]=3
But what I want is:

The Product 1 (has A = Option 1, with id 1)
The Product 2 (has B = Option 1, with id 4)

Because advanced search use "AND" then this return zero result.

Can it use "OR" to return both Product 1 and Product 2? Or any solution for my situation?

Maybe this also the search Query is ?A[]=1, but it still return the product which has B[]=4

I hope this question is clear.


texts: Is there a way to ship both freight (common carrier) and UPS for the same order for the qualifying items?

texts:
My assumption is that the order would have to programmatically be broken up for this to happen, and items that qualify for freight are filtered into the "freight bucket" while UPS is filtered into the "UPS bucket"?

Misguided assumption or not?


texts:
I want to add some sql before the customer checkout like in the picture below.
What is the file that handle the checkout? Is it SaveOrder.phpat vendor/magento/module-checkout/Controller/Onepage? because I have tried to do some sql there, but nothing happen after checkout.


texts: Is it good to use Access Token in Magento 2 for REST API?

texts:
I am using REST API for some product insertion process in my Controller File and i will used that Access Token to generate the token.

Is it good to use that on my Live Website Code If not then what is the correct way to insert product using REST API
As I have seen using this API to generate token http://127.0.0.1/magento/rest/default/V1/integration/admin/token but it requirs admin username and password so, i think it is not good to share that password in Code.
So i want just the correct approach to use REST API in my Live Website to generate token.
Any help is appriciated.


texts:
I created a backend configuration for my custom plugin

  /app/code/Sostanza/LiveHelp/etc/adminhtml/system.xml

https://pastebin.com/2jwnYLwb

  /app/code/Sostanza/LiveHelp/Block/Button.php

https://pastebin.com/myadtSZE

I need to get the value of a saved option and I already have a Helper class where I can read the value I need.

I have my helper in

  /app/code/Sostanza/LiveHelp/Helper/Data.php

https://pastebin.com/JAUWX41c (Max 2 links with my reputation)

But if in the Button.php I add

Sostanza\LiveHelp\Helper\Data $data

The config section doesn't get rendered anymore
I tried also to inject other stuff, but it doesn't work.
Of course I ran "magento setup:upgrade" and deleted cache/generation folders.

Thank you so much


texts: Magento 2 Change image size of product detail page

texts:
Need to change product image size 850 X 750 on the product detail page
I made changes in file view.xml but width is taking randomly
/app/design/frontend/vendor-name/theme-name/etc/view.xml
product_page_image_medium width 900 and height 750


texts: Enabling zoom when on gallery fullscreen

texts:
How can I get the zoom effect on a gallery product page to show when I am in full screen mode? I am using Magento 2.3.4 enterprise.

This is what I have in myTheme/etc/view.xml file.

<vars module="Magento_Catalog">
    <!-- Gallery and magnifier theme settings. Start -->
    <var name="gallery">
        <var name="nav">dots</var> <!-- Gallery navigation style (false/thumbs/dots) -->
        <var name="loop">true</var> <!-- Gallery navigation loop (true/false) -->
        <var name="keyboard">true</var> <!-- Turn on/off keyboard arrows navigation (true/false) -->
        <var name="arrows">false</var> <!-- Turn on/off arrows on the sides preview (true/false) -->
        <var name="caption">false</var> <!-- Display alt text as image title (true/false) -->
        <var name="allowfullscreen">true</var> <!-- Turn on/off fullscreen (true/false) -->
        <var name="navdir">horizontal</var> <!-- Sliding direction of thumbnails (horizontal/vertical) -->
        <var name="navarrows">true</var> <!-- Turn on/off on the thumbs navigation sides arrows(true/false) -->
        <var name="navtype">slides</var> <!-- Sliding type of thumbnails (slides/thumbs) -->
        <var name="transition">
            <var name="effect">slide</var> <!-- Sets transition effect for slides changing (slide/crossfade/dissolve) -->
            <var name="duration">500</var> <!-- Sets transition duration in ms -->
        </var>
        <var name="fullscreen">
            <var name="nav">dots</var> <!-- Fullscreen navigation style (false/thumbs/dots) -->
            <var name="loop">true</var> <!-- Fullscreen navigation loop (true/false/null) -->
            <var name="arrows">true</var> <!-- Turn on/off arrows on the sides preview in fullscreen (true/false/null) -->
            <var name="caption">false</var> <!-- Display alt text as image title in fullscreen(true/false) -->
            <var name="navdir">horizontal</var> <!--Sliding direction of thumbnails in fullscreen(horizontal/vertical)  -->
            <var name="navarrows">false</var> <!-- Turn on/off on the thumbs navigation sides arrows(true/false) -->
            <var name="navtype">slides</var> <!-- Sliding type of thumbnails (slides/thumbs) -->
            <var name="transition">
                <var name="effect">slide</var> <!-- Sets transition effect for slides changing (slide/crossfade/dissolve) -->
                <var name="duration">500</var> <!-- Sets transition duration in ms -->
            </var>
        </var>
    </var>

    <var name="magnifier">
        <var name="fullscreenzoom">5</var>  <!-- Zoom for fullscreen (integer)-->
        <var name="top"></var> <!-- Top position of magnifier -->
        <var name="left"></var> <!-- Left position of magnifier -->
        <var name="width"></var> <!-- Width of magnifier block -->
        <var name="height"></var> <!-- Height of magnifier block -->
        <var name="eventType">hover</var> <!-- Action that activates zoom (hover/click) -->
        <var name="enabled">false</var> <!-- Turn on/off magnifier (true/false) -->
    </var>


texts: On the product page, there's a tab called "Upsell". I do not need to use this feature. How do I remove this tab?


texts: Related products select button missing and Size attribute in related products

texts:
On this page I have added Related products.

where is the select button, to select a product?
those shirts are in different sizes. How can I display the Size
attribute here? So users are able to select their size directly?


texts:
I have a webshop wherein :

abc.com/staff is giving page not found error
abc.com/staff/ is loading the page correctly.

There is a difference of "/" in both the URLS.
I have other CMS pages in magento such as contact-us which are working perfectly fine.
Need assistance in this scenario about what is going wrong.


texts: Magento 2 : How to get current IP Address?


texts: Widgets showing on products of a particular category

texts:
Working on a project where I need the ability to show a static block widget on all products of a particular category. So as an example the block might be instructions on how to measure yourself for a particular type of shirt so for all the shirts in the "button down" category I want this widget to show, but it won't show up on t-shirts.

My first thought is to modify the widget filter so that in addition to SKU and Name you can filter it by category, you could then choose the "button down" category to filter the list then do a select all on all the products in that category.

Before I go too deep down this hole I thought I'd throw it out there and see if anyone has any better suggestions?


texts:
Our shop get repeatedly infected with a "crypto-miner" malware. Its a javascript code that mines cryptocurrency on the client's CPU.

Everytime this happens I can find and remove the code in the Backend under:

System->General->Design->HTML Head->Miscellaneous Scripts

We use Magento  1.9.3.7 with the latest security patches. I also changed the admin password but it doesn't help.

I would like to know how to prevent these attacks to happen again.


texts: Magento 2 include wp-load.php from WordPress?

texts:
I've got a WordPress website with Magento in a sub-folder for the store functionality

I'm trying to include wp-load.php from WordPress into Magento so that I have access to use some of the WordPress functions which I would like to use. However I receive the following error since both WordPress and Magento have a __() function.

Fatal error: Cannot redeclare __() (previously declared in /products/app/functions.php:14) in /wp-includes/l10n.php on line 207

Does anyone know how I can resolve this issue?


texts: how to add home page banner slider programmatically using js code not extension magento 2?

texts:
Actually i am trying to add Home Page Slider pro grammatically using
  js code not extension magento 2?


texts: Magento 2 Checkout billing address validation message

texts:
I am using Magento 2.1.7

On checkout billing address form, all field has value but if I leave blank first name field validation message is "address is a required field."

I want to change it with specific field name "firstname is a required field."


texts: Magento 2 - Please enter less or equal than 255 symbols valiadtion error in checkout page

texts:
Magento 2 - Please enter less or equal than 255 symbols error message in add new shipping address popup form
Currently i am getting an error validation message when i open the add new address form to add new shipping address in checkout page.


texts: how to show full path of selected image in magento frontend and store that path in database

texts:
I have created form in which we can select an image using
 and i want to store path in database.

and when i submit the data in database it should save the same path in database.
and i have further operations in admin also.. but now atlst i have to show all this


texts:
I'm trying to get newsletter subscribers using the code:

$subscribers = Mage::getModel('newsletter/subscriber')->getCollection();

but it is empty.
Where I'm wrong? thanks


texts: Order Status History Complete no longer created, but was in M1 site

texts:
In our M1 site when an order was shipped the status of the order changed to Complete and the Order Status History would get a record showing that the order was Complete.

NB: Note that there is a "Complete" record.

Now in M2, the Order Status History does not get a new record.

NB: No "Complete" record.

Why is that?

Is there any way to make it create this record?

JSON for the example M1 order:

[
  {
    "entity_id": 1235050,
    "parent_id": 444314,
    "is_customer_notified": 2,
    "is_visible_on_front": 0,
    "comment": "Captured amount of $48.38 online. Transaction ID: \"\".",
    "status": "processing",
    "created_at": "2018-08-12T07:48:10",
    "entity_name": "invoice"
  },
  {
    "entity_id": 1235062,
    "parent_id": 444314,
    "is_customer_notified": 1,
    "is_visible_on_front": 0,
    "comment": null,
    "status": "complete",
    "created_at": "2018-08-12T11:39:56",
    "entity_name": "shipment"
  }
]

JSON for the example M2 order:

[
  {
    "entity_id": 1242440,
    "parent_id": 449257,
    "is_customer_notified": null,
    "is_visible_on_front": 0,
    "comment": "Captured amount of $160.90 online. Transaction ID: \"\"",
    "status": "processing",
    "created_at": "2018-09-11T04:08:28",
    "entity_name": "invoice"
  }
]


texts: How do i include a custom phtml file in the list view?

texts:
This is the content from my layout.xml:

<catalog_category_view>
    <reference name="content">
        <block type="mynamespace_mymodule/types_listview"  name="impressions" template="mynamespace/mymodule/listview.phtml"/>
    </reference>
<catalog_category_view>

The content of the listview.phtml is just a text. I want my custom text to be displayed in the list view. How can I achieve that?


texts: my magento 1.9.1 not sending newsletter emails and order email to customers

texts:
my magento is not sending any order or newsletter email: exception log giving following errors:

2016-03-05T10:44:35+00:00 ERR (3):
exception 'Zend_Mail_Protocol_Exception' with message 'Incorrect authentication data
' in /home/sirajand/public_html/includes/src/Zend_Mail_Protocol_Abstract.php:431
Stack trace:
#0 /home/sirajand/public_html/includes/src/Zend_Mail_Protocol_Smtp_Auth_Login.php(95): Zend_Mail_Protocol_Abstract->_expect(235)
#1 /home/sirajand/public_html/includes/src/Zend_Mail_Protocol_Smtp.php(217): Zend_Mail_Protocol_Smtp_Auth_Login->auth()
#2 /home/sirajand/public_html/includes/src/Zend_Mail_Transport_Smtp.php(200): Zend_Mail_Protocol_Smtp->helo('localhost')
#3 /home/sirajand/public_html/includes/src/Zend_Mail_Transport_Abstract.php(348): Zend_Mail_Transport_Smtp->_sendMail()
#4 /home/sirajand/public_html/includes/src/Zend_Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#5 /home/sirajand/public_html/includes/src/Aschroder_SMTPPro_Model_Email_Template.php(132): Zend_Mail->send(Object(Zend_Mail_Transport_Smtp))
#6 /home/sirajand/public_html/includes/src/Mage_Core_Model_Email_Template.php(508): Aschroder_SMTPPro_Model_Email_Template->send(Array, Array, Array)
#7 /home/sirajand/public_html/includes/src/Fooman_EmailAttachments_Model_Core_Email_Template_Mailer.php(42): Mage_Core_Model_Email_Template->sendTransactional('3', 'sales', Array, Array, Array, '1')
#8 /home/sirajand/public_html/includes/src/Mage_Sales_Model_Order.php(1354): Fooman_EmailAttachments_Model_Core_Email_Template_Mailer->send()
#9 /home/sirajand/public_html/includes/src/Mage_Sales_Model_Order.php(1369): Mage_Sales_Model_Order->queueNewOrderEmail(true)
#10 /home/sirajand/public_html/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(139): Mage_Sales_Model_Order->sendNewOrderEmail()
#11 /home/sirajand/public_html/includes/src/__default.php(14098): Mage_Adminhtml_Sales_OrderController->emailAction()
#12 /home/sirajand/public_html/includes/src/__default.php(18515): Mage_Core_Controller_Varien_Action->dispatch('email')
#13 /home/sirajand/public_html/includes/src/__default.php(18045): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#14 /home/sirajand/public_html/includes/src/__default.php(20862): Mage_Core_Controller_Varien_Front->dispatch()
#15 /home/sirajand/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#16 /home/sirajand/public_html/index.php(87): Mage::run('', 'store')
#17 {main}
2016-03-05T10:45:47+00:00 ERR (3):


texts: Create a webhook accessible from an ERP system and not only

texts:
A Magento instance is integrated with an ERP platform. Invoices, payments, and various details are pulled in from that ERP system. However, I need also to push some details back or at least make some changes available through webhooks.
For example, I have the orders table under the Customer Account section. That table has a column called "Delivery Date". The customer can change that and request and early/late delivery date. When that customer changes the delivery date, I need to inform the ERP system that a request has been made, passing some details through that webhook.
What are the steps and how can I achieve this?


texts: Magento2.3: How to create a CSV and JSON file?

texts:
I have successfully got the wishlist collection of customer by referring the below link:

https://www.rakeshjesadiya.com/get-wishlist-collection-of-customer-by-customer-id-magento-2/

Now, I have to create the wishlist collection as a CSV file. Since, I'm new to this, I have no idea where to start.

Could anyone please help me on this?


texts: Throwing exception based on condition in before plugin

texts:
I'm creating a before plugin for the class \Magento\Customer\Controller\Account\EditPost. In the execute method I want to throw an Exception based on certain condition but the plugin is showing output like this.

I want to print proper exception message in notification area like this.

Here is my Plugin Class

class EditPost {

        public function beforeExecute(\Magento\Customer\Controller\Account\EditPost $subject) {

            throw new \Exception('Exception trigger');
            return $subject;

        }
}

What I'm doing wrong here.


texts: Override templates no effect - magento 2.0.1?

texts:
I try to override listing.phtml for the purpose of remove add to cart button from widget. I follow  this link

But no effects will be happen.I am using customize theme which extends to magento blank. The details are

Default template path:

/var/www/html/magento2/vendor/magento/module-catalog/view/frontend/templates/product/listing.phtml

Customize template path to override default template:

/var/www/html/magento2/app/design/frontend/ChennaiBox/Style/Magento_Catalog/templates/product/listing.phtml

In customize templates I am just remove one div tag(class="product details").

I am wondering why its not get reflect.

Thanks in advance.


texts:
<?xml version="1.0"?>
<layout version="0.1.0">
<catalogsearch_result_index>
    <reference name="product_list_toolbar">
        <action method="addPagerLimit"><mode>grid</mode><limit>30</limit></action>
        <action method="addPagerLimit"><mode>list</mode><limit>30</limit></action>
    </reference>
</catalogsearch_result_index>
</layout>

The limiter selectbox in pagination toolbar, indeed displays "Show 30" as selected value. But in product list, there are only 9 products displayed in each results page.

setting at backend  system > conf > Catalog > catalog>frontend

**Search result at frondend **


texts: Magento 2 - disabled module still apears in admin panel

texts:
I disabled custom module
The disabled module was showing a textarea for custom attribute in Category form
However, after disabling the module, the textarea is still there. I can't get rid of it.

What I tried:
- setup:upgrade didn't help
- regenerating admin template didn't help
- module:disable with --clear-static-content didn't help

Please let me know what I'm missing here. Thanks!


texts:
How do I get MOQ of the bundle products? since Bundle product itself doesn't need to set MOQ itself, it depends on the children products. But how do I determine which children MOQ that the bundle is using?
Thanks


texts: can I embed products or categories from Magento in to another site?

texts:
I have a Magento site up and running and a client that would like to embed some of my products, or a whole product category, on his own site.

Ideally he is looking to add some sort of iframe to his site that displays the products and allows users to check out at the end...

Is this possible or are there any extensions for it?


texts: Magento 2: Keep use default value when Updating product attribute programmatically in store view level

texts:
I have a dropdown product attribute in store view level that i need to update programmatically for specific store:
I tried to update the product attribute programmatically like this:
// \Magento\Catalog\Model\Product\Action $_productAction
$storeId = 3;
$productId = 35;
$this->productAction->updateAttributes(array(
            $productId
        ) , array('test_id'=>30), $storeId);

The product attribute value is updated successfully.
The problem is when i checked the product attribute value to use default value like below:

it will be unchecked if I run those code, even though i set the product attribute value same as the default value

How can i avoid or prevent this and keep value checked, even if i update the value same as the default product attribute value ?


texts: Magento2 remove slider of gallery images on product detail page

texts:
I'm using Magento2.2.5 Version, On product detail page by default gallery images
showing in the slider.

Here is the screenshot for the same:-

http://nimb.ws/YrIb2P

But I want to show, gallery images without any slider.

You can see below-expected result screesnhot:-

http://nimb.ws/ZA6vMD

I tried to modify view.xml as well as the gallery.phtml but not able to get my expected result.

So please help me.


texts: Magento 2 SEO Multi-stores share CMS pages

texts:
I built a module that supposed to solve the following issue:
a multi-site setup with some CMS pages that are shared across the different websites. The problem that we are having is that this is causing duplicate content issues and affecting the SEO rankings.
As well I have to add a new config in the admin area which will be filled with store language that is different than magento language for example "en-us" and "en-gb" this because the meta tag must have specific values for each country.

The meta tag will be structures as follows:

I have uploaded the code to GitHub repo:

https://github.com/AAbbadi/M2-Language

I want someone to let me know if this repo will solve the issue ? as well what is the best practice to solve this.

P.S: I'm Magento self learner. and I was unable to find someone close to me that can help me!


texts: Overriding the dev/tests/integration/framework/Magento/TestFramework/Config.php class

texts:
I want to override the

dev/tests/integration/framework/Magento/TestFramework/Config.php class.

Can anyone have an idea about how to override classes inside dev folder?


texts: Magento 2: which event fires before a product gets added into cart on the admin side?

texts: When an admin wants to reorder an item I want to check whether that item is enabled or disabled and if its disabled I want to skip that product based on its SKUs from adding into my cart. Which event fires on the admin side that can help me to adding this feature into my magento site?


texts: Magento 2.3.4. How does an AMP page get created?

texts: I got this question as to how is an AMP page created because Google Search Console over and over again finds faults with the tags/attributes saying they are not allowed in an AMP page. All that I can edit is the content  of category pages and the product pages. Could you please point me in the right direction to some authentic documentation that I can rely on for better understanding of AMP?


texts: Unable to limit product collection size in Magento 1.9.2.3 with custom module

texts:
I am using a custom module developed by third party, and i have probem with limiting product collections on my home page by :

$collection->setPageSize(10);

But the limit will work fine if switch the pager from

20 products per page to show all

The code is :

$collection = Mage::getResourceModel('catalog/product_collection')->addCategoryFilter($category);
    $collection->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
    $collection->getSelect()->order(new Zend_Db_Expr('RAND()'));
    $collection = $this->_addProductAttributesAndPrices($collection)->addStoreFilter()
                        ->addAttributeToFilter('is_deal', 1)
                        ->addAttributeToFilter('deal_approved', 1)
                        ->addAttributeToFilter('deal_type',array(
                                array('attribute'=>'deal_type','neq'=>  AdolMedia_DailyDeals_Model_Product_Attribute_Source_Dealtype::FEATURED_DEAL )
                        ))
                        ->addFieldToFilter('deal_cities',array(
                                array('attribute'=>'deal_cities','finset'=> $current_city),
                                array('attribute'=>'deal_cities', 'eq'=> 0),
                                array('attribute'=>'deal_cities', 'eq'=>  new Zend_Db_Expr('null'))
                        ),'left')
                        ->addAttributeToFilter('deal_from_date', array('or'=> array(
                            0 => array('date' => true, 'to' => $dealTime),
                            1 => array('is' => new Zend_Db_Expr('null')))
                        ), 'left')
                        ->addAttributeToFilter('deal_to_date', array('or'=> array(
                            0 => array('date' => true, 'from' => $dealTime),
                            1 => array('is' => new Zend_Db_Expr('null')))
                        ), 'left')
                        ->addAttributeToSort('deal_from_date', 'desc');
    $collection->setPageSize(10); // not working
    $this->setProductCollection($collection);


texts: How can i get This Product is already in your cart magento

texts: i  want to show a popup if the product was added again or updated. i mean how can i get the massage "This Product is already in your cart "when second time i added product to shopping cart ....?


texts: Categories visible only After login and Logout?

texts:
I just played around with an already built Magento application. The client had added the products from admin panel and it was not visible on in website.

I referred to the theme documentation and it said that the category tree that was currently implemented in the application was wrong. So I made the necessary changes to expect the categories to be visible but no luck. After playing more I just signed up and logged in to the website and could see the respective Categories in the header during login and even after logout.

I didn't understand what happened here. After clearing cache of browser and visiting the site again, the categories disappeared. I want the categories to appear on the website even without user registration and login/logout. How can I implement this task?


texts: How to refund only part of an order programmatically

texts:
I am looking for a way to programmatically refund part of an order within a custom module.
I have been following this blog post (https://www.rakeshjesadiya.com/create-creditmemo-for-order-item-in-magento-2/) but there is no creditmemo id being generated when the load() method id called on line 41.
I'm not entirely sure this is the correct way to go about it any more either, as this blog post dates back to AUGUST 9, 2018, so I was wondering if anyone knows of a better way to approach this at all?
Cheers guys
Update
So I'm using the Magento\Sales\Api\RefundOrderInterface class to call the execute() method which requires the 2nd parameter to be an array of items of type Magento\Sales\Api\Data\CreditmemoItemCreationInterface.
I've added the Magento\Sales\Model\Order\Creditmemo\ItemCreationFactory class and I'm setting my items in a loop as follows:
$creditmemoItems = [];

foreach ($order->getAllVisibleItems() as $item) {

    $creditmemoItem = $this->creditmemoItemFactory->create();
    $creditmemoItem->setOrderItemId($item->getId());
    $creditmemoItem->setQty($item->getQtyOrdered());

    $creditmemoItems[] = $creditmemoItem;
}

After that, I call the execute method for the refundOrder class:
$this->refundOrder->execute(
    $order->getId(),
    $creditmemoItems ,
    true,
    false
);

the operation fails and throws the following error in the logs
Exception #0 (Magento\Sales\Exception\DocumentValidationException): Creditmemo Document Validation Error(s):
The order does not allow a creditmemo to be created.
The most money available to refund is 0.


texts: Magento 2 - custom product search function

texts:
Currently i am working on the custom product search function. Please check the image

These form already done on the frontend, using these form values i need to filter available products on the database.

Destination : is multiple location (Eg: Newyork, Newjercy, etc)

So on the admin product edit page need to save below values,

Pickup Location : Product Available Date : Product Available Time

Newyork         : 20/02/2020             : 10.50

Newjercy        : 22/02/2020             : 18.30

....

....

Similarly,  I dont know how to save values likes this and implement this concept.

If you have an idea, share with me. Thanks in advance..!


texts:
Since the German translation of "Grid" within the german language pack is currently wrong (see here), I wanted to override it using a custom language pack (since you cannot override translations of translation packages within a module or a theme). I used the instructions provided here and also looked at the documentation.

This is what I have so far:

app/code/InspiredMinds/language-de_de/registration.php:

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
    'InspiredMinds_de_de',
    __DIR__
);

app/code/InspiredMinds/language-de_de/language.xml:

<?xml version="1.0"?>
<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd">
    de_DE
    <vendor>InspiredMinds</vendor>
    <package>de_de</package>
    <use vendor="mageplaza" package="de_de" />
</language>

app/code/InspiredMinds/language-de_de/de_DE.csv:

"Grid","Raster",module,Magento_Catalog

Instead of

app/code/InspiredMinds/language-de_de

I also tried

app/i18n/InspiredMinds/de_de

I cleaned all caches and also ran a setup:di:compile (in case that is necessary for language packs). It still does not work.

What am I missing?


texts: Magento 2 Getting js errors on home page and not only TypeError: $.widget is not a function, TypeError: $.ui is undefined

texts:
I am getting these errors on the console.

TypeError: $.widget is not a function
TypeError: $.ui is undefined

I thought maybe it's something wrong with the order of the js files are loading on the head section so this is how the head part is loading the files

`

<script  type="text/javascript"  src="http://eshop.xxx.gr/pub/static/frontend/Sm/revo/en_US/mage/requirejs/mixins.js"></script>
<script  type="text/javascript"  src="http://eshop.xxx.gr/pub/static/_requirejs/frontend/Sm/revo/en_US/requirejs-config.js"></script>
<script  type="text/javascript"  data-requiremodule="jquery" src="http://eshop.xxx.gr/pub/static/frontend/Sm/revo/en_US/jquery.js"></script>
<script  type="text/javascript"  data-requiremodule="jquery" src="http://eshop.xxx.gr/pub/static/frontend/Sm/revo/en_US/js/bootstrap/bootstrap.min.js"></script>
<script  type="text/javascript"  data-requiremodule="jquery" src="http://eshop.xxx.gr/pub/static/frontend/Sm/revo/en_US/js/owl.carousel.js"></script>
<script  type="text/javascript"  data-requiremodule="jquery" src="http://eshop.xxx.gr/pub/static/frontend/Sm/revo/en_US/js/lightslider.js"></script>
<script  type="text/javascript"  data-requiremodule="jquery" src="http://eshop.xxx.gr/pub/static/frontend/Sm/revo/en_US/js/jquery.elevatezoom.js"></script>
<script  type="text/javascript"  data-requiremodule="jquery" src="http://eshop.xxx.gr/pub/static/frontend/Sm/revo/en_US/js/jquery.cookie.min.js"></script>
<script  type="text/javascript"  data-requiremodule="jquery" src="http://eshop.xxx.gr/pub/static/frontend/Sm/revo/en_US/js/jquery.fancybox.pack.js"></script>
<script  type="text/javascript"  data-requiremodule="jquery" src="http://eshop.xxx.gr/pub/static/frontend/Sm/revo/en_US/js/jquery.fancybox-buttons.js"></script>
<script  type="text/javascript"  data-requiremodule="jquery" src="http://eshop.xxx.gr/pub/static/frontend/Sm/revo/en_US/js/jquery.fancybox-thumbs.js"></script>
<script  type="text/javascript"  data-requiremodule="jquery" src="http://eshop.xxx.gr/pub/static/frontend/Sm/revo/en_US/js/jquery.mousewheel-3.0.6.pack.js"></script>
<script  type="text/javascript"  data-requiremodule="jquery" src="http://eshop.xxx.gr/pub/static/frontend/Sm/revo/en_US/js/easyResponsiveTabs.js"></script>
<script  type="text/javascript"  data-requiremodule="jquery" src="http://eshop.xxx.gr/pub/static/frontend/Sm/revo/en_US/js/yttheme.js"></script>

Also When Click to open Quick View i get a

TypeError: $(...).elevateZoom is not a function

Despite of the file being loaded on the head section


texts: Magento 2: How can I do an integration with magento 2 and sap business one?

texts:
i want to create a integration with magento 2 and SAP B1, I created a web application in magento 2 I gave it a name and I gave it permission to API and it was saved

then create a new role, assign the roles that the API will use, then create the user who will use the roles you previously believed

when I make the call

https: // HOST_IP / rest / V1 / customer / me

give me this back

 The request does not match any route.

Can you tell me if I'm forgetting a step or something?


texts:
I have implemented the e-commerce tracking of analytics with magento but now I want to add to my analytics the Site Speed Rate. If I put the code of site speed rate in the header of the site i have two trackings and if I remove analytics from magento I don't have any e-commerce tracking.

Someone can tell me how can I do it?


texts: exception during cache and session cleaning magento 1.9.3

texts: I'm trying to install Magento 1.9 and I got this error , how can I solved it,


texts:
I have successfully created a new module in app/code/CompanyName_ModuleName and created etc/module.xml and after that run following command from my terminal in my sudo php bin/magento setup:upgrade my module is showing in config.xml file and it's value is set 1. But as soon as I hit the Url in browser I found this error/exception

  exception 'Magento\Framework\Exception\LocalizedException' with message 'Can't create directory /var/www/html/hml/var/generation/Magento/Framework/App/Response/Http/.' in /var/www/html/hml/vendor/magento/framework/Code/Generator.php:103 Stack trace: #0 /var/www/html/hml/vendor/magento/framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\Framewo...') #1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\Framewo...') #2 [internal function]: spl_autoload_call('Magento\Framewo...') #3 /var/www/html/hml/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\Framewo...') #4 /var/www/html/hml/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\Framewo...') #5 /var/www/html/hml/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(71): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\Framewo...') #6 /var/www/html/hml/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...') #7 /var/www/html/hml/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...') #8 /var/www/html/hml/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'response', 'Magento\Framewo...') #9 /var/www/html/hml/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Framewo...', Array, Array) #10 /var/www/html/hml/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...', Array) #11 /var/www/html/hml/vendor/magento/framework/App/Bootstrap.php(233): Magento\Framework\ObjectManager\ObjectManager->create('Magento\Framewo...', Array) #12 /var/www/html/hml/index.php(38): Magento\Framework\App\Bootstrap->createApplication('Magento\Framewo...') #13 {main}'

Please help me out...Thanks in advance.


texts: How can I get customer address fields to show on store level only (not website level)?

texts:
By default customer address fields are set at website level rather than store level. I would like to add the customer tax/VAT field to show on one store view ("codice fiscale" for Italy) but not have that field show with other store views.

I have tried copying the core 'customer.xml' to somewhere local, amending it to show tax/vat at store level. That shows the needed changes in admin system config but it does not work in the front end. I now have the tax/VAT box showing everywhere on the front end.

Additionally I would like to add a regex validation for the 'codice fiscale' using the latest 1.9 theme. I think I can add the custom regex and get it to work, however if anyone has any advice on setting customer address options at store level that would be most helpful.


texts: How to disable all categories via programatically in magento 2

texts:
I have tried to disable categories in Magento 2
I have tried to achieve this via PHP script like below
<?php

use \Magento\Framework\App\Bootstrap;

require __DIR__ . '/../app/bootstrap.php';

$params = $_SERVER;
$bootstrap = Bootstrap::create(BP, $params);

$objectManager = $bootstrap->getObjectManager();
$state = $objectManager->get('\Magento\Framework\App\State');
$state->setAreaCode('frontend');

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$categoryFactory = $objectManager->create('Magento\Catalog\Model\ResourceModel\Category\CollectionFactory');
$categories = $categoryFactory->create()
    ->addAttributeToSelect('*'); //categories from current store will be fetched
echo count($categories);
foreach ($categories as $category){
    $category_id = $category->getId();
    echo $category_id."<br>";

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $collection = $objectManager ->get('Magento\Catalog\Model\Category')->load($category_id);
    $collection->setData('is_active', 0);
    $collection->save();
    echo "success";
}
?>

But I got following error

Fatal error: Uncaught Magento\Framework\Exception\LocalizedException:
Invalid URL key in
/var/www/html/vkm/vendor/magento/module-catalog-url-rewrite/Observer/CategoryUrlPathAutogeneratorObserver.php:93

Please provide a solution to disable categories in Magento 2


texts: Customer Attributes in custom tab in Manage Customer in admin

texts:
I am new to Magento. I want a solution for how to add custom attributes to custom tab in manage customer.

How is it possible?


texts: How to send Transaction email from controller in Magento 2

texts:
I have code like below in Magento1 to send Transaction email to customer

public function createPostAction()
{
  $user = Mage::getModel('customer/customer')->setId(46210);
  $user->save();
  $this->sendNewSubUserAccountEmail($user);
}

 private function sendNewSubUserAccountEmail($customer, $backUrl = '')
{
    $translate = Mage::getSingleton('core/translate');
    $translate->setTranslateInline(false);

    $storeId = ($customer->getStoreId() == '0')?$customer->getSendemailStoreId():$customer->getStoreId();
    if ($customer->getWebsiteId() != '0' && $storeId == '0') {
        $storeIds = Mage::app()->getWebsite($customer->getWebsiteId())->getStoreIds();
        reset($storeIds);
        $storeId = current($storeIds);
    }

    $emailTemplate = Mage::getStoreConfig('customer/create_account/sub_user_email', $storeId);

    if (strcasecmp($emailTemplate, 'customer_create_account_sub_user_email') == 0) {
        $emailTemplate = Mage::getStoreConfig('customer/create_account/email_template', $storeId);
    }

    Mage::getModel('core/email_template')
        ->setDesignConfig(array('area'=>'frontend', 'store'=>$storeId))
        ->sendTransactional(
            $emailTemplate,
            Mage::getStoreConfig('customer/create_account/email_identity', $storeId),
            $customer->getEmail(),
            $customer->getName(),
            array('customer' => $customer, 'back_url' => $backUrl));

    $translate->setTranslateInline(true);

    return $customer;
}

How can the same code be implemented in Magento2?


texts:
I have to put condition for maximum allowd order weight. Have you any ideas about this please answer.

Thank you


texts: Magento 2: target="_blank" in UI Listing Action Links

texts:
In Magento 2, you can create "Action" links for your UI grid.  Magento itself does this on the CMS Listing Grid here

#File: vendor/magento/module-cms/Ui/Component/Listing/Column/PageActions.php
//...
$item[$name]['edit'] = [
    'href' => $this->urlBuilder->getUrl($this->editUrl, ['page_id' => $item['page_id']]),
    'label' => __('Edit')
];

//...

Is there a way to have these action links open in a new window? (the same way an Link Test would work.  I've tried added both a target and window to the array that creates the link, but that doesn't appear to work.

If I look at the source of a rendered link

View Log

I see a bunch of modern abstract javascript who's ultimate source is difficult to track down.

The specific question I'd like answered is "how to make action links open in a new window using the provided UI abstractions" (I know I could add my own javascript to the page that handles it, but that seems like a hack solution for something that's so simple in plain old HTML)

A larger question that I'll accepts an answer for is

Where are the action links rendered
Where the javascript source for the $col.getActionHandler... code below


texts: Same Product Different Image In Category

texts:
I Have a product for example, t-shirt that is added to men's category and women's category. Now I want to display a t-shirt with woman's image in women's category & t-shirt with man's image in men's category.

Is there any possibility for the above without creating the same product again.

If possible kindly provide idea for it.


texts: magento 2 checkout whats is config & deps?

texts:
Does anyone know about config & deps in checkout like below code -

<item name="config" xsi:type="array">
      <item name="deps" xsi:type="array">
            <item name="0" xsi:type="string">checkout.steps.shipping-step.shippingAddress</item>
                  <item name="1" xsi:type="string">checkout.steps.billing-step.payment</item>
      </item>
</item>


texts: Call to undefined method getConfigurableAttributeCollection()

texts:
When I added Configurable products on the cart then added Simple product on the cart will facing error check screenshot

but when we added Simple product on the cart then added Configurable product on the cart after working fine


texts:
I'm trying to change the layout of the success page with an observer at Mage_Checkout_OnepageController::successAction() on Mage::dispatchEvent('checkout_onepage_controller_success_action', array('order_ids' => array($lastOrderId)));
This event is loaded after $this->loadLayout(); and before $this->loadLayoutUpdates();

My Observer

$update = Mage::app()->getLayout()->getUpdate();
$update->addHandle('my_personalized_handle');
$update->removeHandle('the_old_hanle');

Up to that point it works fine and on the controller I got the correct list of handles before the render. But at the render process it just ignores all what I changed even if I do $this->loadLayoutUpdates(); directly in the controller.

So at this point I'm a bit confused.

-== EDIT ==-

The other solution would be to redirect to another page than the success page, that would be to send a correct URL to Mage_Checkout_OnepageController::saveOrderAction() for $redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();, I'm able to change the session when they land on the checkout page, but when they validate the payment the getRedirectUrl is empty and doesn't consider my new URL.

Do I set this problem as a second post?


texts: magento2:unable to save the data in newly added column of sales_order_grid table

texts:
trying to save the my oven data in newly added column of sales_order_grid but unable to to do so.

However, I can save my custom the data in sales_order table where I have added one extra column.
I am adding the data in sales_order table by getting below observer event.

$obj = $observer->getEvent()->getOrder();
$obj->setMyName($value);

same data is not saving in sales_order_grid table having same column name..

is there there anyway or anything alternative to achieve this???


texts: Minicart and header links not functioning in the catalog.topnav section

texts: If Minicart and header links in header.panel everything working, after moving elements to catalog.topnav its not working. Any help thanks.


texts: Magento2: How do I get products back order setting?

texts:
I am trying to add a block in catalog_product_view.xml to display special info when back orders are allowed on an item.  I can't figure out how to get the backorder setting for the product though.  I can get the quantity no problem (I am checking for backorder allowed items but with quantity in stock).  No matter what I do I can only seemingly get the default config setting of 0 and not the items setting.  StockStateInterface has no getBackorders function and I can't seem to get StockItemInterface to give me the right info.

Here is my current backorder.phtml:

<?php
$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_product = $block->getProduct();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$StockState = $objectManager->get('\Magento\CatalogInventory\Api\StockStateInterface');
$_qty = $StockState->getStockQty($_product->getId(), $_product->getStore()->getWebsiteId());

$ConfigState = $objectManager->get('\Magento\CatalogInventory\Api\Data\StockItemInterface');
$ConfigState->setProductId($_product->getId());
$_backorder = $ConfigState->getBackorders();

?>

<div class="product-info-backorder">
Qty:
<?php echo $_qty; ?>
Backorder:
<?php echo $_backorder;?>
</div>


texts: magento category category collection show include_in_menu

texts:
i have code that show all category with details but i want to show "include_in_menu" yes or no in output array also .

i am using below code :

$collection = Mage::getModel("catalog/category")->getCollection()->addAttributeToSelect("name")->addAttributeToFilter("is_active", "1")->setLoadProductCount(true)->setProductStoreId($store);

Array output that i get :

"categories": [
    {
        "category_id": "11",
        "parent_id": "3",
        "name": "adbcd",
        "is_active": "1",
        "level": "2",
        "products_count": 0,
        "display_mode": "PRODUCTS",
        "thumbnail_url": null,
        "children": 10
    },
    {
        "category_id": "12",
        "parent_id": "85",
        "name": "abc",
        "is_active": "1",
        "level": "3",
        "products_count": 42,
        "display_mode": "PRODUCTS",
        "thumbnail_url": null,
        "children": 0
    },

i want to add is include_in_menu to array how can it be done


texts:
Beforehand I have to tell: I'm a total n00b on Magento and what I need to know is more a "common practice" or "standard" about how is something achieved in Magento, since I have to maintain (in record time) a Magento distribution (perhaps the previous developers created a dirty way to do what I will ask, but if I don't know the standard ways, I'll have even less chances to guess the dirty ones). For the explained below, I don't expect you hit in the nail about, but give me some guidance about.

Let's see...

When I send a standard search query to /index.php/catalogsearch/result/?q=, I find products not present in many "states". By "states" I mean possible discrete values of "estado" attribute (a custom attribute for my Products).

As I can see, Products having certain values for "estado" are not shown in the results (even when Visibility is set to include those products in the Search results).

Question: Is there a place where I can setup a custom filter to use for my product list (as obtained from the search query) so I can keep only products in a certain state? What does Magento support, as standard, regarding that?

For "place" I mean an option in the Admin backend or, as the very last option, a chunk of code, event, callback, hook, interceptor, middleware or whatever (I'm a n00b so I don't know the true term used in magento) is used in these cases to intercept the query.

Notes: In app/design/frontend/caramel/template/catalog/product/list.phtml the first lines before iteration are:

<?php
    $_productCollection=$this->getLoadedProductCollection();
    $_helper = $this->helper('catalog/output');
?>
<?php if(!$_productCollection->count()): ?>

<?php echo $this->__('There are no products matching the selection.') ?>

No encontraste lo que buscabas, <a href="<?php $_SERVER['HTTP_HOST']?>/index.php/pidenos?tipo=pidenos">p&iacute;denos y lo buscamos por ti.

<?php else: ?>

And as I can see, the filter is not applied here but it comes from somewhere else, and I want to know where does it come from (usually).


texts: how to change the position of search box in front end?

texts: I am trying to extend the Header (logo, search box and cart), but those files are the different location. I don't know how to adjust those. Could you please suggest me on this.


texts:
We have a situation that the Magento cache is refreshed every night automatically. Afther this a script runs which visits every page to build the cache and every page will be fast. This works, however when someone is working in the admin (changing products, changing textpages etc.) the cache becomes invalid and I have to visit the product page again to build the cache.

My question is, when does the cache become invalid and how can we prevent this. Thanks in advance.


texts: Can't get "products ordered" collection with configurable products included (top 10 products)

texts:
I'm trying to develop a module to display top 10 bestseller products for each category. (I'll use it on home page for overall top 10 products too)

I have bundle, configurable and simple products in my store. And I would like to list top 10 for category A like this

Product X (simple)
Product Y (configurable - with 3 child products, all childs are invisible on store)
Product Z (bundle)
Product W (simple)...

When I check the reports section, the bestseller products report doesnt list configurable products as a parent product, instead it lists all child products as a seperate sales record. That is acceptable if I would like to see which child products performed better but it is useless at the frontend. I can see the report I need at Reports > Product > Products Ordered section, I've tried to debug its execution to see how it populates the list there. It's using soldAction at the "Mage/Adminhtml/controllers/Report/ProductController.php".

I am currently using the below code for testing, you can see the method I'm using to populate collection on model file. This doesn't list the configurable/bundle products, it just skips them and lists single products only.

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Fit_Statistics>
            <version>0.1.0</version>
        </Fit_Statistics>
    </modules>
    <global>
        <models>
            <fit_statistics>
                <class>Fit_Statistics_Model</class>
                <resourceModel>fit_statistics_resource</resourceModel>
            </fit_statistics>
            <fit_statistics_resource>
                <class>Fit_Statistics_Model_Resource</class>
            </fit_statistics_resource>
        </models>
        <blocks>
            <fit_statistics>
                <class>Fit_Statistics_Block</class>
            </fit_statistics>
        </blocks>
        <helpers>
            <fit_statistics>
                <class>Fit_Statistics_Helper</class>
            </fit_statistics>
        </helpers>
    </global>
</config>

Model/Top/Overall.php

class Fit_Statistics_Model_Top_Overall extends Mage_Core_Model_Abstract
{

    public function getBestsellersOverall()
    {
        $storeId = Mage::app()->getStore()->getId();

        $products = Mage::getResourceModel('reports/product_collection')->addOrderedQty()->addAttributeToSelect(array('name', 'price', 'small_image')
        )
                        ->setStoreId($storeId)->addStoreFilter($storeId)->setOrder('ordered_qty', 'desc'); //best sellers on top

        return $products;
    }
}

Block/Top/Overall.php

class Fit_Statistics_Block_Top_Overall extends Mage_Core_Block_Template {
    public function getBestsellerProducts()
    {
        $arr_products = array();
        $products     = Mage::getModel("fit_statistics/top_overall")->getBestsellersOverall();

        foreach($products as $product) {
            $arr_products[] = array('id' => $product->getId(), 'name' => $product->getName(), 'url' => $product->getProductUrl(),);
        }

        return $arr_products;
    }
}

frontend/base/default/template/fit_statistics/top/overall.phtml

<?php
$products = $this->getBestsellerProducts();
?>

Bestseller Products

    <?php if (is_array($products) && count($products)) { ?>
        <?php foreach($products as $product) { ?>

                <a href="<?php echo $product['url'] ?>"><?php echo $product['name'] ?>

        <?php } ?>
    <?php } ?>

frontend CMS block

{{block type="fit_statistics/recent_products" name="fit_statistics_recent_products" template="fit_statistics/recent/products.phtml"}}


texts: Magento 2.3 There is no Start option in Newsletter queue

texts:
I want to send Newsletters via magento 2.3 newsletter. But in newsletter queue , no start action available
can anybody have a solution for this?. what should i do for resolve this? I didn't configure any extension for newsletters.


texts: Magento 2.2 is not Installing i have VPS

texts:
i have vps server from godaddy.
i tried to install magento it gives me error. i also fulfilled all magento requirements by easyapache4..
With PHP7, Magento 2 require these PHP extensions on server:

bc-math
curl
gd, ImageMagick 6.3.7 (or later) or both
intl
PDO/MySQL
SimpleXML
soap
xml
xsl
zipmbstring
mbstring
mcrypt
mhash
OpenSSL

still, when I install Magento it gives me following error. even when I have uploaded copy of Magento from its official website. after extract, it doesn't let me go through the installation process.


texts: Does Magento coupons support rest value?

texts:
Customers in our store can buy gift certificates. We create them in the backend and then handwrite a gift card with that coupon code. If a customer now buys a 50€ coupon and the giftet person only selects stuff for 30€ in the online store, what happens with the rest value? In Germany there is a law that this rest value must either be available with that coupon or we have to pay it out. Of course, we prefer the first solution, but it this possible within the magento coupon stuff?

We use Magento CE 1.7.0.2 with NO extension for the coupons. Just the regular method.

I have postet this also on SE before I found this site.


texts: Magento2.3 install extention via composer but in app/code

texts:
I have an extension which was installed in app/code and override from app/code, now I have only the zip for the composer installation, is it a way to install this extension by composer but in app/code/extensionsuppliername/extensionname instead of vendor/?
Thank you in advance
ps: in case of minus please let me know why so I can improve my post


texts: Order comfirmation email is not sent to customer Magento 2.1.0?

texts:
Order confirmation emails not working in magento 2.1.0, I have seen a message in admin order view page:

Order # 8000001098 (The order confirmation email is not sent)

Other transactional emails are working except order confirmation email.
ALso, I have checked

Asynchronous sending is disabled
Disable Email Communications is set to No

But still it is not working.
Check screenshot: http://nimb.ws/AUnR1c
What is the issue?


texts: stand up independent version of Magento 2

texts: I'm an entry level web designer and my boss just asked me to research if it was possible to "stand up and independent version of Magento 2". I'm very new to CMS and have no clue where to start this process, if it's at all possible. Does someone know what he is asking for and if it's doable? Any/all help is greatly appreciated!


texts: Products just redirect to search results page

texts:
All of my products are now redirecting to catalog search.

i.e.

/bonfire-firma-3-in-1-stretch-mens-snowboard-jacket-2019.html

goes to

/catalogsearch/result/?q=bonfire-firma-3-in-1-stretch-mens-snowboard-jacket-2019

What can I do to fix this ?

I have these modules installed:

Aheadworks_OneStepCheckout
Amasty_Base
Amasty_Blog
Amasty_CrossLinks
Amasty_CustomerAttributes
Amasty_Feed
Amasty_Label
Amasty_Meta
Amasty_Scroll
Amasty_SeoHtmlSitemap
Amasty_SeoRichData
Amasty_SeoSingleUrl
Amasty_SeoToolKit
Amasty_Shopby
Amasty_ShopbyBase
Amasty_ShopbyBrand
Amasty_ShopbyPage
Amasty_ShopbySeo
Amasty_Sorting
Amasty_XmlSitemap
Amasty_Xsearch
Amazon_Core
Amazon_Login
Amazon_Payment
Anowave_Ec
Anowave_Package
Auctane_Api
Dotdigitalgroup_Email
Iazel_RegenProductUrl
Klarna_Core
Klarna_Kp
Klarna_Ordermanagement
Kodal_AmastyBrandLink
Kodal_AmastyLabelMod
Kodal_AmastyShopByMod
Kodal_CheckoutMod
Kodal_CompareMod
Kodal_Contact
Kodal_CustomImage
Kodal_GetCustomVariable
Kodal_ProductIcons
Kodal_QuickFeaturedProducts
Kodal_ShippingCountdown
Kodal_ShopbyBrand
Kodal_Sizeify
Kodal_StockOptions
Kodal_TermsConditionsPage
Kodal_UbMegamenuMod
Kodal_WishlistMod
Magento_AdminNotification
Magento_AdvancedPricingImportExport
Magento_Analytics
Magento_Authorization
Magento_Authorizenet
Magento_Backend
Magento_Backup
Magento_Braintree
Magento_Bundle
Magento_BundleImportExport
Magento_CacheInvalidate
Magento_Captcha
Magento_Catalog
Magento_CatalogAnalytics
Magento_CatalogImportExport
Magento_CatalogInventory
Magento_CatalogRule
Magento_CatalogRuleConfigurable
Magento_CatalogSearch
Magento_CatalogUrlRewrite
Magento_CatalogWidget
Magento_Checkout
Magento_CheckoutAgreements
Magento_Cms
Magento_CmsUrlRewrite
Magento_Config
Magento_ConfigurableImportExport
Magento_ConfigurableProduct
Magento_ConfigurableProductSales
Magento_Contact
Magento_Cookie
Magento_Cron
Magento_CurrencySymbol
Magento_Customer
Magento_CustomerAnalytics
Magento_CustomerImportExport
Magento_Deploy
Magento_Developer
Magento_Dhl
Magento_Directory
Magento_Downloadable
Magento_DownloadableImportExport
Magento_Eav
Magento_Email
Magento_EncryptionKey
Magento_Fedex
Magento_GiftMessage
Magento_GoogleAdwords
Magento_GoogleAnalytics
Magento_GoogleOptimizer
Magento_GroupedImportExport
Magento_GroupedProduct
Magento_ImportExport
Magento_Indexer
Magento_InstantPurchase
Magento_Integration
Magento_LayeredNavigation
Magento_Marketplace
Magento_MediaStorage
Magento_Msrp
Magento_Multishipping
Magento_NewRelicReporting
Magento_Newsletter
Magento_OfflinePayments
Magento_OfflineShipping
Magento_PageCache
Magento_Payment
Magento_Paypal
Magento_Persistent
Magento_ProductAlert
Magento_ProductVideo
Magento_Quote
Magento_QuoteAnalytics
Magento_ReleaseNotification
Magento_Reports
Magento_RequireJs
Magento_Review
Magento_ReviewAnalytics
Magento_Robots
Magento_Rss
Magento_Rule
Magento_Sales
Magento_SalesAnalytics
Magento_SalesInventory
Magento_SalesRule
Magento_SalesSequence
Magento_SampleData
Magento_Search
Magento_Security
Magento_SendFriend
Magento_Shipping
Magento_Signifyd
Magento_Sitemap
Magento_Store
Magento_Swagger
Magento_SwaggerWebapi
Magento_Swatches
Magento_SwatchesLayeredNavigation
Magento_Tax
Magento_TaxImportExport
Magento_Theme
Magento_Translation
Magento_Ui
Magento_Ups
Magento_UrlRewrite
Magento_User
Magento_Usps
Magento_Variable
Magento_Vault
Magento_Version
Magento_Webapi
Magento_WebapiSecurity
Magento_Weee
Magento_Widget
Magento_Wishlist
Magento_WishlistAnalytics
Mageplaza_ProductFeed
Magestore_Appadmin
Magestore_Payment
Magestore_Webpos
Magestore_WebposAuthorizenet
Magestore_WebposBambora
Magestore_WebposIntegration
Magestore_WebposPaynl
Magestore_WebposPaypal
Magestore_WebposStripe
Magestore_WebposTyro
MGS_Ajaxscroll
MGS_Core
MSP_Common
MSP_DevTools
Temando_Shipping
Ubertheme_UbMegaMenu
Vertex_Tax

Thanks.


texts: Owl carousel product gallery image in fotorama full screen

texts:
I have created a custom photo gallery with owl carousel for product image.
but now no more able to open image in fotorama full screen.
Is there any way so owl-carosel image click open in fotorama full screen?


texts: Magento2: how to add a custom import adapter?

texts:
I want to extend the catalog import to support xml files. At this time it only supports csv and zip.

The source adapter is detected inside Magento\ImportExport\Model\Import\Adapter using file extension in the factory method:

$adapterClass = 'Magento\ImportExport\Model\Import\Source\\' . ucfirst(strtolower($type));

    if (!class_exists($adapterClass)) {
        throw new \Magento\Framework\Exception\LocalizedException(
            __('\'%1\' file extension is not supported', $type)
        );
    }
    $adapter = new $adapterClass($source, $directory, $options);

How can I add another adapter type?

At first I tought that a preference could be the right way, but preferences can't be used in this case because you can only specify preferences for injectable classes and this isn't injectable.

Actually this class is essentially a copy paste from Magento 1 Mage_ImportExport_Model_Import_Adapter class.

If I can't rewrite this class, can't use a preference or a plugin to extend this class functionality or functionalities of other classes related to the file type adapter, how to achieve that?

Sure I'm missing something obvious.


texts:
I have created Admingrid and associate UI form. I need to change the Status for all the items using Massaction. Any one know Please suggest me..
Uigrid.xml

 <massaction name="listing_massaction">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="selectProvider" xsi:type="string">ox_homeslider_post_listing.ox_homeslider_post_listing.ox_homeslider_post_columns.ids</item>
                <item name="indexField" xsi:type="string">id</item>
            </item>
        </argument>
        <action name="delete">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="type" xsi:type="string">delete</item>
                    <item name="label" xsi:type="string" translate="true">Delete</item>
                    <item name="url" xsi:type="url" path="homeslider/post/massdelete"/>
                    <item name="confirm" xsi:type="array">
                        <item name="title" xsi:type="string" translate="true">Delete Slides</item>
                        <item name="message" xsi:type="string" translate="true">Are you sure you wan't to delete selected Slides?</item>
                    </item>
                </item>
            </argument>
        </action>
         <action name="status">
            <settings>
                <type>status</type>
                Change status
                <actions>
                    <action name="0">
                        <type>enable</type>
                        Enable
                        <url path="homeslider/post/massStatus">
                            <param name="status">1</param>
                        </url>
                    </action>
                    <action name="1">
                        <type>disable</type>
                        Disable
                        <url path="homeslider/post/massStatus">
                            <param name="status">2</param>
                        </url>
                    </action>
                </actions>
            </settings>
        </action>
    </massaction>


texts: catalog/product getCollection not equivalent to load

texts:
I'm trying to rewrite some poor performing code in a third party extension that loads all simple products from a configurable product and displays them for purchase at once in a grid. They are calling Mage::getModel('catalog/product')->load() in a foreach loop after getting all the simple product IDs, which is pretty bad practice so I've read. I've tried to replace this by loading the entire collection like so:

$_subproducts = Mage::getModel('catalog/product')->getCollection()->addIdFilter($_allChilds)->addAttributeToSelect('*')
                ->addMinimalPrice()
                ->addFinalPrice()
                ->addTaxPercents();

The problem is this ends up giving me a bunch of NULL attributes, no stock data, and image data that is formed differently, for instance there is no "image" key which they use to display the simple product image. I've managed to get the image data loaded by doing the following inside the foreach loop:

$confSimpleProduct = $_subproducts->getItemById($spd);
$attributes = $confSimpleProduct->getTypeInstance(true)->getSetAttributes($confSimpleProduct);
$media_gallery = $attributes['media_gallery'];
$backend = $media_gallery->getBackend();
$backend->afterLoad($confSimpleProduct);

I still have not figured out how to get stock information loaded and because of all the other helper methods being called it would be great to just have a drop in way to replace this so that I don't have to rewrite/debug lots of the code.


texts: Magento Fatal Error: Call to undefined function mcrypt_module_open() using WampServer

texts:
I am using Magento 1, installed on a Windows 10 php(7.2) WampServer.

I tried to add this extension=php_mcrypt.dll in php.ini, but continued to receive the error.

How to add extension=php_mcrypt.dll in Windows 10 to resolve this error?


texts: Prevent automatic URL rewrites created that include category URL key in product URL

texts:
Whenever I create a new product, Magento automatically creates unnecessary URL rewrites that include each category and subcategory combination, that use the categories' URL keys in the product path. For example, for a product product-name with the categories:

category
category > subcategory
category > subcategory > third

...Magento will automatically create URL rewrites with the following request paths:

/category/product-name
/category/subcategory/product-name
/category/subcategory/third/product-name

...as well as also creating the in-use URL rewrite with request path:

/product-name

My question is, even though I have the setting Use Categories Path for Product URLs set to No in:

System > Configuration > Catalog > Search Engine Optimizations

...how do I stop these additional URL rewrites from being created automatically?

Now, again, I realize that the site isn't linking to these additional paths anywhere on the site, but if for some reason a search engine picked up:

http://example.com/category/subcategory/third/product-name

...this would load! I'm nervous this will result in duplicate content being indexed by search engines. Since the Use Categories Path for Product URLs setting is set to No, and all links to the product on the site are pointing to:

http://example.com/product-name

...I want to stop Magento from creating these unnecessary URL rewrites automatically.

For reference, I tried truncating the core_url_rewrite table to zero (basically emptying it out) and reindexing the Catalog URL Rewrites in System > Index Management. This still results in Magento automatically creating these unnecessary URL rewrites.

Also, for reference, I am using Magento Community 1.9.1.

Please advise! Your help is much appreciated.


texts: I'm trying to get the value of a custom option field via the order api, but I don't see any fields in the API to do that. How can this be done?


texts: Fee for product with returnable container

texts:
I'm looking for free solution how to add fee to several products. Those products include returnable container and I don't want to see it in price but it has to be in total as 'returnable containers' - 2 USD for example.

I tried to do it by Product > Custom Options > Radio buttons but customer would have to check the button. I need to have it as non-optional.

Thank you.


texts: How to override / extend local extension model in magento?

texts:
I got a problem in overriding magento model local extension.

Here is my module config:

etc/modules/Mycompany_OrderExport.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Mycompany_OrderExport>
            <active>false</active>
            <codePool>local</codePool>
            <depends>
                 <Xtento_OrderExport />
            </depends>
        </Mycompany_OrderExport>
    </modules>
</config>

And here is my extension config: app/code/local/Mycompany/OrderExport/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Mycompany_OrderExport>
            <version>0.1.0</version>
        </Mycompany_OrderExport>
    </modules>
    <global>
        <models>
            <orderexport>
                <class>Mycompany_OrderExport_Model</class>
            </orderexport>
            <xtento_orderexport>
                <rewrite>
                     <export_data_shared_items>Mycompany_OrderExport_Model_Xtento_Export_Data_Shared_Items</export_data_shared_items>
                 </rewrite>
             </xtento_orderexport>
        </models>
    </global>
</config>

and here is my model:

<?php
class Mycompany_OrderExport_Model_Xtento_Export_Data_Shared_Items extends Xtento_OrderExport_Model_Export_Data_Shared_Items
{
    public function getExportData($entityType, $collectionItem)
    {

        echo 'Override';
        die(1);
    }
}
?>

I would like to know where part I have missed on my script ? Because when I execute my script there's nothing's happen. Thank you for your help.


texts: I have installed Magento 2 on Ubuntu server because I tried to run it on my localhost but it was extremely slow. So I installed it via Putty and now everything  is working fast. My question is, where do u find the source code if u want to make some custom changes inside of the code??


texts: Visual editor for custom order attribute

texts:
It's possible to add a visual input on user infos form, is it possible to do this to my orders ?
I already add the column in filters and I did this to add the field :
$salesSetup->addAttribute(Order::ENTITY, 'order_custom_attr', [
    'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
    'length'=> 255,
    'visible' => false,
    'nullable' => true,
]);


texts: Filter collection on same attribute with different values

texts:
I want to filter collection for same attribute having two either values.

example:

->addFieldToFilter('customer_group_id',Mage::getSingleton('customer/session')->getCustomer()->getGroupId())

->addFieldToFilter('sales_org',Mage::getSingleton('customer/session')->getCustomer()->getSalesOrgId())

->addFieldToFilter('sales_office',Mage::getSingleton('customer/session')->getCustomer()->getSalesOfficeId())

My question is.

If cutomer_group_id == 12 then it should have sales_org and sales_office value. else if customer_group_id == 13 then it should be null in sales_org and sales_office.

How can i achieve this filters.


texts: Replace subscribe block to before footer via XML

texts:
I'd like to move up the subscribe block up one block on the rwd theme.

Default:

<reference name="footer">
        <block type="newsletter/subscribe" name="footer.newsletter" as="newsletter" after="footer_store_language" template="newsletter/subscribe.phtml"/>
</reference>

Tried xml:

<reference name="root">
        <block type="newsletter/subscribe" name="footer.newsletter" as="newsletter" output="toHtml" before="footer" template="newsletter/subscribe.phtml"/>
</reference>

This does outputs the newsletter subscribe box to root, but after the footer block. How do I change this so it will output before my footer?

(reason: This block is usually nested with the footer block. I want to make newsletter full width while keeping footer boxed, therefore I have to unnest both)


texts: M2.2 | Button that can add multiple individual products to the cart all at once?

texts:
In short, we are looking for the ability to have a customizable button (be it through js, small module or whatever) to where we can have a button that would infact add multiple individual products to the customers cart via one click of the button, i.e. adding Product A, Product B and Product C with one click, rather than clicking each Add to Cart button individually.
After some googling, we can't find this exact functionality anywhere and wonder if this is possible be it a basic js entry or via its own little module.


texts: Magento 2.3: get cart items inside the cron file

texts:
I want to get current quote data for cronjob in cron/run.php But my code it's not working.

Magento2 version is CE 2.2.6. Here is my code

<?php
namespace ABC\Abandon\Cron;
use \Psr\Log\LoggerInterface;
class Run
{
    protected $logger;
    protected $scopeConfig;
    public function __construct(
        LoggerInterface $logger,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
){
    $this->logger = $logger;
    $this->scopeConfig = $scopeConfig;
}

public function execute()
    {
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $cartObj = $objectManager->get('\Magento\Checkout\Model\Cart');
    $quoteId = $cartObj->getQuote()->getId();
    $itemsArray = $cartObj->getQuote()->getAllItems();
    foreach($itemsArray as $item)
    {
        $productName[] = $item->getName();
    }
    if(is_array($productName)){
        $productNames .= implode(';',$productName);
    }
        $abdata['productNames'] = $productNames;
        $abdata['quoteid'] = $quoteId;
        return $abdata;
    }
}

I am not able to get cart session data inside the cron run.php file.

any suggestion? Thanks


texts: How to get data from core_config_data table in Magento 2?

texts:
I have created a cron and in that i want to get some values from core_config_data table in my Cron File.
My Cron file is :
<?php

 namespace Mageplaza\HelloWorld\Cron;

 use Psr\Log\LoggerInterface;
 use Magento\Catalog\Model\Product\Attribute\Source\Status;
 use Magento\Catalog\Model\ResourceModel\Product\Action;

 class Customcron
 {
private $productAction;
protected $_logger;
protected $_productCollectionFactory;
private $_objectManager;

public function __construct(
    Action $productAction,
    \Psr\Log\LoggerInterface $logger,
    \Magento\Framework\ObjectManagerInterface $objectmanager
) {
    $this->productAction = $productAction;
    $this->_logger = $logger;
    $this->_objectManager = $objectmanager;
}

public function execute(){

    $config = $this->_objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('section/group/field');
    $values = (array)json_decode($config, true);

    $attributes = [
        'status' => 2,
        'price' => '10.70'
    ];
    $productIds = ['1'];
    $storeId = 0;
    $this->productAction->updateAttributes($productIds, $attributes, $storeId);
}
}

My controller index file is :
<?php
namespace Mageplaza\HelloWorld\Controller\Index;

  class Index extends \Magento\Framework\App\Action\Action
{
protected $_pageFactory;
private $scopeConfig;
protected $_productCollectionFactory;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    \Magento\Framework\View\Result\PageFactory $pageFactory,
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
    array $data = []
){
    $this->_pageFactory = $pageFactory;
    $this->scopeConfig = $scopeConfig;
    return parent::__construct($context, $data);
}

public function execute()
{
    $product_ids = [];
    $configValue = $this->scopeConfig->getValue('am_shipping/prices/add_item');
    $productCollection = $this->_productCollectionFactory->create();
    $productCollection->setFlag('has_stock_status_filter', false);
    foreach ($productCollection as $key => $value) {
        $product_ids[] = $value->getId();
    }
    print_r($product_ids);
    print_r($configValue);die('aaaa');
    //return $this->_pageFactory->create();
}
}

It shows me the error  Type Error occurred when creating object: Mageplaza\HelloWorld\Controller\Index\Index\Interceptor


texts: How to remove an existing menu item (not declared by my module) using my module's menu.xml?


texts: Magento 2 controller values save via model in custom table without load model?

texts:
I want to call model in controller and save values via model in controller.

protected $pageFactory;
protected $quesModelFactory;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\View\Result\PageFactory $pageFactory,
    \CUSTOM\Proques\Model\Ques $quesModelFactory
)
{
    $this->pageFactory = $pageFactory;
    $this->quesModelFactory = $quesModelFactory;
    return parent::__construct($context);
}

public function execute()
{
    $data = $this->getRequest()->getPostValue();
    $name = $this->getRequest()->getParam('customername');
    $model = $this->_objectManager->create('CUSTOM\Proques\Model\Ques');
    $model->setCustomerName($name)
    $model->->save();
}

I DON'T WANT TO CALL MODEL LIKE THIS

  $this->_objectManager->create('CUSTOM\Proques\Model\Ques');

Is Any  way to call model without objectmanager in controller?


texts: Why are product_id and item_id part of the request to update stock through the API?

texts:
I'm developing an application to integrate with the Magento inventory API, and I'm confused about the fields product_id and item_id.

I'm PUT-ing to the API /V1/products/{productSku}/stockItems/{itemId}

The body of the request looks like

{
  "stockItem": {
    "item_id": 1,
    "product_id": 1,
    "stock_id": 1,
    "qty": 15
  }
}

However, I can leave off the product_id and/or the item_id, and the request still seems to work correctly, and updates the inventory.

{
  "stockItem": {
    "item_id": 1,
    "stock_id": 1,
    "qty": 20
  }
}

{
  "stockItem": {
    "stock_id": 1,
    "qty": 25
  }
}

Both of the above requests also update the product's inventory.  So my questions are

What is the difference between product_id and item_id.  I know that product_id is used as the primary key in the products table, so then what does item_id do?
Why are product_id and item_id both parameters in this request (and shown in Magento's documentation) if neither one of them appears to be required?


texts:
Recently I've been getting fake orders. At first customer accounts get registered on website and then fake orders placed using credit cards. All done within 10 minutes.
Orders are made for the same type of products.
Whats most interestingly is that orders are placed using legit credit cards.

Are such orders placed by bots ?
How to stop them ?


texts: Configurable product not appearing in Catalogue (Magento 2.3.5)

texts:
I created the configurable product and sample product and linked them together using REST API. I can see the config product and the sample products and also the links correctly done in Admin mode. But when I view it as a user, I don't see the product. However, if I go into the configurable product (in admin mode) or one of the simple products and simply open it and save it (without making any changes), it appears. So what am I doing wrong?

Also I noticed that if I hard code the URL I can access the product, for example if I use the URL below I can access the product "test" and able to add it to the cart, but it does not appear in any of the categories and search results.

http://localhost:81/magento235/test.html


texts: Magento 2: how to implement a translator

texts:
Is there any way to add a language translator in magento 2 (for frontend, customizable)?

I did't find any free extension for this. Can anyone help me?