texts: Magento 2: Xml layout update on block embedded in CMS page

texts:
How can I use the Layout Update XML to modify a block that's been embedded in a CMS page. I'm embedding the Magento login block into a CMS page, which works fine, but it does not show the 'Remember Me' checkbox by default. I would like to add the 'Remember Me' checkbox using a Layout Update.

Block embedded in CMS page:

{{block
  class="Magento\Customer\Block\Form\Login"
  template="Magento_Customer::form/login.phtml"
  name="customer.login.container"}}

Layout Update XML:

<referenceContainer name="form.additional.info">
    <block class="Magento\Persistent\Block\Form\Remember"
           name="persistent.remember.me"
           template="Magento_Persistent::remember_me.phtml"
           before="-"/>
</referenceContainer>

The module-persistent customer_account_login.xml uses this same layout update to add the checkbox on the login page so I thought it would work in a CMS page too. I thought wrong.

Here's a snippet of the login.phtml where the block should render:

I have tried placing the layout update in the CMS page and also in the cms_page_view.xml file, but the Remember block is never rendered.


texts: magento 2 add bundle items into cart dynamically with quantity

texts:
I want to add bundle products with quantity dynamically into cart.
I am able to add products but quantity is not updated. it is always 1.
Is there any way to solve this issue.

below code i am using for that.

$product = $this->_productRepository->getById(89,false, null, true);

$bundle_option = [ 1 => array(2,8,18) ];  // 2,8,18 are selection ids, 1 is option id
$bundle_qty = [ 1 => array(2,3,4) ]; // 2,3,4 are quantity, 1 is option id

$params = [
    'form_key' => $this->formKey->getFormKey(),
    'product' => 89,
    'bundle_option' => $bundle_option,  // it is working fine
    'bundle_option_qty' => $bundle_qty,  // logically it will work but in my case it is not working.
    'qty' => $totalqty
];

$this->cart->addProduct($product, $params);
$this->cart->save();

Please help. Thanks in advance.


texts: Uncaught Error: Call to a member function getMethodInstance() on null after migration from magento1 to magento2

texts:
After Migration when I open order detail page from Grid admin side I face one error.

     Fatal error: Uncaught Error: Call to a member function getMethodInstance() on null in /opt/lampp/htdocs/magento/vendor/magento2/module-sales/Model/Order.php:737
 Stack trace: #0 /opt/lampp/htdocs/magento2/vendor/magento/module-sales/Block/Adminhtml/Order/View.php(92): Magento\Sales\Model\Order->canEdit()
 #1 /opt/lampp/htdocs/magento2/vendor/magento/framework/View/Element/AbstractBlock.php(208): Magento\Sales\Block\Adminhtml\Order\View->_construct()
 #2 /opt/lampp/htdocs/magento2/vendor/magento/framework/View/Element/Template.php(153): Magento\Framework\View\Element\AbstractBlock->__construct(Object(Magento\Backend\Block\Widget\Context), Array)
 #3 /opt/lampp/htdocs/magento2/vendor/magento/module-backend/Block/Template.php(67): Magento\Framework\View\Element\Template->__construct(Object(Magento\Backend\Block\Widget\Context), Array)
 #4 /opt/lampp/htdocs/magento2/vendor/magento/module-backend/Block/Widget/Container.php(56): Magento\Backend\Block\Template->__construct(Object(Magento\Backend\Block\Widget\Context), Array) #5 in /opt/lampp/htdocs/magento2/vendor/magento/module-sales/Model/Order.php on line 737

Please help me to solve this error.


texts: Check on logged in customer, only working on cart page; why?

texts:
The check is as follows:

The Following code is supposed to check if a customer is logged in anywhere

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->get('Magento\Customer\Model\Session');
if($customerSession->isLoggedIn()) {
   // customer login action
}


texts: How to get Flat Shipping Price on the Checkout shipping step?

texts:
We have a single flat shipping rate that we want to be pre-selected on the shipping step of the checkout and to appear in the totals section.
I have overridden the Magento_Checkout/js/view/summary/abstract-total.js and replaced isFullMode with

isFullMode: function() {
    return this.getTotals();
}

so that this section shows on that step, as it is disabled by default.

However, the totals section is still shown with the shipping rate as 0

even though the shipping rate is shown and is already selected

Also, clicking on the radio button does not update the totals.
I had initially thought that the totals section might be bound to the radio group using knockout for the selection from multiple rate shipping and re-calculation of the totals.

What do I need to do to get the correct preselected shipping rate cost into the totals section along with the correct calculation of the grand total?


texts: Upgrade Magento 2.3 and store code base is not found

texts:
I upgraded my Magento 2.3.1 to 2.3.6, I'm seeing this message in the frontend.
The website with code base that was requested wasn't found. Verify the website and try again.

How could I fix it?


texts: Is it possible to print a list of orders including items ordered?

texts: I'd like to print a report that simply lists the orders made in the last month, that includes simple order info including price, customer name, etc, as well as the items in that order.  It seems that items orders/invoiced is not an option either in reporting or in the order list.  Is there a way to print a simple list of orders such as this?


texts: Magento 2 invalid form key. please refresh the page issue

texts:
I am facing an "invalid form key. please refresh the page" when customer login and click on any add to cart button. the website on domain name and tried a lot of options like change max_input_vars values remove cookies etc. but issue not resolved. I am using a custom theme for the website.
On mobile sometimes adding product to cart showing "your session has been expired".


texts: Magento Show Specific product on cms page

texts:
I want to show two configurable products on a cms page. The two products are under a sub category (id = 343). I've used below code in my cms page:

{{block type="core/template" name="home.catalog.product.list"
alias="products_homepage" category_id="343"  product_count="2"
template="catalog/product/list.phtml"}}

but it gives this error:

  Fatal error: Call to a member function count() on a non-object in
  /home2/hotelhome/public_html/app/design/frontend/default/sm_sport/template/catalog/product/list.phtml
  on line 38


texts: How to set condition in shoping cart rule for cenario given below:

texts:
We have tops and bottoms of 15 "types". 15 tops and 15 bottoms, we want to give 20% discount only when abc top and abc bottom are in cart. Similarly if abc top, abc bottom and xyz top and xyz bottom are there they all should get 20%. If there's only top or only bottom, then no discount should apply.
Please help


texts: Path of file for Catalog, Manage Products, Add Product - In that Save button

texts:
I am new to Magento. Please can anyone tell me the path of file in Magento's admin panel - Catalog, Manage Products, Add Product - In that Save button.

Where the code is written for saving products in admin panel?


texts: Drag to missing field in onepage checkout

texts:
I need to make the page drag itself if the client tries to place an order and is missing a required field. In mobile it is very hard to understand whats wrong if the page does not drag to the required field, the client click on place order and nothing happens, that he can see at least, the field becomes red saying it's required, in a big screen you can easily see that but when it comer to small screens you need to search for the field that is missing.
Any easy way to do this?
Thanks!
Best regards,
Rui Silva


texts:
I need to build module that should update the order status via API with tracking number , qty shipped etc.. I have the basic API module but I am stuck with how to update the data

Any help is appreciated,
Thanks.


texts: How to insert date picker at product buying page in frontend

texts:
I am developing magento e-commerce site to sell the milk online.

User has to select the date of delivery.How I can ask the user to select the date of delivery at product view page.

Please share your idea and help with me to achieve this use case in magento.

Please share any other alternative ideas to achieve this


texts: How to stop auto invoice generation with Credit Card or Paypal payment methods

texts:
I need to stop Magento (version 1.8.1.0) from generating invoices automatically with credit card or paypal payment methods.

I look at registerCaptureNotification() in app/code/Mage/Sales/Model/Order/Payment.php. If I comment out the following code snippet:

if (!$invoice) {
        if ($this->_isCaptureFinal($amount)) {
            // comment out the following to stop creating invoices automatically
            //$invoice = $order->prepareInvoice()->register();
            //$order->addRelatedObject($invoice);
            //$this->setCreatedInvoice($invoice);
        } else {
            if (!$skipFraudDetection) {
                $this->setIsFraudDetected(true);
            }
            $this->_updateTotals(array('base_amount_paid_online' => $amount));
        }
}

But this doesn't seem to work. Invoices are still being generated using credit card payment.

What is the right way to prevent auto invoice generation?


texts: Convert reward points into discount coupons during checkout

texts:
I have integrated an extension which rewards some Credit Points to the customer when they return any product. These points are only assigned from backend.

Now, the customer can use this Credit Points during any purchase. But in case if the Order Grand Total exceeds the Credit Limit, then the customer is forced to choose some other mode of payment.

But instead, I want to convert these Credit Points into Discount Coupon and allow the customer to place the order. How can I implement this??

Any help will be appreciated. I am using the following extension:
http://www.magentocommerce.com/magento-connect/credit-point-payment-4321.html


texts: How to get Manufacturer dropdown in custom module edit form?

texts:
I want to add images for each brand, for that i have created a module. in module's edit form i want a manufacturer dropdown list so i can assign image to the particular manufacturer/brand.

its my code for the edit form location:

app/code/local/Root/Brand/Block/Adminhtml/Brand/Edit/Tab/form.php

$fieldset->addField('title', 'select', array('name' => 'title', 'label' => 'Brand', 'values' => Mage::getUrl('catalogsearch/advanced/result', array('brand'=>$option['value'])), )); $fieldset->addField('filename', 'image', array( 'label' => Mage::helper('brand')->__('Brand Image'), 'required' => false, 'name' => 'filename', 'note' => '(*.jpg, *.png, *.gif)', ));


texts: How to properly implement this snippet of code

texts:
I'm in the process of manually turning a few quotes into orders. Someone was kind enough to provide me the code that should do it from another question (How to manually convert a series of quotes to invoices (orders)). I'm not familiar with how to implement the following snippet:

$quote = Mage::getModel('sales/quote')->load(1);

// convert quote to order
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();

$order = $service->getOrder();

Should this be inserted into a new controller and executed by namespace URL? I was originally going to preface this code with:

<?php

require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();

However I'm told it will not trigger events.

With that said, what would be the best way to implement this? Thank you.

Secondary Question: What does the "load(1)" mean in the first line of code? Is that a reference to the quote ID?


texts: How to add new option in WYSiWYG editor magento

texts:
i want to add new option in WYSiWYG editor like list bullet & list number.
Is there is any way to add List square option in magento WySiWYG editor.


texts: Interested in a good intelligent search module

texts:
The only one i keep seeing is by "klevu"... does anyone have any opinions on klevu and or what other options are out there.

Looking for better (than native) search functionality and maybe some good intelligent searching with images.


texts: Redirect add to cart for affiliate products

texts: In my catalog I have affiliate products that when someone clicks the “Add to Cart” button, they should get forwarded to an external URL. Does anyone have any ideas how I could do that? I am new to Magento.


texts:
Been beating my head for a few days on this. When viewing a configurable product on the front end, select options, the price does not change to the price configured on the simple products.

Is this a magento config setting or a CSS config or ...?

It worked at one point a couple weeks ago but I don't know what has changed.

Configurable item has all associated items associated.

[![This is the product view. Before selecting option it would show a range and selecting the options in the picture would show the actual price. This set should be $22][3]][3]

Any help is appreciated.


texts: Search type in Catalog don't search by Product's Name

texts:
I'm changed catalog search configuration to :

System > Configuration > Catalog

Search Type => Combine (Like and Fulltext)
Product Listing Sort by  => Name

But when I search by name, the product not showing in the top page. His appear in the middle of the page

Think that I forget the some configuration

Can help me?

Thank you


texts:
given Magento 2.4.1 is different from the others, super confused as to which file to edit in creating a custom Maintenance Mode.
I'll like to show this Custom Maintenance Mode Page  instead of default maintenance mode page.  Which file should I edit?  During my search for which file to edit, found:

maint-mode.html

503.phtml (which path? one is in vendor directory, another in pub)

MaintenanceMode.php

Read https://devdocs.magento.com/guides/v2.4/comp-mgr/trouble/cman/maint-mode.html
Thanks for your attention.  Happy New Year in advance :=)


texts: Magento2 : How to Move Pinterest Button in Product Image in Product Page

texts:
How to move pinterest(pin it) button in product image in product view page. Currently it is coming after add to cart button.

How to change pinterest(pin it) button to product image section.


texts: Magento 2 - Accessing a helper without using constructor injection

texts:
Is there a clean way to initiate and access a custom helper without using the constructor? Currently I instantiate the custom helper using the constructor of the model as shown here as the accepted answer.

This is great in most cases but now I would like to access a helper method on a model that adds a bit of functionality to the product model - extending \Magento\Catalog\Model\Product. It seems a bit overkill to overwrite this constructor so I am wondering if there is an alternative, acceptable way to do this? Can I just grab it directly via the ObjectManager or roll out my own factory like @philwinkle suggested here or is this not recommended?


texts: Magento 2.2.3 Checkout page loader doesn't complete loading

texts: Magento 2.2.3 checkout page is loading infinitely. I have checked the view source and it seems something stopped the js loading. I have checked many threads relating this and nowhere found a solution.


texts: Showing/hiding div by selecting radio button

texts:
Currently I'm working on the shippingpart of the checkout of our Magento webshop. We have two shippingoptions, both have a radiobutton. The first option has some aditional information, which I only want to be shown when the radiobutton is checked. I found like a 100.000 codes for this, but nothing seems to work.

Both shippingoptions are being called by Magento in one line, like this (first line):

  <input name="shipping_method" type="radio" class="validate-one-required-by-name" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> />
            <label data-price="<?php echo $_priceExcl; ?>" data-price-incl="<?php echo $_priceIncl; ?>" for="s_method_<?php echo $_rate->getCode() ?>"> <?php echo $_rate->getMethodTitle() ?>

                     <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
                     <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>

                     <?php echo $_excl; ?>
                     <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
                                (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
                     <?php endif; ?>

             <?php if ($_isPostnl && $this->getChild('postnl.osc.delivery.options')): ?>

                     <?php echo $this->getChild('postnl.osc.delivery.options')->setRate($_rate)->toHtml(); ?>

             <?php $_deliveryOptionsShown = true; ?>
             <?php $_methodName = 's_method_' . $_rate->getCode(); ?>
             <?php endif; ?>

Can anyone help me with a code?

Maybe it's good to know that we are using OneStepCheckout and a PostNL extension. The last one takes over the shippingpart of OneStepCheckout. Oh and I'm a newby in PHP and Javascript/Jquery.


texts: how to call specific payment model function on place order in Magento 2

texts:
I am developing a custom payment module. I have successfully setup credit card form on checkout page but while I am placing an order, capture function of that payment model doesn't call.

You can check code here https://github.com/lalitkaushik/customcode

Is there anyone can help me to know how can I call capture function?

Edit: I have noticed that after installing the module in vanilla Magento setup, it's working only first time.


texts:
i created new attribute called 'brands' as dropdown menu have some values like "nike,puma,..." and added it to the default attribute set
i try to get the attribute id to add it to product when insert new one

$brand_id = $this->attributeValueExists('brands',$pro->brand->name );
$product = Mage::getModel('catalog/product');
$product->setBrands($brand_id);

but i have error "Fatal error: Call to undefined method attributeValueExists() "
Thank in Advance..


texts: Can I set MSI stock values using products REST endpoint?

texts:
We currently run Magento without MSI. The ERP sends stock updates via extension attributes on the (bulk) product endpoint. This enables us to do most product updates in on API call. Very convenient.
We are looking to implement MSI, but it seems it is not possible to set multiple source quantities as product extension attributes and we would need to start making two API calls (maybe more) to create a product and assign some stock....
We would like to continue to do a single API call to create/update product AND set the stock in MSI like so:
{
"product" : {
    "sku": "24-MB01-3",
    "name": "My Duffle Bagz 3",
    "attribute_set_id": 15,
    "price": 34,
    "status": 1,
    "visibility": 4,
    "type_id": "simple",
    "extension_attributes": {
        "category_links": [
            {
                "position": 0,
                "category_id": "3"
            },
            {
                "position": 0,
                "category_id": "4"
            }
        ],
        {
        "sourceItems": [
         {
               "sku": "24-MB01-3",
               "source_code": "NW",
               "quantity": 1000,
               "status": 1
         },
         {
             "sku": "24-MB01-3",
             "source_code": "LN",
             "quantity": 500,
             "status": 1
         }]
       }
    }
}
}

Because we use bulk endpoints, our current process is asynchronous, so knowing when a particular product is created and we can then set the stock is difficult.
Is there any way to do this rather than having to use the separate source-items endpoint?


texts: Magento 2: Get list of products on basis of attribute code

texts:
Is there any way I can fetch list of products having a attribute_code.

For eg:
Getting list of all products which has attribute color


texts: Catalog ProductList not overriding magento2

texts:
I have overridden my catalog product listproduct in etc/di.xml as:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
                    <!--Overrride for Block catalog rewrite product list toolbar -->
   <preference for="Magento\Catalog\Block\Product\ListProduct" type="Tagalys\Tglssearch\Block\Catalog\Product\ListProduct" />

This is my ListProduct.php (\Tagalys\Tglssearch\Block\Catalog\Product\ListProduct.php)

namespace Tagalys\Tglssearch\Block\Catalog\Product;

use Magento\Catalog\Api\CategoryRepositoryInterface;

class ListProduct extends \Magento\Catalog\Block\Product\ListProduct
{
public function __construct(
    /*passing all Constructors parameters to the parent class */
    \Magento\Catalog\Block\Product\Context $context,
    \Magento\Framework\Data\Helper\PostHelper $postDataHelper,
    \Magento\Catalog\Model\Layer\Resolver $layerResolver,
     CategoryRepositoryInterface $categoryRepository,
    \Magento\Framework\Url\Helper\Data $urlHelper,
    /*passing all Constructors parameters to the parent class */

    \Tagalys\Tglssearch\Helper\Data $tglssearchHelper,
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $catalogResourceModelProductCollectionFactory,
    \Magento\Catalog\Model\Config $catalogConfig,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    array $data = []
) {
    $this->tglssearchHelper = $tglssearchHelper;
    $this->catalogResourceModelProductCollectionFactory = $catalogResourceModelProductCollectionFactory;
    $this->catalogConfig = $catalogConfig;
    $this->storeManager = $storeManager;

      parent::__construct(
        $context,
        $postDataHelper,
        $layerResolver,
        $categoryRepository,
        $urlHelper,
        $data
    );
    //$this->tglssearchHelper = $tglssearchHelper;
}

protected function _getProductCollection()
{
    print_r('_getProductCollection');die;
    $tagalys = $this->tglssearchHelper->getTagalysSearchData();
     if($tagalys == false) {

        return parent::_getProductCollection();

    } else {

        $searchResult = $tagalys;

        if(empty($searchResult)) {
            return parent::_getProductCollection();
        }

        $collection = $this->_productCollection = $this->catalogResourceModelProductCollectionFactory->create()
             ->addAttributeToSelect($this->catalogConfig->getProductAttributes())
             ->setStore($this->storeManager->getStore())
             ->addFieldToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
             ->addAttributeToFilter( 'entity_id', array( 'in' => $searchResult['results'] ) );  print_r($searchResult);die;

        $orderString = array('CASE e.entity_id');
        foreach($searchResult['results'] as $i => $productId) {
            $orderString[] = 'WHEN '.$productId.' THEN '.$i;
        }
        $orderString[] = 'END';
        $orderString = implode(' ', $orderString);

    $collection->getSelect()->order(new \Zend_Db_Expr($orderString));

        return $this->_productCollection;

    }
}

Why is my _getProductCollection() not getting called ?
I get a blank screen when i search for the product.


texts: PNG image modified after image uploads in Magento 2

texts: I have Uploaded .PNG image for the product. But it displaying differently on the frontend. most of the image automatically become transparent. please check the attached image.


texts:
I have a magento based website. For seo reasons I am getting Duplicate Title Tags problem from google.

For example 12" Marakesh:

/12-marakesh.html
/memory-foam-mattresses/12-marakesh.html
/memory-foam-mattresses/enso-sleep-systems/12-marakesh.html

For one product I get these 3 pages. But I only need one.

How do I make a product list only once not thrice ?

I read this tutorial, but it won't help much coz there are quite a few pages that needs adjustments.

Please advise

Thanks


texts: Paypal incorrect discount and tax values

texts:
I've been wrangling with an issue regarding Paypal Pro and Express and was wondering if I'm being stupid or there is a bug.

My cart is showing the correct values but when Paypal displays the amount a user has to pay it is incorrect and is causing IPN values of suspected fraud with Paypal Pro.

Expected Result:
Paypal figures should match the cart page

Subtotal £249.99
Discount -£25.00
VAT £37.50
Grand Total £224.99

Actual Result:
Paypal Express

Item Total £183.32
VAT £41.67
Grand Total £224.99

Paypal Pro

Subtotal £208.32
VAT £37.50
Discount £25
Grand Total £220.82

Here are my tax settings

The store is built on CE 1.9.0.1


texts: Magento 2 | add custom customer attribute to checkout

texts:
I created a custom customer attribute and now want the customer to be able to edit in in checkout.

How can I do that?

Thanks in Advance!


texts: How can I debug variables inside plugin?

texts:
I tried die($some_var) and var_dump($some_var) but nothing happens.

DI:

<!-- di.xml -->
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
  <type name="Magento\Quote\Model\Quote\Address">
    <plugin name="namespace.checkout.shipping" type="Namespace\Checkout\Plugin\Shipping" sortOrder="1" />
  </type>
</config>

Plugin:

<!-- Shipping.php -->
<?php
namespace Namespace\Checkout\Plugin;

use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Quote\Model\Quote\Address;
use Magento\Quote\Model\Quote\Item;
use Magento\Quote\Model\Quote\Address\Rate;
use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\ProductRepository;
use Namespace\Checkout\Helper\Data;

class Shipping
{
    private $productRepository;
    private $helper;

    public function __construct(ProductRepository $productRepository, Data $helper)
    {
        $this->productRepository = $productRepository;
        $this->helper = $helper;
    }

    public function afterGetShippingRatesCollection(Address $subject, AbstractCollection $rates)
    {
        $items = $subject->getQuote()->getItems();

        /* Something strange is happening here
           0. If I just 'return $rates' without any conditions and custom code, It work perfectly. But I want to filter rates.
           1. When I add following code (if(!$items) { return $rates; }), it throws LocalizedException: "Please specify a shipping method" in vendor/magento/module-quote/Model/QuoteManagement.php(427)
           2. Without 'if(!$items){...}' I've got "Invalid argument supplied for foreach()" for second foreach in this function
         */
        if (!$items) {  // there is a some strange magic, and I want it to debug.
            return $rates;
        }
        /* end strange */

        /** @var Rate $rate */
        foreach ($rates->getItems() as $key => $rate) {
        /** @var Item $item */
            foreach ($items as $item) {
                try {
                    /** @var Product $product */
                    $product = $this->productRepository->get($item->getProduct()->getSku());
                } catch (NoSuchEntityException $e) {
                    // product not found
                    continue;
                }
                if (!$this->helper->isShippingRateAvailable($rate->getCode(),$product)) {
                    $rates->removeItemByKey($key);
                    continue 2;
                }
            }
        }
        return $rates;
    }
}


texts: Select Categories that have Products with a certain attribute

texts:
My products have an attribute with possible values like "Shampoo", "Masque", etc...

How do i select all sub categories of the current category that contain products of type eg "Shampoo". I want to list categories, not products.

Thank you


texts: I seem to have blew up the admin user account, password recovery is not working because the server cant send emails.  how do I change the password for the admin console? from CLI since I cant get into the web :)


texts:
So I've pushed a load of changes live to my site, I flush the cache, I clear the browser cache, I've empty /var/cache and none of my changes display.

I've checked the whole site and it's not a case of me updating the wrong files to the wrong template.

Has anyone got anything else I've missed out?


texts: Magento not displaying new lines or bullet points on any pages

texts:
I have a problem with Magento not displaying any html (Which I format in the WYSIWYG editor).

In the product description page for example, bold letters etc show but no bullet points and line breaks are made. So, all the text just appears in one paragraph.

Example:

My content looks like this

I have a new line with some:

Bullet 1
Bullet 2

How it displays on my page is:

My content looks like this
I have a new line with some
bullet 1
bullet 2

Can anyone advise?


texts: Magento2: product page - How to get product name from custom attribute

texts:
How to get product name on product page from custom attribute: custom_name
https://prnt.sc/t5lenr
Any solution?


texts: How to add Additional_attribute row when Products import using csv in magento 2

texts:
i need to set additional attribute column pragmatically using code in magento2 with import export module model file

my product custom attribute is "pre_order_qty"

if ($this->validateRow($rowData, $source->key()))
{
// add row to bunch for save
$rowData = $this->_prepareRowForDb($rowData);
$pre_order_qty =  $rowData['qty'];
$rowData['additional_attributes'] = 'pre_order_qty='.$pre_order_qty;

i need to set that "qty" value in "pre_order_qty"

here i share the screen shoot can any one help me how can set this


texts: Magento 2 Diffeent Product Page design for different Category

texts:
I need product pages design different for each category.I have around 5-6 categories.

What is the best way to do it?


texts: Converting default shipping address into a quote address

texts:
I'm working on a custom module that will display shipping estimates on the product page. All of my customers are required to sign up and log in (it's a trade-only website), so I have the customer's default shipping address at my disposal (guaranteed). Therefor, I'm going to provide a shipping estimate based on the default shipping address. So far, the only way I've found to convert the customer/address object into a sales_model_quote_address is as follows:

$customerAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultShipping();
$address = Mage::getModel('customer/address')->load($customerAddressId);
$address_data = array (
        'prefix' => $address->getPrefix(),
        'firstname' => $address->getFirstname(),
        'lastname' => $address->getLastname(),
        'street' => $address->getStreet(),
    'city' => $address->getCity(),
    'region_id' => $address->getRegionId(),
    'region' => $address->getRegion(),
    'postcode' => $address->getPostcode(),
    'country_id' => $address->getCountryId(),
    'telephone' => $address->getTelephone(),
    'email' => $address->getEmail()
);

$quoteShippingAddress = new Mage_Sales_Model_Quote_Address();
$quoteShippingAddress->setData($address_data);

This does work, but it seems a bit hacky/messy. Can anyone suggest a sensible alternative?
Thanks in advance.


texts: Are Custom Options/Product Options Attributes? Fastest way to load, and parse through Options?

texts:
My question is in two parts.

When you call $product->getOptions(), does this mean Options is an attribute? For example, when you are trying to get the name or a custom attribute "custom_attribute" of a product, you will use:

$product->getName();
$product->getCustomAttribute()

Is this the same for options?? Are product options held in the options attribute? Is there even an options attribute??
What is the fastest way to get the options only? I need to parse through the options to see if an options exists and then print it out. This takes way to much time to load since I have to do this in a product list view. For example, when you only need a products name and image you can use collections to grab only the attributes you need using:

$collection->addAttributeToSelect('name');
$collection->addAttributeToSelect('small_image');

Can you do this with options?? As of right now I have to get the product id and then load the product to get the product options. This takes waaaayyyy too much time @_@. Urks my soul.


texts:
All transaction mail content as empty in magento2.3.1

Thanks.


texts: %fieldname is a required field for entry in post media gallery

texts:
I'm pretty new to Magento and I was trying to add a media to a existing product. From code I am able to do that as the following:

$entry = ['entry' => [
            'media_type' => ---,
            'position' => ---,
            'types' => [
                ---,
                ---,
                ---,
            ],
            'file' => ---,
            'content' => [
                'base64_encoded_data' => base64_encode(---),
                'type' => ---,
                'name' => ---,
            ]
        ]
        ];
        if (---) {
            $entry['entry']['id'] = ---;
        }

        $saveMedia->whereSku($sku)
            ->withData($entry)
            ->save();

The code is working "fine" I am actually trying to use a POST to update an existing image specifing the id but that part it's not working and I get a new image. When I got this error I tried to do the same POST in postman and when I specify in the body the same code as above in json the following error appears:

{
    "message": "%fieldName is a required field.",
    "parameters": {
        "fieldName": "entry"
    },
}

My json is as following:

{"entry":{"media_type":"---","position":---,"types":["image","small_image","thumbnail"],"file":"---","content":{"base64_encoded_data":"---","type":"image\/jpeg","name":"---"},"id":---}}

So:

How do I fix this error? Why isn't my entry recognized?


texts: Programmatically changed attribute is not visible on frontend (product list)

texts:
We have a custom attribute which is added to the default attribute group. Used in product listing is yes and it is added in the config.xml to the product collection.

The values of the attribute are set using \Mage_Catalog_Model_Product_Action::updateAttributes in a data upgrade script.

Anyways, the values are not displayed in the product listing. When the product is saved in the backend, it becomes visible.

Rebuilding all indices using indexer.php or n98-magerun.phar did not help.

EDIT

data upgrade script 1

$installer = $this;
$installer->startSetup();

$attrCodeDeliveryTimeFrom = 'delivery_time_from';
$attrCodeDeliveryTimeTo = 'delivery_time_to';
$attrGroupName = 'General';
$attrLabelDeliveryTimeFrom = 'Delivery time from (days)';
$attrLabelDeliveryTimeTo = 'Delivery time to (days)';
$attrNoteDeliveryTimeFrom = 'Days from';
$attrNoteDeliveryTimeTo = 'Days to';

$objCatalogEavSetup = Mage::getResourceModel('catalog/eav_mysql4_setup', 'core_setup');
$attrIdTest = $objCatalogEavSetup->getAttributeId(Mage_Catalog_Model_Product::ENTITY, $attrCodeDeliveryTimeFrom);

if ($attrIdTest === false) {
    $objCatalogEavSetup->addAttribute(Mage_Catalog_Model_Product::ENTITY, $attrCodeDeliveryTimeFrom, array(
    'group' => $attrGroupName,
    'sort_order' => 50,
    'type' => 'int',
    'backend' => '',
    'frontend' => '',
    'label' => $attrLabelDeliveryTimeFrom,
    'note' => $attrNoteDeliveryTimeFrom,
    'class' => '',
    'source' => '',
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible' => true,
    'required' => false,
    'user_defined' => true,
    'visible_on_front' => true,
    'unique' => false,
    'is_configurable' => false,
    'used_for_promo_rules' => true
    ));
}

$attrIdTest = $objCatalogEavSetup->getAttributeId(Mage_Catalog_Model_Product::ENTITY, $attrCodeDeliveryTimeTo);

if ($attrIdTest === false) {
    $objCatalogEavSetup->addAttribute(Mage_Catalog_Model_Product::ENTITY, $attrCodeDeliveryTimeTo, array(
    'group' => $attrGroupName,
    'sort_order' => 51,
    'type' => 'int',
    'backend' => '',
    'frontend' => '',
    'label' => $attrLabelDeliveryTimeTo,
    'note' => $attrNoteDeliveryTimeTo,
    'class' => '',
    'source' => '',
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible' => true,
    'required' => false,
    'user_defined' => true,
    'visible_on_front' => true,
    'unique' => false,
    'is_configurable' => false,
    'used_for_promo_rules' => true
    ));
}

$setup = Mage::getResourceModel('catalog/setup','catalog_setup');
$setup->removeAttribute('catalog_product','delivery_time');

date upgrade script 2

$installer = $this;
$installer->startSetup();

$_productCollection = Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addStoreFilter(2);
$storeId = 0;

foreach ($_productCollection as $_product) {
    $product = Mage::getModel('catalog/product')->load($_product->getEntityId());
    $data = array(
    'delivery_time_to' => 3,
    'delivery_time_from' => 1
    );
    Mage::getSingleton('catalog/product_action')->updateAttributes(array($product->getId()), $data, $storeId);
}

$installer->endSetup();

We did the attribute creation in a data upgrade script. Maybe this is the problem.


texts: PayPal IPN postback HTTP error: SSL warning

texts:
We are receiving this error message when debugging the IPN from PayPal:

  PayPal IPN postback HTTP error: error:14077410:SSL
  routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

We have noticed that it may be related to not being updated to the last PayPal changes, as stated here in the answer and comment.

Did anyone using an http:// website encounter the same issues? Should we simply go through https:// and the error would be fixed that way?

Thanks for any orientation.


texts: How can i import bulk products with CSV having 1 lakh in PHP

texts:
tried with below code and saved only 10k records, how can i import with batch size?
if(isset($_POST["Import"])){

    $filename=$_FILES["file"]["tmp_name"];
     if($_FILES["file"]["size"] > 0)
     {
        $file = fopen($filename, "r");
          while (($getData = fgetcsv($file, 100000, ",")) !== FALSE)
           {
             $sql = "INSERT into employeeinfo (emp_id,firstname,lastname,email,reg_date)
                   values ('".$getData[0]."','".$getData[1]."','".$getData[2]."','".$getData[3]."','".$getData[4]."')";
                   $result = mysqli_query($con, $sql);
        if(!isset($result))
        {
          echo "<script type=\"text/javascript\">
              alert(\"Invalid File:Please Upload CSV File.\");
              window.location = \"index.php\"
              </script>";
        }
        else {
            echo "<script type=\"text/javascript\">
            alert(\"CSV File has been successfully Imported.\");
            window.location = \"index.php\"
          </script>";
        }
           }

           fclose($file);
     }
  }


texts: update Sku in using catalog_product_save_after in magento 2

texts:
I try set new sku using catalog_product_save_after event, its continuously run this observer, But Not save the sku value.

events.xml:

<event name="catalog_product_save_after">
    <observer name="my_custom_product_save_observer" instance="Vendor\module\Observer\Productsaveafter" />
</event>

Code:

    <?php

    namespace Vendor\Module\Observer;

    use Magento\Framework\Event\ObserverInterface;

    class Productsaveafter implements ObserverInterface
    {

        public function execute(\Magento\Framework\Event\Observer $observer)
        {
            $_product = $observer->getProduct();  // you will get product object
            $_sku=$_product->getSku(); // for sku
            $this->logger->addDebug($_sku);

             $_product->setSku("testNew1");
             $_product->save();
        }
    }

Suggest Me, Why Its Not saved Sku value in magento 2.


texts: Image not uploading 2nd time - Something went wrong

texts:
We are Providing product personalization feature [ users can upload image from product view page & buy the product].

here user can upload any number of images by clicking upload image button here

1) click upload image button = > click +Upload new image in pop up  = > upload image from local system = > click on "Add Image" , than again if we try same steps, we will get an errors as below , means 1st time its working fine, but 2nd time show error.

But only in Mozilla Firefox 2nd time also its working fine.

AjaxController.php

public function addImageAction()
    {
        $response = array();
        if(isset($_FILES['new_image']['name']) && (file_exists($_FILES['new_image']['tmp_name']))) {
            $uploader = $this->setUpUploader();
            $path = Mage::getBaseDir('media') . DS . 'custom_product_preview' . DS . 'quote' . DS;
            try
            {
                $uploader->save($path, preg_replace('/[^A-Za-z\d\.]/','_',$_FILES['new_image']['name']));
                $filename = $uploader->getUploadedFileName();

                $filename = $this->_convertToImg($filename);

                if(getimagesize($path.$filename)!==false)
                {
                    $response['src'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'custom_product_preview/quote/'.$filename;
                    $response['error'] = 0;
                }
                else
                {
                    $response['error'] = Mage::helper('aitcg')->__('Image file is empty or corrupt');
                }
            }
            catch (Exception $e)
            {
                $response['error'] = $e->getMessage();
            }

        }
        else
        {
            $response['error'] = Mage::helper('aitcg')->__('Something went wrong. Please try again.');
        }

        $this->_setBodyJson($response);
    }

System.log

Edit : seems above system.log error is not related to this issue

edit 2 : console

Edit 3

loaded : function(id) {
        var d,
            i = $(id);
        if (i && i.contentDocument) {
            d = i.contentDocument;
        } else if (i && i.contentWindow) {
            d = i.contentWindow.document;
        } else {
            d = window.frames[id].document;
        }

        with($(this.file_id)) {
            disabled = false;
            value = "";
        }

        if (typeof(i.onComplete) == 'function') {
            eval('var el = ' + d.body.innerHTML + ';');
            i.onComplete( el );
            element = document.getElementById(id).parentNode;
            element.parentNode.removeChild(element);

        }
    }


texts:
I have a bug with magento 2.1 but i think it is from base.
when i add to cart from product detail: ajax is loaded and everything is good, mini cart show 1 item
but the bug appear when i add to cart from homepage or extension have button not ajax. minicart does not update and return "No items"

Now, miniCart have a trigger call function load minicart after add to cart by ajax so if i code a button add to cart not run ajax but product is added, no wrong. the trigger is not called so minicart return wrong.

Can you fix it in next version of magento 2?


texts: Magento 2: Image upload in product review from Frontend

texts:
It would be very helpful if someone can guide me, How to achieve functionality of uploading image while product review on frontend.

I want to implement the functionality, the users can upload images at the time of review in frontend product review page.


texts: Magento 2.3 How to Auto Select Swatch Option Values if Only One Exists in Product View

texts:
I'm trying to have swatch option values selected on the Product View page if only one value exists.

also, I have tried this reference but not working for me
https://magento.stackexchange.com/a/176243/68695

like :

Note: when one swatch value available then this value is auto selected and remove validation message


texts:
I have a task to add a WYSIWYG editor on the admin order comments.
So far so good. I was able to make it work.
But I have a concern. By default order comments are escaped when listed and only a few tags are allowed on the backend.

echo $this->escapeHtml($_item->getComment(), array('b','br','strong','i','u')); //backend
echo $this->escapeHtml($_historyItem->getComment());  //frontend

Also when sending the e-mail all tags are stripped.

$comment = trim(strip_tags($data['comment']));

I changed that to allow all HTML tags and it seams to work just fine, but who else writes these comments?

What I know so far is:

The admins, manually - and I trust them
Online payment methods when sending a payment update - and I trust them.

Should I look at something else?

[EDIT]
I realized from the comments below that I may have not made this clear.
Everything seams to work ok, I don't have comments appearing out of nowhere, I'm just concerned if this is a good practice or should I be careful of something else that might post order comments.


texts: Magento media folder and multiple web servers

texts:
For all the Magento people running multiple web servers, how do you handle media folder?

NFS
each server has its own media folder and keep it in sync (lsyncd?)
other "smarter" fs (glusterfs)
other


texts: Change attribute inside order product row

texts:
I want to change the default SKU attribute (product number) inside the orderview, at the items block, to a custom attribute.

See:

Currently by default the SKU is displayed, I want to change this into the DPN (my custom created attribute).

The attribute code for this is: dpn.

How can I achieve that?

I edit the file:

/app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Default.php

From default code:

public function getSku()
{
    /*if ($this->getItem()->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
        return $this->getItem()->getProductOptionByCode('simple_sku');
    }*/
    return $this->getItem()->getSku();
}

To:

public function getSku()
{
    /*if ($this->getItem()->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
        return $this->getItem()->getProductOptionByCode('simple_sku');
    }*/
    return $this->getItem()->getDpn();
}

But that does not work. When I change the value to return $this->getItem()->getProductId(); Then I get the Product Id, so that does work.

How can I get the data from the attribute?


texts: Magento 1 : Change multiselect product attribute to mutliple checkbox attribute

texts: I need to change the multi-select attributes in the admin product edit form to multiple checkbox attributes. Is this possible?


texts: How can I send an email programmatically when the order state was changed?

texts:
I'm using the Magento 2.1.6.

I'd like to send automatically an email to the customer when I change the order state to a specific and custom state that I've created (e.g custom_state).

Like that to M1.

https://www.atwix.com/magento/emails-for-custom-events/

How can I do that?

Thanks


texts: Select stock status in category->getProductCollection

texts:
I am trying to get the stock status of all products within a particular category. My current code is below but getIsInStock is not part of the default collection. How can i get this value in the same way as ->addAttributeToSelect('product_type')

$collection = Mage::getModel('catalog/category')->load($_cat_id)->getProductCollection()
->addAttributeToSelect('product_type');

foreach ($collection as $product) {
    if( $product->getIsInStock() ) {
        print $product->getProductType().' is in stock';
    }
}


texts: How to enable AJAX for the the 'Add to Cart' button of product widgets in Magento 2.2.3?

texts:
In Magento 2 the normal Add to Cart button has a very nice AJAX-based logic to add products to the cart.
However, when we use a Catalog Products List widget for example in CMS pages in the Home Page the button in this products list works with an HTTP POST which reloads the current page.
I want to add Ajax add to cart in grid.phtml in home page(Widget).

User experience suffers from this and it would be desirable if the button would have the same AJAX logic like in the default category product lists or on product pages.


texts: Magento 2, issue with getting "version" number in file paths

texts: Not my first time to install Magento 2, but something strange this time. I have checked file permission, cleaned cache, deployed again. Files are created in pub/static in expected directories but checking browser console I see there is "version###" subdirectory in  path. How this is happening?


texts: EU-Geoblocking requirements for Magento 1

texts:
A new regulation is active since december 3rd of 2018. It prohibits vendors from blocking purchases from anywhere inside the EU. You can still, however, prevent people from demanding shipment to their respective countries.

That means that people living in the border regions of foreign countries are now allowed to buy wares from vendors of different countries, if they are fine with picking them up from the vendor or shipping them only to the vendor country (a storage space, P.O. box).

Now, for Magento 1 there is a configuration for allowed countries in the backend (System -> Configuration -> General -> Allowed countries [general/country/allow]), which is documented as follows:

The Countries Options establish the country where your business is located, and the countries from which you accept payment.

That, however, is not what the option is doing. Allowing all countries here allows all these countries for both invoice address (accept payment from) and delivery address (ship to).

To comply with the Geoblocking legislative, we would need an option to restrict shipping to certain countries only, and allow invoicing to all EU (or only configured) countries.

We are currently using OneStepCheckout, and they answered that they handle it the way the standard checkout works.

How do you go about implementing this change?


texts: How can I create a key value input type for a product attribute?

texts:
I'm trying to get a table on a product page that exists of 2 columns. I want to use this to display technical details about that product. The first column would have a value like: 'volume' and then the column next to it would have '1 litre'.

I've tried to just use a normal text field and wysiwyg editor but i'd like something more structured.

I'm used to working with Drupal where this can be done with paragrahs or a custom field type.
But I'm wondering if there is a way to do this or something similar in Magento?

Actually today I've noticed the theme Magento marketplace is exactly what i want.

Does anyone know if they made this by just using Magento? Also is it maybe downloadable somewhere?


texts: Injecting additional dependencies into a class - Magento 2.3

texts:
I am trying to inject additional dependencies into a class. The class in question is:
\Magento\Customer\Block\Adminhtml\Edit\Tab\View\PersonalInfo

The construct of this class looks like:

public function __construct(
    \Magento\Backend\Block\Template\Context $context,
    AccountManagementInterface $accountManagement,
    \Magento\Customer\Api\GroupRepositoryInterface $groupRepository,
    \Magento\Customer\Api\Data\CustomerInterfaceFactory $customerDataFactory,
    \Magento\Customer\Helper\Address $addressHelper,
    \Magento\Framework\Stdlib\DateTime $dateTime,
    \Magento\Framework\Registry $registry,
    Mapper $addressMapper,
    \Magento\Framework\Api\DataObjectHelper $dataObjectHelper,
    \Magento\Customer\Model\Logger $customerLogger,
    array $data = []
) {
    $this->coreRegistry = $registry;
    $this->accountManagement = $accountManagement;
    $this->groupRepository = $groupRepository;
    $this->customerDataFactory = $customerDataFactory;
    $this->addressHelper = $addressHelper;
    $this->dateTime = $dateTime;
    $this->addressMapper = $addressMapper;
    $this->dataObjectHelper = $dataObjectHelper;
    $this->customerLogger = $customerLogger;

    parent::__construct($context, $data);
}

I want to include 3 further classes without the requirement of copying the constructor in my class therefore in my module's di.xml I have:

<type name="\Magento\Customer\Block\Adminhtml\Edit\Tab\View\PersonalInfo">
    <arguments>
        <argument name="data" xsi:type="array">
            <item name="pricingHelper" xsi:type="object">Magento\Framework\Pricing\Helper\Data</item>
            <item name="myHelper" xsi:type="object">Vendor\Module\Helper\helper</item>
            <item name="myCollectionFactory" xsi:type="object">Vendor\Module\Model\ResourceModel\CollectionFactory</item>
        </argument>
    </arguments>
</type>

Then my class looks like this:

class myClass extends \Magento\Customer\Block\Adminhtml\Edit\Tab\View\PersonalInfo
{

    public function myFunction()
    {

        $collection = $this->myCollectionFactory->create();

    }

}

However, it's not working and I get the error of

Fatal error: Uncaught Error: Call to a member function create()

What am I doing wrong?


texts: When I modify the js or html file, is there any way to not compile it?

texts:
I am modifying the js or html file in my localhost. I have to execute it every time.
php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:clean
Is there any way to not compile it every time?


texts:
As in subject, My Magento won't send subscription confirmation email.
Did some research, found one interesting thing - add extra line into app/code/core/Mage/Newsletter/Model/Subscriber.php

$this->sendConfirmationSuccessEmail();

but it still won't send confirmation message.


texts: fedex not working india as origin magento 1.9

texts:
I tried almost all available methods to sort out but nothing happens. For the USA as origin, it works perfect in testing mode but when I change origin to India with same details as I registered to FedEx it stops working.

Please suggest how to solve this.


texts: Override final_price.phtml file in Magento 2

texts:
I have created events observer which is working fine to check whether the customer is logged in or not. If the customer is not logged in then the price will not be displayed.

Here's my code:

custom_log_out.xml in

  app/code/Demo/Mymodule/view/frontend/layout:

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <referenceBlock name="render.product.prices">
        <arguments>
            <argument name="default" xsi:type="array">
                <item name="prices" xsi:type="array">
                    <item name="final_price" xsi:type="array">
                        <item name="render_template" xsi:type="string">Demo_Mymodule::product/price/final_price.phtml</item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>
</layout>

Then created final_price.phtml in

  app/code/Demo/Mymodule/view/frontend/templates/product/price

which have my custom code:

Login to Continue

But it's not working can please anyone guide me?


texts: Magento 1.9.1 strange behavior with layered navigation

texts:
I am having this strange problem with a magento installation 1.9.1.

After template changed and nothing else my previous extension for layered navigation manadev layered navigation has a strange behavior with ajax loading. When I hit a category and choose a filter with few products everything works fine. But I have some filters with more than 1000 products each.I have magento default loading up 30 products. When you hit one of these filters it tries to load all the products in same ignoring the setting of 30 products.

So when I hit a filter or category with 2000 products I get a page with 2000 products loading one by. This kills my server and of course isn't working.

I tried everything I know but still all products from database are pulled together instead of getting them by portions (items per page).

When I turn off ajax everything is working fine. I use Varnish,Apache,APC,Memcached. I see no error at all except in frontend layered navigation page ESI processing not enabled but this is because we have caches off for development.

So for some reason ajax magento default number of products.

Any help please?


texts:
I am getting this error while running my custom console command
I am creating my own custom command to creating admin users in the admin
But getting the error
Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for magento-init-params

Does anyone know why I am getting this?


texts: Over stock order quantity error message for grouped product

texts:
i need help to understand how magento 2 notify users if the ordered quantity of a grouped product is over the stock quantity when adding to cart.
Now, when i try this case, nothing happen.
Empty cart and no screen messages.
Thank you


texts: @magentoDbIsolation triggers fatal errors

texts:
When running integration tests for my custom Magento module, usage of the annotation @magentoDbIsolation causes this error to be logged:

PHP Fatal error:  Uncaught Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@magentoDBIsolation" in method \<module>\Test\Integration\Test::testXXXX() was never imported. Did you maybe forget to add a "use" statement for this annotation? in /var/vstsagent/_work/14/a/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:54

I have Magento 2.3-develop branch installed locally. I'm running PHP 7.2.10 and PHPUnit 6.5.14.

I can run Magento's core tests (which have this annotation) without issue - so what might this be? Are there some cases where adding @magentoDBIsolation enabled is not valid, based on the behaviour of the test? Could this cause the above error?

Note, there are some tests in this module which use the annotation, and do not trigger an error. I just can't understand why some would fail and others not.


texts: Product custom option price scope issue in admin side

texts:
Create a Magento environment with multiple websites and store views
Create a simple product
Add a custom option to the product with different values with different pricing
Save the product
Change the store view scope you are editing in and change the pricing of the custom options
Save
Review the custom option pricing at default and other storeview scopes

But Price of the custom option is changed


texts: Magento 2 : How to add custom discount Programatically?

texts:
I need to apply custom custom discount in cart ?

There's option for applying this in M1. Check here.https://stackoverflow.com/questions/24308094/magento-dynamically-change-discount-cost-in-cart

How can i do same thing in M2 ??

Thanks in Advance.

community-edition


texts: Magento 2: Change quote base currency programmatically?

texts:
I am creating orders programmatically in Magento 2 and want to change the order base currency as well as current currency to my custom currency,
irrespective to currency available in Store as I don't want to have any impact to frontend.

I have tried the following on Quote but failed.

    /** @var \Magento\Quote\Model\Quote $quote */
    $quote = $this->cartRepositoryInterface->get($cartId);
    $quote->setStore($store);
    /** @var \Magento\Quote\Model\Cart\Currency  */
    $currency = $this->currencyFactory->create()
        ->setGlobalCurrencyCode($order->getCurrencyCode())
        ->setBaseCurrencyCode($order->getCurrencyCode())
        ->setStoreCurrencyCode($order->getCurrencyCode())
        ->setQuoteCurrencyCode($order->getCurrencyCode())
        ->setStoreToBaseRate(1.00)
        ->setStoreToQuoteRate(1.00)
        ->setBaseToGlobalRate(1.00)
        ->setBaseToQuoteRate(1.00);
    $quote->setCurrency($currency);


texts: Magento2: Programatically update cart via event

texts:
After controller_action_predispatch_checkout_cart_index event dispatcher i am trying to update quote in cart page.All working fine except price.The price is not getting updated quote and quoteitem database table and in summary also.Can anyone help me.

<?php
namespace Vender\Module\Observer;
use Magento\Framework\Event\ObserverInterface;
class PredispatchCheckoutCart implements ObserverInterface{

    public function __construct(
        \Magento\Framework\ObjectManagerInterface $_objectManager,
        \Magento\Framework\App\Request\Http $_request,
        \Magento\Framework\Message\ManagerInterface $_messangeManager,
        \Magento\Checkout\Helper\Cart $_cartHelper
    ) {
        $this->_objectManager = $_objectManager;
        $this->_request = $_request;
        $this->_messangeManager = $_messangeManager;
        $this->_cartHelper = $_cartHelper;
    }

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

            $quoteId = intval($this->_request->getParam('quoteId'));
            $cartsess = $this->_objectManager->get('Magento\Checkout\Model\Session');
            $cartsess->setQuoteId($quoteId);
            $cartsess->setLoadInactive(true);
            $quote = $cartsess->getQuote();
            $quote->setIsActive(true);
            $quote->save();
            $quote->setTotalsCollectedFlag(false)->collectTotals();
            $this->_messangeManager->addSuccess('Product is successfully added in to cart.');
            $redirectUrl = $this->_cartHelper->getCartUrl();
            $observer->getControllerAction()->getResponse()->setRedirect($redirectUrl);

        }
    }
}


texts: Problem changing to Production mode - Command returned non-zero exit code

texts:
My Magento 2 was running normally, then I tried to change for production mode and I'm getting the following error:

Command returned non-zero exit code:
`php -f /var/www/magento2.strip-curtains.com/public_html/bin/magento setup:di:compile-multi-tenant 2>&1`

When I run the command #php -f /var/www/magento2.strip-curtains.com/public_html/bin/magento setup:di:compile-multi-tenant 2>&1

[ReflectionException] Class \Smartwave\Megamenu\Model\Attribute\SubcatColumns does not exist
setup:di:compile-multi-tenant [--serializer="..."] [--extra-classes-file="..."] [--generation="..."] [--di="..."] [--exclude-pattern="..."] [--magento-init-params="..."]

I can only run the site if I set back to developer mode.


texts:
I am currently displaying the product images for product editing. In this I have to get the produt images and insert into the 'src' of an  html element.

I know how to get the product image ..But how can i get its data and this data can be set as src of an img html element?

Thanks in advance..


texts: EAV (Entity, Attribute and Value) confusion ..?

texts:
I have some doubt in EAV. As for as I know EAV is should only be used when you are not sure about number of fields in a table which can vary in future. So eav_attribute table holds the attribute's and the values are stored in,

- eav_entity, eav_entity_int (for holding Integer values),
- eav_entity_varchar (for holding Varchar values),
- eav_entity_datetime (for holding Datetime values),
- eav_entity_decimal (for holding Decimal/float values),
- eav_entity_text (for holding text (mysql Text type) values).

I have checked those tables in default magento installed database and my magento projects (as far as i did yet) but, those tables doesn't stored any data. All are empty. Its make me mad.. Where the EAV used exactly..? Can any body explain about this with example please ..?


texts: Magento 2 - Best practice to get current date

texts:
I have to save an updated_at attribute of a custom entity and to know which is the best practice I took a look at how Magento 2 handles it.

I looked at the \Magento\Eav\Model\Entity\Attribute\Backend\Time\Updated attribute backend model class and here is the code:

public function beforeSave($object)
{
    $object->setData(
        $this->getAttribute()->getAttributeCode(),
        (new \DateTime())->format(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT)
    );
    return $this;
}

My first doubt is: which timezone is taken into consideration?

The signature of DateTime constructor is:

public DateTime::__construct ([ string $time = "now" [, DateTimeZone $timezone = NULL ]] )

According to constructor documentation:

  If $timezone is omitted, the current timezone will be used.

I suppose that current timezone is the one configured at server level.

To prove that, simply execute the following PHP snippet:

<?php
var_dump(new DateTime());

The expected result is:

object(DateTime)#1 (3) {
  ["date"]=>
  string(26) "2016-05-10 12:47:11.000000"
  ["timezone_type"]=>
  int(3)
  ["timezone"]=>
  string(11) "Europe/Rome"
}

The Europe/Rome timezone is the one locally configured on my server.

But Magento 1 was used to save date and time according to GMT 0 so to have the confirmation that this approach has changed with Magento 2 I opened the \Magento\Eav\Model\Entity\Attribute\Backend\Time\Created and here comes the surprise:

public function beforeSave($object)
{
    $attributeCode = $this->getAttribute()->getAttributeCode();
    if ($object->isObjectNew() && $object->getData($attributeCode) === null) {
        //$object->setData($attributeCode, $this->dateTime->gmtDate());
        $object->setData($attributeCode, gmdate('Y-m-d H:i:s'));
    }

    return $this;
}

The created_at attribute for EAV entities seems to be saved according to GMT 0 timezone. The updated_at according to local timezone.

What's more there are two approaches in the Created backend model, one of which is commented.

My research for the best approach needs your help.
Thank you


texts: Is it possible to load data from the server using a HTTP POST request within a Magento Module js file?

texts:
Is it possible to load data from the server using an HTTP POST request within a Magento Module js file?
File located in
app/code/MyVendor/myCustomModule/view/frontend/web/js/mycustom.js
Example request:
   function test(){
      $.post("sample_data.php", function(data, status){
        alert("Data: " + data + "\nStatus: " + status);
      });
    };

On the frontend I get 403 error when the sample_data.php is called


texts: How to add a required custom field to the client database

texts:
Firts of all, I have absolutely no knowledge about how magento works, I was going through how to make a theme, and apparently from what I understand, the theme has nothing to do with the process, like processing orders.

I need to ask document number of the customer in order to make the bill, so how add field to the checkout process and it must be a required value.

Please guide me the process flow of magento


texts: Magento 2 module does not showing , getting error unknnow module

texts:
I am using Klarna magento 2 module,My module is  in App/code direcotry. below is my  registration.php file

<?php

/**
 *
 * @category    NWT
 * @package     NWT_Base
 * @copyright   Copyright (c) 2015 Nordic Web Team ( http://nordicwebteam.se/ )
 * @license     NWT Commercial License (NWTCL 1.0)
 *
 */

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

And here is composer file

{
  "name": "nwt/base",
  "description": "NWT Base module",
  "type": "magento2-module",
  "version": "1.0.8",
  "license": "NWTCL 1.0",
  "require": {
    "php": "~5.5.0|~5.6.0|~7.0.0"
  },
  "autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
      "NWT\\Base\\": ""
    }
  }
}

I am not able to short out this issue . please help me


texts:
I am currently looking in to how my search works on my website and can't understand this function...

   public function getFrontController()
{
    if (!$this->_frontController) {
        $this->_initFrontController();
    }

    return $this->_frontController;
}


texts: Need to remove collapsible for coupon code at cart page in magento 2

texts:
In the cart page, I need to display a simple input box and Apply button for the coupon section. For this, I need to remove the collapsible element.
We need to work around

        <?php echo __('Discount Codes') ?>

Please check the screenshot. I need to remove the "Discount Codes" collapsible tab.


texts: Site Speed not showing in google analytics

texts:
I'm using Magento 1.9.1, and currently all of Google Universal Analytics is working, except I'm not seeing my page load times under behavior>site speed>overview. All fields are 0.00 sec.

I thought 1.9.1 came Universal Analytic ready. Do I need to post a line of code somewhere for page load speeds to be tracked? Or have I not enabled it somewhere?

Any help appreciated- Thanks


texts: How to add the css class or id in the form for

texts:
Hi I am having problem  with Adminhtml form customization.
I am trying to hide the table row, but tr does not have any selector, so I am trying to add the selector to the table row.
I don't know how to add selectors.  If anyone know please help me.

Here is my Form

$form = new Varien_Data_Form();
        $this->setForm($form);
        $fieldset = $form->addFieldset('storeadvertisement_form', array('legend'=>Mage::helper('advertisement')->__('Advertisement Media')));
        $fieldset->addType(
            'image',
            'Npm_Advertisement_Block_Adminhtml_Storeadvertisement_Helper_Image'
        );
        $fieldset->addField('url', 'text', array(
            'label'     => Mage::helper('advertisement')->__('Video URL'),
            'required'  => true,
            'style'     =>'display:none',
            'name'      => 'url',
            ));

        $fieldset->addField('link', 'text', array(
            'label'     => Mage::helper('advertisement')->__('Link'),
            'required'  => true,
            'name'      => 'link',
            'class'     =>  'validate-url'
        ));

Thanks in advance.


texts:
I'm currently managing a fairly large and complex Magento2 site. Admittedly, I'm more of a front-end guy. As such, I had a question.

We have 82 stores (one for each corporate customer). Each store also has external company admins who ONLY approve orders for their respective stores. They can only see their store orders when they log in. Shipping and payment methods also vary by store (in that some methods are turned off for certain stores, and have different names).

Currently, each of these is set up as a unique website (with store and store view). So, 82 websites. (ie pepsi.magento.com, coke.magento.com, fresco.magento.com, etc). This number will grow.

We had it stated to us as fact that the database is being duplicated with each new website > store > store view creation. This seems like someone is pulling my chain. Just wanted to ask the question here.

Does creating a new "website  > store > store view" add database bloat, resulting in an unscalable model? Is it better (or even advisable/possible) to use categories for each store, with subcategories for the product?

Thank you!


texts: Guest is disabled but somewhere still active

texts:
I've the Allow guest checkout to NO, but sometimes I get a Guest Sale. I don't know where is this possible, I've been looking in the whole website and there is only the checkout with Log In option.

Is there any way that the user buy without registering? Or is any way to register all user activity to know what steps were made?


texts: Convert configurable product to bundle product

texts:
I installed magento and sample data for that and now what i need to do is convert configurable product named 'CN Clogs Beach/Garden Clog' in to bundled product like
'Magento Red Furniture Set'

Configurable product is available at Home / CN Clogs Beach/Garden Clog in front side.

Bundles product is available at Home / Furniture / Living Room / Magento Red Furniture Set.

Any help regarding this will be appreciable.


texts: All emails working except new order email

texts:
New order emails not being sent from week or so. All other emails are working. I tried to send order email to customer from admin side and it shows the message "order email has been sent" but its not sent.
Any idea on how to fix that?


texts: Payment section on Order detail Page Magento 2

texts: On the admin side, payment section (Order detail page) data is not showing. I am trying to override the default code or change the current code but couldn't find the proper class. Need guidelines for the issue.Thanks


texts:
I am new in magento module development. I was searching for something similar to this
https://www.mageplaza.com/devdocs/how-add-custom-discount-magento-2.html
I just editied the code in step 2 to meet my requirements. The subtotal and grand total is correct but Custom Discount always appears $10
I tried to edit the function in step 4
getCustomDiscount : function(){
               return '$10';
           }

I tried to change the value and flushed magento cache but nothing happened. Any suggestion please?


texts: Should I be using Magento FPC and Block Cache?

texts:
I am working on a Magento EE 1.11 site in which :

A registered User can add product which appears on the respective category listing page to all (even non-logged in user).
When user clicks on the 'Add To Cart' this button changes to 'In Cart'
Above case also applied to the Product view page.
This is a medium traffic site.

Now:

Due to some customizations done by a third party vendor, the category landing page loads too slow, we have reached a limit beyond which we are not able to improve on the page load speeds anymore.
Hence 'Caching' seems to be the way ahead. And when we enabled FPC and Block HTML cache the page load times improved.
Now, some blocks we observed need to be 'Hole Punched' like 'In Cart' etc.

Questions:

With the above given scenario where the user can add products means invalidating the category cache too often. Is it worth enabling FPC + block Cache and Hole punching. Will that actually give us any page load time reduction / less resource usage ?
In general what is the criteria for deciding to enable FPC and Block Cache ?
If FPC is enabled should I still enable Block HTML cache (I understand Block HTML cache o/p of a block but still) ?
What pages does FPC cache (Is there a way to identify? from the full_page_cache folder) by default ?
Are there any points I need to keep in mind when enabling FPC, what actions clear FPC.

Sorry for the type of questions, but after having read all the material  my confusion has only increased. Thanks in Advance!


texts: CSS / JavaScript files not changing in adminhtml (cache?)

texts:
I have an unusual issue occurring in the admin panel, I updated M2ePro and it has a new set of css/js files that need to be changed to make it work. The problem is when I change this in my phtml file, nothing changes. Here's a list of things I've tried:

Disabled Full Page Cache via XML (and refreshed config cache to make sure that changes in app/etc/modules reflected)
Clear Cache and Cache Storage, as well as manually rm -rf var/cache/*
Refreshing all types of cache
Disabled Javascript merging to see what files were moved/missing exactly
Ran a script to manually refresh all types of cache regardless of a tag (the Magento way)

Mind you, this installation uses the standard Magento cache methods, the only difference is we have allocated memory mounted at var/cache so it runs faster, as we had numerous issues with Memcache and had to use this method instead, which still works fine with all the normal Magento methods of cache implementation. My permissions are correct, chown'd and chmod'd to 755 across the board.

Am I missing anything here? This has had me stumped for a couple of days now which is longer than this sort of issue should ever take.

Any advice or questions to help solve this would be greatly appreciated.


texts: Uploaded images won't show admin: CMS/Pages

texts:
I'd like to know why the images I upload and integrate in pages show up in front office but not in the admin view.

Thanks for your help.

What I get in the admin http://imagizer.imageshack.us/v2/280x200q90/902/GRtuS7.jpg


texts: Clean Magento2 Cache with Capistrano on multiple server

texts:
I'm using Capistrano to deploy magento2 on multiple instances.
The deploy works well. I'd like to use an extra command like:

cap production magento:cache:clean

But the cache is cleared just on one server.

Any suggestion on what I'd have to check?
Thank you


texts:
I am working in version 1.9.2.4.

I have a problem with the add to cart button when I am not logged.

It does not appear in the category grid search but in the list view it does.

That happened with the single product view too.

I modified the file list.phtml from /app/design/frontend/royal/hijo/template/catalog/product

I remove the code but the problem still existing

if(Mage::getSingleton('customer/session')->isLoggedIn() && $total > 0)


texts: Disabling a UI component field while add new product in Magento 2

texts:
I have a UI component defining field, I want to display this field while edit existing product, and hide this field when add new product.

  Namespace\Modulename\view\adminhtml\ui_component\product_form

<fieldset name="vendorproduct">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Seller Sell This Product</item>
            <item name="collapsible" xsi:type="boolean">true</item>
            <item name="sortOrder" xsi:type="number">65</item>
        </item>
    </argument>
    <container name="vendor_data" >
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="sortOrder" xsi:type="number">10</item>
            </item>
        </argument>
        <htmlContent name="html_content">
            <argument name="block" xsi:type="object">Namespace\Modulename\Block\Adminhtml\Catalog\Product\Edit\Tab\Seller</argument>
        </htmlContent>
    </container>
</fieldset>

Using <item name="disabled" xsi:type="boolean">true</item> I can disable  fields but I want to disable them while adding new product only. how can I achieve this.

Any help is appreciated. Thanks.


texts:
Currently i've got products in a category sub of default for example:

  Root -> Sub cat -> product

I've noticed that on the product page itself the breadcrumbs are working fine for some products and not for others. Some products will show the category and others wont show the category in the breadcrumb, they will either not show the category or they will show the category.

Something else i have come across is if I currently don't assign the product to default cat the following happens:

  The product is assigned to default cat

  The product has a sort order of 0 in the category list

The breadcrumbs don't show the category.

What is going on? Why is the breadcrumb breaking when it is either assigned to this Default cat ( which is the root cat btw ) and I don't get what is happening with the products where the category isn't being shown in the breadcrumb.

Magento is on 2.2 - I've reindexed - I've flushed cache.

I've also pulled all of my hair out - no just a joke.

* EDIT *

If anyone is having this issue, Full page cache is the culprit - disable this, flush cache and it should work how it is required.


texts: Do not apply catalog price rules on a product already on sale

texts:
We are runnning Magento EE 1.13.

We have a very large catalog (20 000 products) and 2000 categories.

We run a lot of sales but we do not use a sale category. We simply add a special price to the individual products which then show up as "on sale" in their respective categories.

We also have franchises(a customer group) that gets 30% discount on all products site-wide.

The problem we are facing is that the catalog price rules for franchises group(30% discount) applies to the already discounted price of sales on individual products eg :

Product default price is 100. Special price is 90 (for this specific product);
When a franchise logs in, the catalog price rule applies to the already discounted price of 90

We would like the franchises to get the 30% discount only on the original price and not on the special price.

How could I achieve this?


texts: How does a Module call a custom layout in Magento? What are pre-requirements for creating a module?

texts: In Magento, how does a Module call a custom layout file? What are the pre-requirements for creating a module?


texts: add a tag LIMITED QUANTITY to products in Magento community 1.9

texts:
kindly note i have a selective products around 20 that i need to show a label or a tag " LIMITED QUANTITY". i tried the add tag under catalog but its only related to back end and administrator use and not to front end use. can anyone help me how to make this enable on website front end?
thanks in advance for help and support.


texts:
I wish to add 'role="contentinfo"' attribute to footer tag on the frontend. I see the footer is created via container tag in xml.
<container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer"/>

Is there any argument for adding role attribute?


texts: Magento 2 displays price VAT excluded for non logged in user

texts:
I have a problem with my magento 2.1.4
I set up tax ruke for the normal user (19%). The price I entered in the admin are VAT included.
I want to display by default that price.
When a user log in, both prices work fine as you can see :

But a non logged in user sees only VAT excluded price !!! as you can see:

Here is my TAX configuration


texts: Should BLOCK_HTML invalidate EVERY time we save a product?

texts:
My client raised this question today and I wanted to give a concise answer, as I understand it , the cache is only invalidated on the item that was updated?

Can anyone elaborate. This is EE 13.0.2


texts: Magento2: Get Quote details in view page

texts:
I can't get the current quote in the Product view page. I have 3 items in my cart.

I have used both files.

use Magento\Checkout\Model\Session;
use Magento\Checkout\Model\Cart;

$quote = $this->_checkoutSession->getQuote();
echo $quote->getId();

But, I can't get it. After that adding new product in view page. I can got it.

How to do that.

Thanks.


texts: Add additional service to buy on product page

texts:
I want to add some additional services to our productpage.
By default people buy product with manufacturer warranty, but I want to add an additional service.

So that people can buy the default manufacturer warranty or 2 additional insurance packages.

All our current products (15000+) are simple products, so we can not easily switch this to configurable products.

What is the best way to add this?


texts: Is anyone aware of a Magento module that allows you to input multiple emails on the order page or customer account? This would only need to be done from the admin side.


texts: Import products and customer data programatically

texts:
I needed to programatically export and import customer data, product data and order details. I've successfully created my exports. I'm having problems with my import.

I need to do this using an external PHP script, which is located at project root.
I need to upload products, customer data, customer addresses from a (separate) CSV file.

How can I do this?

I have the ususal Magento attributes and few custom product attributes.

Please can someone help me out?

Here is what I got so far:

<?php

use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';

ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);

$importProduct = getProductImport();

function getProductImport(){

    $bootstrap = Bootstrap::create(BP, $_SERVER);
    $objectManager = $bootstrap->getObjectManager();

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

    $file = 'import/products.csv';
    $arrResult = array();
    $headers = false;
    $handle = fopen($file, "r");
    if (empty($handle) === false) {
        while (($data = fgetcsv($handle, 100000, ",")) !== FALSE) {
            if (!$headers) {
                $headers[] = $data;
            } else {
                $arrResult[] = $data;
            }
        }
        fclose($handle);
    }

    foreach( $arrResult as $importProduct ) {
        $product = $objectManager->create('\Magento\Catalog\Model\Product');

        $product->setWebsiteIds(array(1));

        $product->setAttributeSetId($product->getDefaultAttributeSetId());

        $product->setSku($importProduct[0]);
        $product->setName($importProduct[5]);

        $product->setStockData(
            array(
                'use_config_manage_stock' => 0,
                'manage_stock' => 1, // manage stock
                'min_sale_qty' => 1, // Shopping Cart Minimum Qty Allowed
                'max_sale_qty' => 2, // Shopping Cart Maximum Qty Allowed
                'is_in_stock' => 1, // Stock Availability of product
                'qty' => 78
            )
        );
        $product->save();
        echo "Upload simple product id :: ".$product->getId()."<br>";

    }

}

?>


texts:
Is the column Action very important to being displayed in admin grids?
It is actually doing exactly the same thing as "click on selected row" a'm I right ?
So if I hide it will it affect anything ?

        if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) {
        $this->addColumn('action',
            array(
                'header'    => Mage::helper('sales')->__('Action'),
                'width'     => '50px',
                'type'      => 'action',
                'getter'     => 'getId',
                'actions'   => array(
                    array(
                        'caption' => Mage::helper('sales')->__('View'),
                        'url'     => array('base'=>'*/sales_order/view'),
                        'field'   => 'order_id',
                        'data-column' => 'action',
                    )
                ),
                'filter'    => false,
                'sortable'  => false,
                'index'     => 'stores',
                'is_system' => true,
                'column_css_class'=>'no-display',
                'header_css_class'=>'no-display',
        ));
    }

To make it invisible added two lines:

'column_css_class'=>'no-display',
'header_css_class'=>'no-display',

instead of removing or comment.


texts: how to show customer authentication popup when clicking on checkout button in minicart while guest checkout is enable mangento 2

texts:
I want to check if a user is logged in before proceeding to checkout. On the basis of customer login condition, i want to show the login popup if not login, and redirect to checkout if logged in already.
IMPORTANT: I have guest checkout enabled in the configuration. Because I want user to checkout with guest account
I am able to redirect user to login page when not logged in. But not able to use popup instead of redirecting it to login page.
to redirect user to login page, I did the following changes in my minicart.js file:
var cc = customerData.get('customer');
if(cc().firstname){
    console.log("customerData",true);
    var urls = window.checkout.checkoutUrl;
}else{
    console.log("customerData",false);
    $( document.body ).removeClass( "logedin" );
    var urls = window.checkout.customerLoginUrl;
}

please help me find out how to use popup login instead redirecting to login page.


texts: Magento session files are deleted in var/session folder every few hours

texts:
Magento gives you two options to store session data, in the database or the file system.

We like to keep the session information for a few days to be able to follow up abandoned carts and give the customer the ability to see his cart if he comes back the other day.

Storing the sessions in the database everything works fine, but the database is getting quite large.

When storing the session data in the file system in var/session this folder is cleared every few hours. Sometimes all files will be deleted after 2 hours, sometimes after 6 and somtetimes after 11 hours. To me it looks like some cron job or automation is doing this. I was thinking it might be some configuration in the php.ini like sess.gc_maxlifetime, but here is what makes me think it is one of our extensions doing this:

Having two shops, one is our live shop connected to our ERP by a special extension and the second one is an identical clone, but not connected to our ERP. All other parameters (php, .htaccess, admin backend settings etc.) are the same. On the live shop the directoy var/session will be cleared and on the second shop the files will be kept forever.

Running Magento 1.9.2.1, but having this issue since 1.4.

Any idea what might lead to the deleted files?


texts:
I bought a theme for magento2 and I would like to change the layout for the homepage only.

It's currently a 2 columns layout and I want to completely remove the left column and have the main column with 100% width. Is it possible to do this for the homepage without affecting other pages ?

Here is the shop is that helps: https://schmuggler-shop.de/

Which files would I have to edit ?


texts: How to redirect after changing product URL?

texts:
I'm trying to change products URL on save using:

$product->setUrlKey($url);.

It works just fine but when I't trying to reach in front the product, it's responsing to Old URL.
How can I make product to respond to New Url?


texts: Why is there another image when uploading via REST API

texts:
I am sending a POST request to the upload an Image
{
    "entry": {
        "media_type": "image",
        "label": " image",
        "position": 1,
        "disabled": false,
        "types": [
            "image",
            "small_image",
            "thumbnail"
        ],
        "content": {
            "base64_encoded_data": "My base64 Encoded string",
            "type": "image/jpeg",
            "name": "250557"
        }
    }
}

I get a success result , but when I query the image I just posted via POSTMAN I get two results as below:
[
    {
        "id": 10001,
        "media_type": "image",
        "label": " image",
        "position": 1,
        "disabled": false,
        "types": [],
        "file": "/1/250557_2.jpg"
    },
    {
        "id": 10002,
        "media_type": "image",
        "label": " image",
        "position": 1,
        "disabled": false,
        "types": [
            "image",
            "small_image",
            "thumbnail"
        ],
        "file": "/1/250557_1_2.jpg"
    }
]

as you can see there are extra images. I am not sure what to check in Magento and why it would do twice.Can someone help please?


texts: Pull in addresses from separate database table to save under customer data when account created

texts:
I have an extra field in my customer account registration where the customer can choose a US school from our database that they are affiliated with. We want to have the school address populated into the customer data when the customer account is created.

I have turned on address fields in customer account creation via the following xml in local.xml. I temporarily have the fields commented out in the register.phtml template. I am going to post the address this way, but if there is more than one address I would like to add to the customer account, how would I add more during the registration post?

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

Going to do an ajax call to obtain the school address then append the applicable values in the following hidden fields. Again, I will often need to post more than one address.

<?php if($this->getShowAddressFields()): ?>
        <input type="hidden" name="create_address" value="1" />
        <input type="hidden" name="company" id="company" value="" title="<?php echo $this->__('Company') ?>" />
        <input type="hidden" name="telephone" id="telephone" value="" title="<?php echo $this->__('Telephone') ?>" />
        <input type="hidden" name="street[]" value="" title="<?php echo $this->__('Street Address') ?>" id="street_1" />
        <input type="hidden" name="street[]" value="" title="<?php echo $this->__('Street Address 2') ?>" id="street_2" />
        <input type="hidden" name="city" value="" title="<?php echo $this->__('City') ?>" id="city" />
        <input type="hidden" id="region_customer_id" name="region_cait_id" title="<?php echo $this->__('State/Province') ?>">
        <input type="hidden" id="region" name="region" value="" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
        <input type="hidden" name="postcode" value="<?php echo $this->escapeHtml($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
        <input type="hidden" name="default_billing" value="1" />
        <input type="hidden" name="default_shipping" value="1" />
    <?php endif; ?>

If I need to create a module instead: What event should I hook into? How do I save an address into customer data? I will need values posted on the customer account creation form.


texts:
I am trying to switch stores programatically. I used following code to achieve it :

/**
* @var \Magento\Store\Model\StoreManagerInterface
*/

protected $_storeManager;

public function __construct(
 \Magento\Store\Model\StoreManagerInterface $storeManager
) {
$this->_storeManager = $storeManager;
}

and then :

$this->_storeManager->setCurrentStore('YOUR_STORE_ID');

as given in https://magento.stackexchange.com/a/173763/59686

But no success. Only default store is displayed(selected) on storefront.

I have also tried this url scheme http://mystoreurl.com/?___store=storeId but it only display the store with given id instead of switching the store completely, Means when i visit the main url (http:mystoreurl.com), it is again displaying default store.
Is there any way to switch the store programatically just like it is selected as default from admin.

Or is there any way to add some readymade widget to switch stores (Store Switcher). The theme i am using does not have this feature to auto populate store switcher as default Magento Luma theme provides.


texts: custom backend tab in customer details with custom link to my custom controller

texts:
i have create a module added a tab in customer detail page by using layout, here is the block at

app\code\local\Namespace\Modulename\Block\Adminhtml\Customer\Edit\Tab\Action.php

<?php

/**
 * Adminhtml customer action tab
 *
 */
class Namespace_Modulename_Block_Adminhtml_Customer_Edit_Tab_Action
 extends Mage_Adminhtml_Block_Template
    implements Mage_Adminhtml_Block_Widget_Tab_Interface
{

    public function __construct()
    {
        $this->setTemplate('customertab/action.phtml');

    }

    public function getCustomtabInfo(){

        $customer = Mage::registry('current_customer');
        $customtab='My Custom tab Action Contents Here';
        return $customtab;
    }

    /**
     * Return Tab label
     *
     * @return string
     */
    public function getTabLabel()
    {
        return $this->__('Action Center');
    }

    /**
     * Return Tab title
     *
     * @return string
     */
    public function getTabTitle()
    {
        return $this->__('Action Tab');
    }

    /**
     * Can show tab in tabs
     *
     * @return boolean
     */
    public function canShowTab()
    {
        $customer = Mage::registry('current_customer');
        return (bool)$customer->getId();
    }

    /**
     * Tab is hidden
     *
     * @return boolean
     */
    public function isHidden()
    {
        return false;
    }

     /**
     * Defines after which tab, this tab should be rendered
     *
     * @return string
     */
    public function getAfter()
    {
        return 'tags';
    }

}
?>

the tab is added with link http://localhost/m1/index.php/admin/customer/edit/id/135/key/ad3a6475755fae42cfe5eb9f0a616e09/#

it is possible to change this link to

http://localhost/m1/index.php/admin/custom/index/key/3ef15c673b708250e0eff44c716d5a96/

----update----

app\design\adminhtml\default\default\layout\customertab.xml

<?xml version="1.0"?>
<layout version="0.1.0">
    <adminhtml_customer_edit>
         <reference name="customer_edit_tabs">
            <action method="addTab">
                <name>customer_edit_tab_action</name>
                <block>customertab/adminhtml_customer_edit_tab_action</block>
                <url>admin/custom</url>
            </action>
        </reference>
   </adminhtml_customer_edit>
</layout>


texts:
Is Magento preparing images while the page is loaded by the device or use cached images regardless the device size?

If it creates and caching images - same for each device - I would like to change it and load images resized to the exact size required by the device so it could increase page loading speed (I hope).

If it is a good idea what/which function should I rewrite?

What do you think guys ?

I already started a imgproxy server which is resizing/cropping images, image url, width, height then send it to the server and display returned "optimized" image. Not sure where to add/change the code, any suggestions ?

Partially problem solved, still I would like to do it better.