texts:
How to pass dynamic value for  <item name="componentDisabled" xsi:type="boolean">false</item> this component.

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_columns">
        <column name="order_comment">
            <argument name="data" xsi:type="array">
                <item name="js_config" xsi:type="array">
                    <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
                </item>
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="componentDisabled" xsi:type="boolean">false</item>
                    <item name="label" xsi:type="string" translate="true">Order Comment</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>

I also refer http://devdocs.magento.com/guides/v2.2/ui_comp_guide/concepts/ui_comp_modifier_concept.html.   But this only for admin form.

How to do this...Is there any possibility.....


texts: Duplicate configurable products in Magento programmatically

texts: I want to duplicate configurable Products with their associated products programmatically in Magento. Can anyone help regarding this.


texts: Finding source of a div "toolbar-top" on inhereted Magento 1.9 Project

texts:
I am working on a relatively complicated Ecommerce store on Magento 1.9. I need to add some very simple paragraph text above a toolbar header that floats in the category navigation section of the store.

Using Chrome's inspect element I can find that the toolbar is contained in a div called "toolbar-top" and I can find a lot of bootstrap files that control the styling. For what I need though, I need the source file of the div itself.

Most of the phtml files for the webpages seem to be in the directory for a custom theme "at-store" which has both "default" and "custom" directories that seem to be almost identical.

Does anybody have any thoughts on how I could go about tracking down the div containing this toolbar? Will be happy to provide more info once I get an idea of what kind of info would be relevant. Thank you very much!


texts: Magento2: Move Email Address Field above Shipping Address Label on magento checkout?

texts: I want to move Email Address field above the shipping address Label on checkout page, because it looks weird in i-pad version. In which file, I can make change code?? which file I have to override?


texts: "Unable to save Stock Item issue" when I try to create multi-able simple products via RESTful API

texts:
I m using Magento2 API to create a configurable product, So I need to create numbers of the simple products first, but wired thing happened, some of the products have successfully created, but most of them failed.

the errs message is {message: "Unable to save Stock Item"}

some people could help??


texts:
I am trying to extend the Luma Theme in Magento 2,

But it does not work as expected.

I added my Theme,

let it extend from Luma,

flushed all Caches,

Published all Statics and activated the Theme in the Backend.

I would expect, that the Frontend looks like the standard Luma Theme which comes with Magento2,

but it lookes like the standard Blank Theme. No Images, no luma Content, nothing.

Is there anyone who can help? This is my theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>My Theme</title>
<parent>Magento/luma</parent>
<media>
    <preview_image>media/preview.png</preview_image>
</media>


texts: Fatal error: Uncaught Error: Call to undefined method getDirectoryRead()

texts:
I have a controller that works and does what i need it to do if i manually add a path like: $mediaImages = '/magento/pub/media/images/';

But i cant get the DirectoryList injection to work, it returns undefined method?

<?php
  namespace Vendor\Module\Controller\Adminhtml\UpdateTable;

  class Index extends \Magento\Framework\App\Action\Action
{
    protected $_pageFactory;
    protected $_postFactory;
    protected $_filesystem;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\View\Result\PageFactory $pageFactory,
    \NewcastleMotorcycles\AdminMenu\Model\PostFactory $postFactory,
    \Magento\Framework\App\Filesystem\DirectoryList $filesystem
    )
{
    $this->_pageFactory = $pageFactory;
    $this->_postFactory = $postFactory;
    $this->_filesystem = $filesystem;
    return parent::__construct($context);
}

public function execute()
  {
    $mediaImages = $this->_filesystem->getDirectoryRead(DirectoryList::MEDIA)->getAbsolutePath('images/');

  }
}

The error i get is:

  Fatal error: Uncaught Error: Call to undefined method
  Magento\Framework\App\Filesystem\DirectoryList::getDirectoryRead()

I'm obviously missing somtehing, any advise would be great!


texts: Magento 2 Search - how to show result when customer search for a SKU with prefix and suffix? EX: AA-SKU1234

texts:
Is there a way to return result for 'SKU', if the customer search for the term like 'AA-SKU2033'?

Currently, our product has the following format on the actual product sticker 'AA-SKU2033'

'AA-' is the prefix, and it's always the same.
'SKU' is the actual SKU on magento 2 website
'2033' is a four digit numbers for lot number purpose, for example year of 2020 and week of 33, and it changes overtime.

Is there a way for magento to handle that? or is there a recommended search extension can be configured to work with it?

I'm currently on magento 2.2.9
Thanks.


texts: Migration from Magento 1 to Magento 2 Delta

texts:
We are doing a migration from Magento 1 to Magento 2.

Step 1 and step 2 are going good, all products and settings are migrated to Magento 2. But when I do step 3 delta, only changes in products are updated, when I add a new product to Magento 1 it does not upgrade Magento 2 with the new product.

Am I doing something wrong or is this a feature that's not supported?

1 bin/magento migrate:settings
2 bin/magento migrate:data
3 bin/magento migrate:delta


texts: After making ajax query controller redirects back to product page

texts:
I’m making an ajax query from a product page (code below). If I run it directly in browser, it works but if I run it inside a code (javascript) it redirects me back to the product page with a status 302 (picture attached).
It’s Magento 2.4.0.
How to make it work right so it won’t redirect me back to product page? Thanks in advance!
    <?php
namespace Vendor\Module\Controller\Ajax;

use Magento\Framework\App\Action\Context;
use Magento\Framework\Controller\Result\JsonFactory;
use Magento\Framework\App\Action\HttpGetActionInterface;

class FooAction implements HttpGetActionInterface
{
    /**
     * @var \Magento\Framework\App\Action\Contex
     */
    private $context;
    /**
     * @var \Magento\Framework\Controller\Result\JsonFactory
     */
    protected $resultJsonFactory;

    /**
     * @param \Magento\Framework\App\Action\Context $context
     * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
     */
    public function __construct(Context $context, JsonFactory $resultJsonFactory)
    {
        $this->context = $context;
        $this->resultJsonFactory = $resultJsonFactory;
    }

    /**
     * @return json
     */
    public function execute()
    {
        $params = $this->context->getRequest()->getParams();
        $resultJson = $this->resultJsonFactory->create();
        $resultJson->setData(['message' => 'Hello world', 'success' => true]);
        return $resultJson;
    }
}

                $.ajax({
                    url: baseUrl + 'module/ajax/fooaction',
                    type: "POST",
                    data: {},
                    showLoader: true,
                    cache: false,
                    crossDomain:true,
                    dataType: 'json',
                    success: function(response){
                    }
                });


texts: Users on IE and Edge have to log in twice on Magento 2 store

texts:
I was tasked on fixing JS console errors and browser testing for a Magento site that someone else developed (I assume the original developers quit). I got this finished, but now I am encountering a strange issue on login.

On Edge, IE11, and Chrome Incognito (not normal Chrome) this is what happens:

User clicks login link and goes to login page
User fills in information and submits form.
Page redirects (302) back to the login page and there is NO error message, console error, etc.
User fills out login information again, and this time (without fail) the login works.

It's very frustrating. I've tried the following:

Clearing cache
Checking cookies before and after. This is difficult, because I cannot replicate the issue with any regularity on normal chrome, which is where I can view the cookies. Clearing cache and cookies still does not replicate the issue consistently.


texts: Imported image roles are lost on update in Magento 2

texts:
I use an import script to create products with associated images that are assigned to roles thumbnail and small image.

It works well, products and images are imported and they display as thumbnail and small image on the front-end website.

But when I try to edit one of those products via Magento admin, the roles thumbnail and small image are not selected in the UI and saving the product will make this image's roles to be lost.

Why may cause effective thumbnail to not be detected as one when loading the Edit product page? Did I do something the bad way in this import script?

Any clue of what the source of this problem can be?

Here is the import code:

    $product->setMediaGallery(array(
                                  'images' => array(),
                                  'values' => array()
                              ));

    foreach ($product['pictures'] as $key => $picture)
    {
        $image_url = $picture['picture'];
        $image_ext = pathinfo($image_url, PATHINFO_EXTENSION);
        $imageData = base64_encode(file_get_contents($image_url));
        $image = $this->_imageContentFactory->create()
            ->setType('image/jpeg')
            ->setName($sku . '-' . $key . '.' . $image_ext)
            ->setBase64EncodedData($imageData);

        $entry = $this->_productAttributeMediaGalleryEntryFactory->create();
        $entry->setContent($image);
        $entry->setMediaType('image');
        if (0 == $key)
            $entry->setTypes(['image', 'small_image', 'thumbnail']);
        else
            $entry->setTypes(['image']);

        $entry->setDisabled(false);
        $entry->setPosition($key);

        $entries[] = $entry;
    }

    $product->setMediaGalleryEntries($entries);

    $product->setImage($entries[0]->getFile());
    $product->setThumbnail($entries[0]->getFile());
    $product->setSmallImage($entries[0]->getFile());
    $this->_productRepository->save($product);

EDIT: after more investigation, it appears roles are only lost for 'all store views', in any other store views, the image rules are correctly detected.


texts: Magento 2 How to Create Shipment Programmatically

texts:
Here am trying to make shipment from a controller.
here is my controller
public function execute()
    {
      $orderId= 11;
      if ($orderId <= 0) {
         echo 'Order not found.';
         return;
      }
      try {
           // load order from database
           $order = $this->orderRepository->get($orderId);
           if ($order == null) {
              echo "Order not loaded from database.";
              // return;
            }
            $this->createShipment($order);
          } catch (\Exception $exception) {
                    echo 'Errorww: ' . $exception->getMessage();
    }
protected function createShipment($order)
    {
        if ($order->canShip()) {
            $shipment = $this->shipmentFactory->create($order);
            $this->shipmentRepository->save($shipment);
            $this->shipmentNotifier->notify($shipment);
        }
    }

Here am getting error as
Errorww: The shipment couldn't be saved.

Where am doing wrong. Can i get help? Thank you in advance.


texts:
This is a follow up of Magento 2 xml validation:
I understood how to map xsi:noNamespaceSchemaLocation in my IDE so I will get real time validation of my xmls.
But what if I have to create my own config file with it's own validation schema?
What value should I put for xsi:noNamespaceSchemaLocation ?

Right now I have this in class.xml:

<?xml version="1.0"?>
<classes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="class.xsd">
   ....
</classes>

This works nicely, because class.xsd is in the same folder as my class.xml.
But I plan to make my module extensible and actually composed from multiple modules.
Now I use in the additional modules a relative path to the class.xsd file and this seams a bit wrong.

<?xml version="1.0"?>
<classes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Base/etc/umc/class.xsd">
   ....
</classes>

Obviously I cannot use urn:magento:framework... because my module is not in the framework, and I also cannot use urn:magento:module... because mine is not a core module. Or can I use the latter?
Or should I use a custom urn?
And (last one) if I use a custom urn will this be picked up automatically by the command bin/magento dev:urn-catalog:generate or should I dos something special?


texts:
I am making a Mage::getModel call to try and get all products in a certain category that is in stock.

$stockIds = Mage::getModel('cataloginventory/stock_item')
    ->getCollection()
    ->addQtyFilter('<=',1)
    ->addFieldToFilter('is_in_stock', 1)
    ->getAllIds();

$_productCollection=Mage::getModel('catalog/category')
    ->load(51)
    ->getProductCollection()
    ->addIdFilter($stockIds)
    ->addAttributeToSelect('*')
    ->setPageSize(10)->setCurPage(1);

Everything works apart from the ->addFieldToFilter('is_in_stock', 1) line. Without it all products in the category show up. With it, it's filtering some (apparently random) products out, but not based on whether it is 'In stock'. Some out-of-stock items still appears, and some in-stock items do not appear.

I have checked that all the products are enabled and all quantities are at least 10.

How do I get all products in a certain category that is in stock?


texts: How do you give multi-stores different themes in Magento 2?

texts:
Under Stores/Different Stores I have set up a new website, store and store view. The new store has its own root category. I've set up the base urls to point the the second url. I've done the sym links etc. The URL now points correctly to the store but I cannot figure out how to set a different theme for my second store.

I go into Content/Design/Configuration and my new store is nowhere to be seen. I have no idea how to specify that I want a different theme for it.

Can anyone advise me?


texts: Magento 2 - How to make all tab open at admin catalog product

texts:
I want to open all tab when I open admin catalog product page. Check below screenshot, in which I require to open all visible tab.

By default, all tab is closed when we edit catalog product at admin side.

How to make it all tab open?


texts: Is this possible? Back to last viewed category page after viewing details?

texts:
Example: A category has 72 items in it

In catalog settings we have set the number of items to show per page to 24

So in front end there will be 3 pages with 24 items each.

Now when a customer views the pages and is on page 3, than clicks an item on that page to view the details, and after that hits the back button, than they are on page 1 of that category again instead of page 3

is this standard Magento behaviour? Can this be changed, so it will take the customer back to the last viewed page?


texts: Magento 2: CDN Recommended for Magento 2, Community Edition

texts:
We were examining the possibility of adding a CDN service for our platforms on Magento 2.
However, this possibility had already been adopted in the past and had created several problems with the management of FPC and some styles, but this on Magento 1.
Is there any recommended service that can be used that is as close as possible to the Magento platform?

Thank you!


texts: Incorrect credit card expiration date Magento 2.1.8

texts: I am creating custom payment gateway for Magento 2 but facing error in credit card form.


texts: I've category and subcategory that subcategory is shown after moving mouse on ,I for accelerating speed of loading of my site have enabled the feature (use flat catalog category)But after enabling this feature subcategory will not be displayed when moving mouse on and in some pages the picture of category is not displayed,my Magento version in 1.8


texts: Magento after upgradation from 1.4 to 2.2 facing Broken reference issue in system log

texts:
[2019-02-07 08:57:11] main.INFO: Broken reference: the 'catalog.compare.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2019-02-07 08:57:11] main.INFO: Broken reference: the 'sale.reorder.sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2019-02-07 08:57:11] main.INFO: Broken reference: the 'wishlist_sidebar' element cannot be added as child to 'sidebar.additional', because the latter doesn't exist [] []
[2019-02-07 08:57:11] main.INFO: Broken reference: the 'checkout.cart.item.renderers.gift-card.actions.gift_options' element cannot be added as child to 'checkout.cart.item.renderers.gift-card.actions', because the latter doesn't exist [] []
[2019-02-07 08:57:11] main.INFO: Broken reference: the 'currency' tries to reorder itself towards 'store_language', but their parents are different: 'header.panel' and 'porto_header' respectively. [] []
[2019-02-07 08:57:11] main.INFO: Broken reference: the 'catalog.compare.link' tries to reorder itself towards 'top.links', but their parents are different: 'header.links' and 'header.panel' respectively. [] []
[2019-02-07 08:57:11] main.INFO: Broken reference: the 'upcoming-points-message-wrapper' tries to reorder itself towards 'top.search', but their parents are different: 'header-wrapper' and 'porto_header' respectively. [] []
[2019-02-07 08:57:11] main.INFO: Broken reference: the 'checkout.cart.item.renderers.gift-card.actions.gift_options' tries to reorder itself towards '', but their parents are different: 'checkout.cart.item.renderers.gift-card.actions' and '' respectively. [] []
[2019-02-07 08:57:11] main.


texts: Magento 2.2.5: Adding cart-attribute for cart-rules / conditions tab

texts:
I use a product attribute called "carton" which describes in how many carton a product is packed. I want to add a cart-rule which counts the amount of all cartons in the cart (accordingly the amount entered for each product in carton product-attribute).

According the total amount of cartons i want to offer special discount.

The function is similar to the weight function which also make a sum of all weight in the cart.

Your help would be really appreciated!
Thank you


texts: External database connection error in magento 2.3.4

texts:
Here is my function for external database connection
and using connection factory class to create connection, it is working fine in 2.3.3.
//use Magento\Framework\App\ResourceConnection\ConnectionFactory;

public function getConnection(){
 $db = $this->connectionFactory->create(
            [
                'host' => XX.XXX.XXX.X,
                'dbname' => 'dbname',
                'username' => 'username',
                'password' => 'password',
                'active' => '1',
            ]
        );
    return $db;
}

However when i tested it in 2.3.4 i am getting this error

Exception #0 (Zend_Db_Adapter_Exception): SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'
Exception #1 (PDOException): SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'

Note: host is external IP of the database that i am using to connect.


texts: In magento backend i can't able to add content, it showing empty. check my image it won't have editor


texts: Magento 1.9.1 + Patch SUPEE 6788 breaks custom theme

texts: Last day I Install Patch SUPEE 6788 then my website is blank also widget block so i am very stress please help me how can i resolve it


texts: add new field in magento(1.9) in admin customer creation only

texts:
Hello a i need i add new filed admin customer creation form, the field name is VIP, i search so many links related to my requirement but not in magento(1.9).

can you please give some idea related to my requirement.

Thank you


texts: Show/Hide Editor is missing in the CMS > Pages

texts:
Can anyone here help us to fix our issue on the

  CSM > pages

The Show/Hide Editor is missing

  https://www.screencast.com/t/DqD5QEiaDmNG


texts: Magento Product pages calling wrong category url

texts:
I am creating a new template theme for my magento store, I am using an old version of magento so I thought I would upgrade to the new version.

I am creating it on a new store in a subdirectory but it seems sooo slow compared to the current version of magento. I am still using all the same themes & extensions.

I have run a webpage speed test and it is saying when on a product page (http://www.hjtemplate.hjjewellery.co.uk/category-1/product-1.html) it is also trying to load this URL (http://www.hjtemplate.hjjewellery.co.uk/category-1/)

The only problem is.. that isn't my category URL, my category URLs end with .html so it is returning a 404 error. Any ideas why this is happening and what can I do to fix this?

Thanks


texts:
I followed steps in below link and created test website.
http://www.host1plus.com/tutorials/cms-tutorials/magento/magento-website-setup/how-to-create-magento-test-production-sites

But product links on test website are still pointing to original website. I have done changes to local.xml and core_config_data. i also removed the contents of cache directory

please let me know what might be the solution for this problem


texts: The requested Payment Method is not available. When using a saved credit card

texts:
I have Magento 2.3.5 and been using braintree's payment method but when users save a credit card to their account and try to use it an error shows up saying "The requested Payment Method is not available"
The error is triggered here: vendor\magento\module-quote\Model\Quote\Payment.php
if (!$method->isAvailable($quote) || !$methodSpecification->isApplicable($method, $quote)) {
        throw new \Magento\Framework\Exception\LocalizedException(
            __('The requested Payment Method is not available.')
        );
}

$method->isAvailable($quote) returns false when users use the saved credit card.
Using $method->getCode() returns "substitution". Don't know if it helps with something?
Thanks!


texts:
I am creating the local multi-website in Magento 2, for these, I have followed below steps.

Step 1) Created the 3 different root level Category as shown below image

Step 2) Created the 3 different stores and assigned categories along with as shown below image

Step 3) Enabled the Store Code to URLs

Step 4) Enabled the Currency for above 3 stores like Indian Ruppe, Euro, and US Dollars.

Issues:

1) Store switcher is not showing in the front end.

2) Even if I enter store switcher manually by adding ?___store=us/?___store=fr the categories are not changing. See below image.

This is my first multistore website, If I miss any steps to configure multistore website please suggest me.


texts:
I have made a migration of my e-commerce magento site 1.9.1
Since I cannot access the admin as I used to.

Before admin url was www.mydomaine.com/admin. Now that gives an error 404 not found.

To reach admin I have to hit the URL: www.mydomaine.com/index.php/admin

Can someone help me to fix it as it was before.

Thanks in advance for your help.

Edit

So indeed I was missing the .htaccess and .htaccess.sample.
Could not explain why they got cleared but they were not present.

So I imported them.

Now I get the following error: This page has a redirect loop.
And I cannot access neither front or back end :(

So my side is offline....

Below I changed domain name by example.

mysql> select * from core_config_data where path='web/unsecure/base_url';
+-----------+---------+----------+-----------------------+-------------------------+
| config_id | scope   | scope_id | path                  | value                   |
+-----------+---------+----------+-----------------------+-------------------------+
|         9 | default |        0 | web/unsecure/base_url | http://www.example.com/ |
+-----------+---------+----------+-----------------------+-------------------------+
1 row in set (0.01 sec)

mysql> select * from core_config_data where path='web/secure/base_url';
+-----------+---------+----------+---------------------+-------------------------+
| config_id | scope   | scope_id | path                | value                   |
+-----------+---------+----------+---------------------+-------------------------+
|        10 | default |        0 | web/secure/base_url | http://www.example.com/ |
+-----------+---------+----------+---------------------+-------------------------+
1 row in set (0.00 sec)

mysql> select * from core_config_data where path='web/url/redirect_to_base';
+-----------+---------+----------+--------------------------+-------+
| config_id | scope   | scope_id | path                     | value |
+-----------+---------+----------+--------------------------+-------+
|        73 | default |        0 | web/url/redirect_to_base | 1     |
+-----------+---------+----------+--------------------------+-------+

mysql> select * from core_config_data where path='web/seo/use_rewrites';
+-----------+---------+----------+----------------------+-------+
| config_id | scope   | scope_id | path                 | value |
+-----------+---------+----------+----------------------+-------+
|        74 | default |        0 | web/seo/use_rewrites | 0     |
+-----------+---------+----------+----------------------+-------+
1 row in set (0.00 sec)

I obviously run: rm -rf var/cache/* and rm -rf var/session/*
I also restarted apache....

Any success.


texts: Owl Carousel for custom them for Magento 2.2.4

texts:
I am creating a custom theme and I need to add banner slider in the home page. I try to use owl carousel and it’s not working. Can you please help

Her is how I try to add slider to home page

1 created a custom home page layout under Magento_Theme/page_layout/1column.xml with below code

 <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>
    <referenceContainer name="page.wrapper">
        <container name="header.container" as="header_container" label="Page Header Container"  htmlTag="div" htmlClass="page-header" before="-" />
        <container name="gm-slideshow" as="gm-slideshow" label="Page Slideshow Container" htmlTag="div" htmlClass="gm-slideshow" before="main.content">
        <block class="Magento\Framework\View\Element\Template" name="homepage_slider" template="Magento_Theme::html/slider.phtml" />
        </container>

        <container name="footer-container" as="footer" before="before.body.end" label="Page Footer" htmlTag="div" htmlClass="page-footer" />
    </referenceContainer>
</layout>

2. created a template file page layout under Magento_Theme/template/html/slider.phtml with below code

 <?php echo $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('homepage_slider')->toHtml();?>

3 created a requirejs-config.js under Magento_Theme with below code

    var config = {
    paths: {
        'owlcarousel' : 'js/owl.carousel.min'
    },
    shim: {
        'owlcarousel': {
            deps: ['jquery']
        }
    }
}

4 added my css under default_head_blocks.xml

  <?xml version="1.0"?>

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

        <meta name="viewport" content="width=device-width, initial-scale=1"/>


texts: Cartid is a required field error in custom payment

texts:
I am using ccavenue payment module in my site. For guest users payment is working fine, it's redirected to the payment page. But for logged in users I am getting this error while placing the order. I checked in headers cartid is passing to the payment. My magento version is Magento ver. 2.1.11

  http://test.com/rest/default/V1/carts/mine/billing-address

cartId is a required field

Anybody have an idea?


texts:
Moved website from Live server to Local wamp server and when I try to access the website on local server it is prompting me to install magento again

I mean when I type http://localhost/mywebsite/  it is going to install page at http://localhost/mywebsite/index.php/install/ instead of showing front end of the website ..

The problem doesn't seems to replicate on live server, I have uploaded same copy of files and database on live server again and it works fine . I am using, must be something with the wamp server settings

What could be the issue...

Thanks


texts: Magento2 admin Terms and conditions grid

texts:
The terms and condition grid not showing saved store view details in grid. in magento2.2.0

Screenshot:

Thanks.


texts: Plugin class Magento\NewRelicReporting\Plugin\StatePlugin doesn't exist

texts:
I just update my Magento 2.2 core components using the command composer update -vvvv and then I got a lot of updates which caused this issue below when I tried to run php bin/magento setup:upgrade.

How could I solve it?


texts: Paypal Payments Pro & IPN Responses : Redundant or Necessary?

texts:
We're using Paypal Payments Pro to process Credit Cards and Paypal Express Transactions. In our development environment, IPN responses must have been disabled or not enabled but now that we're live, they are working and creating and additional history transactions when we capture funds.

The first comment history says:
Captured amount of $XX.XX online. Transaction ID: "8YX040ABC2920X".

The second comment history says:
IPN "Completed". Registered notification about captured amount of $XX.XX. Transaction ID: "8YX040ABC2920X".

I wouldn't think this is a big deal except when the IPN notification comes, it resets the order status back to Processing Credit Card if the order was set to something like Pre-Shipping.

Is IPN nessesary when you're using the Payments Pro API? (should I disable it?)

Can IPN responses be handled differently? (Maybe by elevating instead of reverting the order status?)

What is best practice?


texts:
According to Magento DevDocs http://devdocs.magento.com/guides/v2.0/config-guide/varnish/config-varnish.html,

  Magento 2 supports Varnish versions 3.0.5 or later or any Varnish 4.x
  version.

Is there anyone who has tried Varnish 5 with Magento 2?


texts: How to move store swicther after header links in magento 2

texts:
I want to move store switcher after header links and also move search bar after links. how to do that??
I'm using blank as parent


texts: How to add a configurable external JS with additional data- attributes via requirejs?

texts:
I was trying to add an external JS, say https://foo.bar/script.js (the url is configurable via config data) via requirejs, and I was successful so far. But then I realized that I would need to provide a few data- attributes to the script for it to work properly. (I personally do not write or own the script, so I have no idea why it is designed like this.)

A working example looks like this:

<script src="https://foo.bar/script.js" data-foo="bar" data-john="doe" />

Here are what I have got so far:

Foo\Bar\view\frontend\layout\some_handle_here.xml

<body>
    <referenceContainer name="content">
        <block ifconfig="foo/bar/active" class="Foo\Bar\Block\Script" name="foobar-script" template="Foo_Bar::script.phtml" />
    </referenceContainer>
</body>

Foo\Bar\view\frontend\templates\script.phtml

<script>
   require.config({
       map: {
           '*': {
               'someCustomJs':  '<?php echo $block->getScriptUrl() ?>'
           }
       }
   });
</script>

Foo\Bar\Block\Script.php

class Script extends \Magento\Framework\View\Element\Template
{
    protected $scopeConfig;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        array $data = []
    ) {
        $this->scopeConfig = $scopeConfig;
        parent::__construct($context, $data);
    }

    public function getScriptUrl() {
        return $this->scopeConfig->getValue('foo/bar/script_url', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }
}

Foo\Bar\Block\view\frontend\web\js\script.js

define([
    'jquery',
    ...
    'someCustomJs'
],
function (
    $,
    ...
    customjs
) {
    'use strict';
    //...
    //...
    customjs.foobar()
    //...
    //...
});

The above script was successfully init-ed and the https://foo.bar/script.js was requested, when I accessed the page http://example.com/some/handle/here. But I have no clue how to add those data- attributes. Is it possible to achieve this by they way I tried or by requirejs? Or I would have to consider other methods like injecting the script tag directly to the HTML head?

Thanks for your attention and assistance in advance. Feel free to let me know if more details are needed.


texts: magento 2 custom connection needs to be manually closed?

texts:
I have created a second database on the same server as magento database, then I've created a module that fetches data from the second database. In order to fetch data from the second database I have used the

\Magento\Framework\App\ResourceConnection

class in my constructor and then created the connection with:

$this->_resourceConnection->getConnection('customConnection');

The connection works but once in a while (at random apparently) magento breaks because of "too many connections" errors. So my question is:

does a new connection get created everytime I call the getConnection() method?
do I manually have to close the opened custom collections?


texts: what is the correct way to add block as a child of an another block in xml in magento?

texts:
I have two custom magento blocks called "exe2" and "example".
The exe2 block gets the contents of the example block using the getChildHtml function, but it keeps just returning empty strings to me and only the exe2 contents make it to the screen.

Here is my code my code:

exe2 xml file:

<layout version = "0.1.0">

<test_example_view>

    <block type = "exemplum_mod2/exe2" name = "exemplum.mod2.exe2"  template="exemplum/mod2/exe2.phtml">
        <reference name = "exemplum.mod2.exe2">
            <block type="exemplum/example" name="exemplum.example" template="exemplum/example1/example.phtml" />
        </reference>
    </block>

</test_example_view>

example xml file

<layout version="0.1.0">
<default>

    <block type="exemplum/example" name="exemplum.example" template="exemplum/example1/example.phtml" />

</default>

Here is the exe2 phtml file that has the getChildHtml call in it:

 2nd

<?php

    echo $this->getMessage();
    echo $this->getChildHtml("exemplum.mod2.exe2");

?>

hello

example.phtml file:

Hello there

And finally heres the controller file that loads the blocks:

<?php

class exemplum_example1_ExampleController extends Mage_Core_Controller_Front_Action{

    public function viewAction(){

        $this->loadLayout();

        $block = $this->getLayout()->createBlock('exemplum_mod2/exe2');
        $block->setTemplate("exemplum/mod2/exe2.phtml");

        $this->getLayout()->getBlock('content')->append($block);

        $this->renderLayout();

    }

}

What is the correct way to add one block as the child block of a another block in the xml file? Every solution that i found on google didn't seem to work in my case so what am i doing wrong here?


texts: API SOAP V2 CatalogProductList Visual Basic VB Multi Filters

texts:
I have the next code to obtain product list from Magento API in VB.

    Dim pws As New MagentoService.MagentoService
    Dim sesionID = pws.login("xxxxxx", "xxxxxxxxxxxxxx")
    Dim result

    Dim filters As New MagentoService.filters
    Dim complexFilter(0) As MagentoService.complexFilter
    complexFilter(0) = New MagentoService.complexFilter
    complexFilter(0).key = "manufacturer"
    Dim assEnt As New MagentoService.associativeEntity
    With assEnt
        .key = "manufacturer"
        .value = "34"
    End With
    complexFilter(0).value = assEnt

    filters.complex_filter = complexFilter
    result = pws.catalogProductList(sesionID, filters, "0")

And all works fine, I get the product list from manufacturer 34. But now I want to get the product from manufacturer 34 and set 9. I can't code the apropiate filter.

Any one can help me? Thanks in advance.


texts: Add custom block below cart summary page magento 2

texts:
Dears,

How can I add my custom block to cart summary page? I checked the checkout_cart_index.xml file but couldn't find exact location so could you guys provide me any solution?

Thanks,
Max


texts: Magento2 REST API Error '500 : {"message":"Invalid parameter type }'

texts:
I am trying to create an API in Magento2 mine custom Module. But its giving 500 : {"message":"Invalid parameter type \"\\Netzwelt\\Booking\\Model\\BookingLocationList\" error, its coming when as I m opening swagger.

Here is mine code  -

app\code\Netzwelt\Booking\Api\BookingLocationListInterface.php

namespace Netzwelt\Booking\Api;

interface BookingLocationListInterface
{
    /**
     * @return \Netzwelt\Booking\Model\BookingLocationList
     */
     public function getBookingLocationList();
}

app\code\Netzwelt\Booking\Model\BookingLocationList.php

namespace Netzwelt\Booking\Model;

use Magento\Framework\ObjectManagerInterface;

class BookingLocationList extends \Magento\Framework\Model\AbstractModel
{
    protected $objectmanager;

    public function __construct(
        ObjectManagerInterface $objectmanager
    ) {
        $this->_objectManager = $objectmanager;
    }

    public function getBookingLocationList(){
        $data[] = 1;
        $data[] = 2;
        $data[] = 3;
        $data[] = 4;
        return $data;
    }
}

app\code\Netzwelt\Booking\etc\webapi.xml

<?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
    <route method="GET" url="/V1/netzwelt_booking">
        <service class="Netzwelt\Booking\Api\BookingLocationListInterface" method="getBookingLocationList"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
</routes>

app\code\Netzwelt\Booking\etc\di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Netzwelt\Booking\Api\BookingLocationListInterface" type="Netzwelt\Booking\Model\BookingLocationList" />
</config>

Please check and let me know what I am doing wrong?


texts:
I installed import and export plugin and got this error.
Notice: Undefined index: version in /var/www/magento2/vendor/magento/framework/Setup/Declaration/Schema/Db/DefinitionAggregator.php on line 91

Magento 2.3.5
PHP 7.3


texts: Magento 2 Checkout: Get Custom field value in payment method

texts:
I have created custom form field, payment['token_id'] in payment method . The problem is I can't get the payment['token_id'] value, i have tried $payment->getData('token_id') but nothing happen.

Here what i have tried:

<?php
namespace VendorName\SampleModule\Model;

use Magento\Payment\Model\InfoInterface;

class Payment extends \Magento\Payment\Model\Method\Cc {

     const CODE = 'vendorname_samplemodule';

     protected $_code = self::CODE;
     protected $_infoBlockType = 'VendorName\SampleModule\Block\Info\Cc';

     //optional as per our requirmenet
     protected $_isGateway = true;
     protected $_canAuthorize = true;
     protected $_canCapture = true;
     protected $_canCapturePartial = false;
     protected $_canRefund = true;
     protected $_canVoid = true;
     protected $_canUseInternal = true;
     protected $_canUseCheckout = true;
     protected $_canUseForMultishipping = true;
     protected $_authorize = '';
     protected $_authorizeError = false;
     protected $_debugReplacePrivateDataKeys = ['card', 'merc'];

     public function authorize(InfoInterface $payment, $amount) {

         $order      = $payment->getOrder();
         $billing    = $order->getBillingAddress();
         $shipping   = $order->getShippingAddress();

         foreach($order->getAllItems() as $item){
             $proId[]    = $item->getProductId();
             $proName[]  = $item->getName();
             $proPrice[] = $item->getPrice();
             $proQty[]   = $item->getQtyToInvoice();
             $proSku[]   = $item->getSku();
         }

         // TESTING
         $data  = '';
         $data .= 'Order ID :'. $order->getIncrementId();
         $data .= PHP_EOL;
         $data .= 'Email :'.$order->getCustomerEmail();
         $data .= PHP_EOL;
         $data .= 'Cc :'.$payment->getCcNumber();
         $data .= PHP_EOL;
         $data .= 'Exp Month :'.sprintf('%02d',$payment->getCcExpMonth());
         $data .= PHP_EOL;
         $data .= 'Exp Year :'.$payment->getCcExpYear();
         $data .= PHP_EOL;
         $data .= 'CCV :'.$payment->getCcCid();
         $data .= PHP_EOL;
         $data .= 'Amount: '.$amount;
         $data .= PHP_EOL;
         $data .= 'Customer Postcode :'.$shipping->getPostcode();
         $data .= PHP_EOL;
         $data .= 'Customer Region :'.$shipping->getRegion();
         $data .= PHP_EOL;
         $data .= 'Customer Country ID :'.$shipping->getCountryId();
         $data .= PHP_EOL;
         $data .= 'Is Customer Is Guest ?'.$order->getCustomerIsGuest();
         $data .= PHP_EOL;
         $data .= 'Customer ID : '.$order->getCustomerId();
         $data .= PHP_EOL;

            /** RETURN : EMPTY **/
         $data .= 'Token ID : '.$payment->getData('token_id');

         file_put_contents('/home/zulkhaery/www/tes/test.txt',$data);
         return $this;
     }
}

Any idea how to get the value of payment['token_id'] ?


texts: How to create entities related to themselves, magento 1.9

texts:
I sent this question some days ago:

"I'm using the module Ultimate Module Creator to create new entities and relate them to products, categories and between them.

But I don't know how to relate the entities to themselves. I can't do it with the module. How I could create this type of relation without the module? "


texts:
In My account page i create Cancel. If user click cancel it redirect to next page On that page How i get current order details like Order id amount etc

<?php if (!$_order->hasInvoices()) {?>
|
<a href="<?php echo Mage::getBaseUrl().'cancel-order'; ?>" class="link-reorder"><?php echo $this->__('Cancel') ?>
<?php }?>


texts:
I am using Magento EE-1.10.1.1, I want the files/logs for uploaded products through bulk upload from admin(System -> Import/Export -> Import). How can I get those details.

I checked with var/import/ directory, only 1 year old files are there, I want latest files only. I am not deleted any files under this dir.


texts: No error message when email account exists while checking out as new customer

texts:
Recently we've gotten quite a few complaints from long-time customers who haven't purchased anything in a while.

They'll add items to their cart then check out as a new customer instead of logging in.

The problem is that the one page checkout billing page is not displaying an error message stating that the account exists (ideally with a forgot password link). The page simply doesn't move forward (it also resets the state field).

I'm not seeing any JavaScript or PHP errors and the developer I'd typically turn to for issues with checkout is booked pretty solid.

Any direction would be greatly appreciated.

I'm running a fully patched Magento EE ver. 1.12.0.2


texts: How To Fetch all customer name in multi select in custom admin form

texts:
I Want To fetch all customer name in multi select  in my form using customer collection

Following is my form file

<?php

 namespace Magneto\AppNotification\Block\Adminhtml\Form\Edit\Tab;

 use Magento\Backend\Block\Widget\Form\Generic;
 use Magento\Backend\Block\Widget\Tab\TabInterface;
 use Magento\Backend\Block\Template\Context;
 use Magento\Framework\Registry;
 use Magento\Framework\Data\FormFactory;
 use Magento\Cms\Model\Wysiwyg\Config;

 class Info extends Generic implements TabInterface
  {
  /**
 * @param Context $context
 * @param Registry $registry
 * @param FormFactory $formFactory
 * @param Config $wysiwygConfig
 * @param Status $newsStatus
 * @param array $data
 */

 public function __construct(
    Context $context,
    Registry $registry,
    FormFactory $formFactory,
    array $data = []
) {

    parent::__construct($context, $registry, $formFactory, $data);

}

/**
 * Prepare form fields
 *
 * @return \Magento\Backend\Block\Widget\Form
 */
protected function _prepareForm()
{

    $model = $this->_coreRegistry->registry('appnotification_appnotification');

    /** @var \Magento\Framework\Data\Form $form */
    $form = $this->_formFactory->create();

    $form->setHtmlIdPrefix('notification_');
    $form->setFieldNameSuffix('notification');

    $fieldset = $form->addFieldset(
        'base_fieldset',
        ['legend' => __('AppNotification')]
    );

    if ($model->getId()) {
        $fieldset->addField(
            'id',
            'hidden',
            ['name' => 'id']
        );
    }
    $fieldset->addField(
        'title',
        'text',
        [
            'name'        => 'title',
            'label'    => __('Title'),
            'required'     => true
        ]
    );
    $fieldset->addField(
        'subtitle',
        'text',
        [
            'name'        => 'subtitle',
            'label'    => __('Sub Title'),
            'required'     => true
        ]
    );
    $fieldset->addField(
        'image',
        'image',
        [
            'label' => __('Upload Image'),
            'name' => 'image',
            'required'=>true
        ]
    );
    $data = $model->getData();
    $form->setValues($data);
    $this->setForm($form);

    return parent::_prepareForm();
}

/**
 * Prepare label for tab
 *
 * @return string
 */
public function getTabLabel()
{
    return __('AppNotification Info');
}

/**
 * Prepare title for tab
 *
 * @return string
 */
public function getTabTitle()
{
    return __('AppNotification Info');
}

/**
 * {@inheritdoc}
 */
public function canShowTab()
{
    return true;
}

/**
 * {@inheritdoc}
 */
public function isHidden()
{
    return false;
}

}


texts:
As I understand it, starting from 1.9, Magento is sending order confirmations via cronjobs.

We're having some problems regarding this though. Our cronjobs is working just fine - I've tested them through AOE Scheduler - but the order emails isn't in the cron schedule.

They are, ofcourse, enabled and everything.

What could be the issue here? And is there some way to disable this behavior and send the order confirmations right away if no one has an idea of what is causing the cronjob problems.

Thanks and have a great day!


texts: Magento 2 : Multiple website setup in localhost

texts:
I am trying to create multi websites in Magento 2 in local environment with XAMPP on Windows operating system 10.

I followed this tutorial : http://devdocs.magento.com/guides/v2.0/config-guide/multi-site/ms_apache.html.

Created multi websites in the admin, changed the base url of each website in the configuration (Stores->Configuration->Web) and specified the virtual hosts in the file C:\xampp2\apache\conf\extra\httpd-vhosts.conf like below attached screenshot

Then specified the base URLs in the host file like follows:

127.0.0.1 french.mysite.mg
127.0.0.1 german.mysite.mg

I restarted the Apache server but none of the created websites are loading. Can you please correct me if I am missing anything?


texts: Magento PayPal Standard orders don't update

texts:
I have my shop online for testing now and I can't figure out why magento doesn't update the order status when a paypal payment has been made.
I'm using Paypal Website Payments Standard in Sandbox mode, the ssl option disabled. I see in the sellers Sandbox Paypal account that every IPN message gets a 200 response, the data also seems fine and there's no sign of an error in the logs.

 [business] => ****
        [invoice] => 100000009
        [currency_code] => EUR
        [paymentaction] => sale
        [return] => http://*********.de/paypal/standard/success/
        [cancel_return] => http://*********.de/paypal/standard/cancel/
        [notify_url] => http://*********.de/paypal/ipn/
        [bn] => MagentoCommerce_Cart_DEEdition
        [item_name] => SteinShop
        [lc] => de_DE
        [charset] => utf-8
        [amount] => 7.00
        [tax] => 0.00
        [shipping] => 4.90
        [discount_amount] => 0.00
        [item_number_1] =>
        [item_name_1] => Basic T-Shirt
        [quantity_1] => 1
        [amount_1] => 2.10
        [item_number_2] => Versandkosten - Standardversand
        [item_name_2] => Versand
        [quantity_2] => 1
        [amount_2] => 4.90
        [cmd] => _cart
        [upload] => 1
        [tax_cart] => 0.00
        [discount_amount_cart] => 0.00
        [city] => ****
        [country] => DE
        [email] => ****
        [first_name] => ****
        [last_name] => ****
        [zip] => ****
        [state] =>
        [address1] => ****
        [address2] =>
        [address_override] => 1

The order status just stays in pending payment and there's also no PayPal transaction ID visible in the backend.
Any Ideas what might be the problem?


texts: Magento 2.3 not sending emails to the same domain as the sender

texts:
In my Magento stores, I have set the default email address for sending email as for e.g info@alias.com. Every customer is receiving emails from info@alias.com
But if the customer has the email address with the same domain as ours for e.g team@alias.com it does not receive any email.
In short any email with the domain alias.com does not receive an email from info@alias.com
what can be the issue? Is it because of the same domain name or something else, how can I resolve this


texts: In magento admin url, the word “admin” occurs twice. how to remove the second one?

texts:
I have a situation where my client's admin url is something like this;

http://www.example.com/index.php/admin/admin/dashboard/index/key/0981a6bd2f5a06fec85d3c9e297849a0/

the word admin occurs twice, how to remove one. i checked app/etc/local.xml and in magento admin->system->configuration->admin, there was no changes in the default setting.

Note: I asked the same question on stackoverflow.com but didn't get any answer in 3 days, that's why i reposted it here.


texts: Can't use di (Dependency Injection) in product list class rewrite for json Helper

texts:
I have tried to used json helper class in my rewrited list file.

But it gives error like this

Fatal error: Uncaught TypeError: Argument 1 passed to Kite\Boxes\Block\Rewrite\Product\ListProduct::__construct() must be an instance of Magento\Framework\Json\Helper\Data, instance of Magento\Catalog\Block\Product\Context given, called in /var/www/vhosts/goweb-dev01.site/httpdocs/var/generation/Kite/Boxes/Block/Rewrite/Product/ListProduct/Interceptor.php on line 14 and defined in /var/www/vhosts/goweb-dev01.site/httpdocs/app/code/Kite/Boxes/Block/Rewrite/Product/ListProduct.php:7 Stack trace: #0 /var/www/vhosts/goweb-dev01.site/httpdocs/var/generation/Kite/Boxes/Block/Rewrite/Product/ListProduct/Interceptor.php(14): Kite\Boxes\Block\Rewrite\Product\ListProduct->__construct(Object(Magento\Catalog\Block\Product\Context), Object(Magento\Framework\Data\Helper\PostHelper), Object(Magento\Catalog\Model\Layer\Resolver), Object(Magento\Catalog\Model\CategoryRepository), Object(Magento\Framework\Url\Helper\Data), Array) #1 /var/www/vhosts/goweb-dev01.site/httpdocs/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php in /var/www/vhosts/goweb-dev01.site/httpdocs/app/code/Kite/Boxes/Block/Rewrite/Product/ListProduct.php on line 7

My code in file

    <?php
namespace Kite\Boxes\Block\Rewrite\Product;
class ListProduct extends \Magento\Catalog\Block\Product\ListProduct
{
    protected $jsonHelper;

    public function __construct(\Magento\Framework\Json\Helper\Data $jsonHelper)
    {
        $this->jsonHelper = $jsonHelper;
    }

    public function getProductCollectinJsonData()
    {
        $_productCollection = $this->getLoadedProductCollection()->addTierPriceData();
        $i                  = 0;
        $ProductData        = array();
        foreach ($_productCollection as $product) {
            if ($product->getTypeId() == 'simple') {
                $ProductData[$i]['Product Name'] = $product->getName();
                if ($product->getTierPrice()) {
                    $tierPriceList = $product->getTierPrice();
                    if (count($tierPriceList) > 0) {
                        $ProductData[$i]['1-' . (intval($tierPriceList[0]['price_qty'])) . ' Packs'] = $tierPriceList[0]['price'];
                    }
                    $count = 0;
                    foreach ($tierPriceList as $key => $trList) {
                        if ($count == (count($tierPriceList) - 1)) {
                            $ProductData[$i][intval($trList['price_qty']) . '+ Packs'] = number_format($trList['price'], 2);
                        } else {
                            $ProductData[$i][intval($trList['price_qty'] + 1) . '-' . (intval($tierPriceList[$key + 1]['price_qty'])) . ' Packs'] = number_format($trList['price'], 2);
                        }

                        $count++;
                    }
                }
                $i++;
            }
        }
        return $this->jsonHelper->jsonDecode($jsonData);
    }
}


texts: Delete Product Custom Option value if it is null in magento 2

texts:
I wish to delete the custom options value of a product if it is null  without deleting the option.

Please provide me a solution to delete it without affecting the option


texts: Magento 2.3 - How to Get product-salable-quantity using REST API?

texts:
I followed the Magento documentation regarding fetching Product Salable quantity using REST API.

  https://devdocs.magento.com/guides/v2.3/rest/modules/inventory/check-salable-quantity.html

But I'm getting only 0 value for all products when I use get-product-salable-quantity API.

Can anyone help with this ASAP?


texts:
What does the number 100 on the Y axis of the Dashboard Chart mean?
Does anyone know? (the 100)


texts: How do I apply coupon codes for newly registered customers only in Magento 1.9?


texts: Get back from select object to collection object

texts:
If I do $collection->getSelect() I am moving from collection object to select object and I can use some useful stuff more close to raw sql.

But what can I do to get back from select to magento collection?
If, for example, I want to use $collection->getFirstItem()->getId()?


texts: How to confirm before action in admingrid magento2?

texts:
Here is my code:

<?php
namespace Tatva\Unsubscribepaypal\Ui\Component\Listing\Column\TatvaUnsubscribeListing;

class PageActions extends \Magento\Ui\Component\Listing\Columns\Column
{
    public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource["data"]["items"])) {
            foreach ($dataSource["data"]["items"] as & $item) {
                $name = $this->getData("name");
                $id = "X";
                if(isset($item["customer_id"]))
                {
                    $id = $item["customer_id"];
                }
                //echo $id; exit;
                $item[$name]["view"] = [
                "href"=>$this->getContext()->getUrl(
                    "unsubscribetco/index/unsubscribe",["customer_id"=>$id]),
                "label"=>__("Unsubscribe"),
                'confirm' => [
                'title' => __('Unsubscribe ${ $.$data.title }'),
                'message' => __('Are you sure?')
                ]
                ];
            }
        }

        return $dataSource;
    }

}

here is my action code:

<actionsColumn name="actions" class="Tatva\Unsubscribetco\Ui\Component\Listing\Column\TatvaUnsubscribeListing\PageActions">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="resizeEnabled" xsi:type="boolean">false</item>
                <item name="resizeDefaultWidth" xsi:type="string">107</item>
                <item name="indexField" xsi:type="string">post_id</item>
                <item name="sortOrder" xsi:type="number">200</item>
            </item>
        </argument>
    </actionsColumn>


texts: completely remove admin module from Magento

texts:
Ok, so several times now I've had magento be a utter b**** when it comes to updating my custom modules and it would save me an awful amount of time if i could just remove them completely. Important to note these always include a database table.

Currently to uninstall I delete the relevent files in app/etc/modules, app/design/adminhtml/default/default/layout and the folder in app/code/local/namespace/.

I also delete the table (modules contain install script anyway) and the reference in core_resource. I also delete the var folder, clear the cash and index to be damn sure it should all be gone.

Now if i were to then try to re-add an up dated module (with the same version number) with new fields in the model, it will somehow know what the original fields were and not add the new fields. This screams to me that I've not removed all the data in the database regarding this module.

What am i missing?


texts: custom link in top header shows wrong url

texts:
I have added custom link in my local.xml in "top.links"

<reference name="top.links">
<action method="addLink" translate="label title">
      <label>Shipping Estimator</label>
                <url>shipping-estimator</url>
                <title>Shipping Estimator</title>
                <prepare/>
                <urlParams/>
                <position>5</position>
            </action>
</reference>

Link is added in top header but on some page e.g checkout page it is shown like

/checkout/onepage/shipping-estimator

Am i missing some parameter above ? or doing something wrong?


texts:
Is there any way to determine Simple products that are not associated with a configurable?  I want to make all simple products configurable due to the way Magento handles minimum order quantities (it automatically enters the minimum quantity for simple products, and does not for configurable s and changes the price of the item to minimum order quantity * item price, and that's confusing and an invitation to errors).

Thanks in advance for your help.  I'm looking for a non-programmatic solution.  I use the admin interface and Store Manager for Magento.


texts: Insert textbox value in magento database

texts:
I am new to Magento. I am trying to insert Textbox value into database on button click. I am using this code for calling controller function.

<script type="text/javascript">
jQuery( function()
{
 jQuery("#savedb").click( function()
 {
 jQuery.ajax(
 {
  url: "<?php echo Mage::getUrl('modulename/index/methodname'); ?>",
  type: 'POST',
  async: false,
  dataType: 'text',
  processData: false,
  data: {
  a: $('#title').val(),
  b: $('#content').val(),
  c: $('#status').val()
},
});
});
});
</script>

But this is not working.


texts: Magento2 add new cloumn and mass action in newsletter admin grid

texts:
How we can add "new column" and "new action" in newsletter in magento2 admin  grid as Newsleter doesn't have ui_component .

So anybody can please help me as i can see newsletter grid  is coming from newsletter_subscriber_block.xml


texts:
I would like to create an attribute read only however it look it is not possible.

I have tried to pass to addAttribute() 'disabled' =>true or 'readonly' => true
with out any success.
I have found out some suggestion about using setLockedAttributes() but for some reason it is not working

Reference:
Varien_Data_Form_Element_Abstract::serialize($attributes = array(), $valueSeparator='=', $fieldSeparator=' ', $quote='"')


texts: Backend not working after changing the docroot to /pub

texts: I have recently changed the docroot of Magento to /pub. I followed the official guide and then when I see the images are all broken and the admin URL is not working. It shows a page not found in the frontend.


texts: addColumn() in setup script TYPE_MEDIUMTEXT how? or text size?

texts:
in Mage setup sql scripts how do you add a column with text size medium? I'm not sure the 64kb limit of TYPE_TEXT will be long enough.

->addColumn('comments',Varien_Db_Ddl_Table::TYPE_TEXT,null,array(),'Comments')


texts:
I'm new in magento2 and I need your help.

In my InstallData.php, I created lot of product attributes with the following script :

$eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'my_attribute',
        [
            'type' => 'varchar',
            'backend' => '',
            'frontend' => '',
            'label' => 'My Attribute',
            'input' => 'select',
            'option' => [
                'values' => [],
            ],
            'class' => '',
            'source' => 'Project\Catalog\Model\Config\Source\Options',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'visible' => true,
            'required' => false,
            'user_defined' => false,
            'default' => '0',
            'searchable' => true,
            'filterable' => true,
            'comparable' => false,
            'visible_on_front' => true,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to' => '',
            'group' => 'Custom Attributes'
        ]
    );

In parallel, I create attributes set with this script :

$setup->startSetup();
    $categorySetup = $this->categorySetupFactory->create(['setup' => $setup]);

    $attributeSet = $this->attributeSetFactory->create();
    $entityTypeId = $categorySetup->getEntityTypeId(\Magento\Catalog\Model\Product::ENTITY);
    $attributeSetId = $categorySetup->getDefaultAttributeSetId($entityTypeId);

    $attributeSetNameArray = array();

    foreach ($attributeSetNameArray as $attributeSetName) {
        $data = [
            'attribute_set_name' => $attributeSetName,
            'entity_type_id' => $entityTypeId
        ];
        $attributeSet->setData($data);
        $attributeSet->validate();
        $attributeSet->save();
        $attributeSet->initFromSkeleton($attributeSetId);
        $attributeSet->save();
    }

    $setup->endSetup();

And now, I want to link attributes to attributes set. But an attribute can be link to several attributes set.

For exemple :

List of my attributes :

Attr1
Attr2
Attr3
Attr4
Attr5

List of my attributes set :

Default (the default attribute set)
Attr_set1
Attr_set2

And I want :

In Default, all my attributes
In Attr_set1, the attributes Attr1, Attr2, Attr3
In Attr_set2, the attributes Attr1, Attr4

I want to make the links programmatically (not via the Back office). Someone have an idea ?


texts: Is website filter required if on collection is applied store filter

texts:
Is there any point of applying website filter after applied store filter already:

  $collection->addStoreFilter()->addWebsiteFilter();

will have same effect as:

  $collection->addStoreFilter();

and this should:

  $collection->addWebsiteFilter();

filter products only from website and with no matter from which store from filtered website?


texts:
I got an Error on Magento 2 Product Import - which says:

Value for 'visibility' attribute contains incorrect value, see acceptable values on settings specified for Admin in row(s): 1
Invalid value in Store column (store doesn't exist?) in row(s): 1

But in the Store column I has the value 0 and in the visibility, the value 4 for Catalog, search so I don't know why that's wrong ?!

Does any have an idea?


texts: main product image is not coming on product listing. Placeholder is coming

texts:
I have uploaded the csv for product upload in magento panel. I have multistores on magento. Csv doesn't have image path, i added the image manually. Images are coming properly on all site but on product listing page (Catalog Page), placeholder image is coming.

Please tell me what should i do


texts: How can i hide Discount Code form checkout payment page in Magento 2?

texts:
I tried to hide the Discount Code field from checkout payment page, but i can't find anything in xml files.

For cart page, i found this field in checkout_cart_index.xml, and i was able to hide like this:

 <block class="Magento\Checkout\Block\Cart\Coupon" name="checkout.cart.coupon" as="coupon" template="cart/coupon.phtml"/>
                            <referenceBlock name="checkout.cart.coupon" remove="true"/>

Does anyone know how this field it's add on the payment page? or from where i can deleted?


texts:
Any Help

    To enable extensions, verify that they are enabled in your .ini files:
    - /opt/cpanel/ea-php72/root/etc/php.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-bcmath.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-calendar.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-ctype.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-curl.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-dom.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-ftp.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-gd.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-iconv.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-imap.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-intl.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-json.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-mbstring.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-mysqlnd.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-pdo.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-phar.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-posix.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-simplexml.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-sockets.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-sqlite3.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-tokenizer.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-xml.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-xmlwriter.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-xsl.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/20-zip.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/30-mysqli.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/30-pdo_mysql.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/30-pdo_sqlite.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/30-wddx.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/30-xmlreader.ini
    - /opt/cpanel/ea-php72/root/etc/php.d/zzzzzzz-pecl.ini
  **You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.**


texts: How to reduce product description and short description input field height in the backend?

texts:
Im using magento 2.3.4 and when i want to add/edit new product by default the product description and short description height is set too much like this:

how can i reduce this?


texts: Using observer, how to get the current pager with loaded product collection

texts:
Using an observer how can i get the current pager block with its loaded product collection on a category page?

I want to check the total number of pages on a category page before it is loaded.


texts:
I looked for reviews REST API and I found this link:

http://www.ipragmatech.com/products/reviews-rest-api-magento/

I tried to add review via it using :

POST http://domain.com/index.php/rest/V1/review/post?productId=46&nickname=myName&title=Test&detail=Msg&ratingValue=3

and got the response [true,"You submitted your review for moderation."]

But when I try to retrieve the reviews Using:

GET   http://domain.com/rest/V1/review/reviews/46

I got response [{"avg_rating_percent":"0","count":0,"reviews":[]}]


texts: OneStepCheckout - display subtotals of tax class

texts:
I am using Magento 2.1.1 and Module One Step Checkout from Magestore. If anyone is using that it would great, but I bet in default Magento it can ba achieved in similar way.I was digging around for a few days but so far I haven't succeeded.

I want to display subtotals for every tax classes for products in cart. For example if I have one product for 100$ and its tax class is 8-taxabale goods and another for 100$ with 23-taxable goods I want to render info nearby total for whole order, that

var 8%: 8$
 vat 23%: 23$

The thing is that I don't know how to do it in knockout templates. I have noticed that every .htmlhas its own .js file with same name so I guess every js provides functionality for connected html. Should I add some methods in this js, overriding it in my custom theme.

For example:

totals.html

and totals.js
`define(
    [
        'jquery',
        'Magento_Checkout/js/view/summary/abstract-total'
    ],
    function ($, Component) {
        'use strict';

    return Component.extend({
        /**
         * @return {*}
         */
        isDisplayed: function () {
            return this.isFullMode();
        }
    });
}

);
`

Where I should start debugging? How can I look up what data exactly I have in html template? These ko comments in html templates seems hard to debug. I was trying to add ANY content (like
Test
) in totals.html but nothing is displayed, but when I added something in main html template of OSC - onestepcheckout.html everything is displayed. Of course I have tried to clear magento and browser cache, as well as clear pub/static/*.


texts: Does PWA works well on the Magento Commerce Cloud with the UPWARD connector?

texts:
There is a Magento 2 UPWARD connector module to keep Magento and storefront code on the same server. Has anyone used PWA Studio storefront in the Magento Commerce Cloud? Is this connector reliable?
https://github.com/magento-research/magento2-upward-connector


texts: How to show attribute value within the Temando Shipping module?

texts:
I'm having an issue with customizing the Temando Shipping module. I simply want to populate the below fields with the corresponding attribute value:

Description
Composition
HS Code
Country of Manufacture
Country of Origin

All of the attributes have been created and the product(s) show their relevant values on the admin product page.

I have tried to incorporate it directly into the module but everything I have tried fails, I was hoping some support is available from here.

I have attached a screengrab of the Admin area in question.

Any help on this would be brilliant.

Thanks,

Tim


texts: What's the preferred way of storing static calculation results in Magento?

texts:
What's the best way of storing calculation results in Magento ?

Example: I need to calculate total number of active products in each category and show the results in the menu, for that purpose, I used some scripts that extract enabled,in stock, visible and available products within database. So for all categories (say 100 categories in total with thousands of different products) it takes time (something about 2-3 seconds) for each page load.

Say we have ten thousand of viewers every day in the site and speed matters. There are some scenarios I find out:

1. Using cache:

foreach( category )
{
   if( number of products in this category is not available in cache )
   {
       calcualte it and store the result in cache;
       show the calculated number;
   }
   else
   {
       show the calculated number from cache;
   }
}

In this solution, for each category it takes about 0.01s for the calculation and just after that we are saving the results in the cache. Other users won't recalculate it every time and for simultaneous users  I myself think we won't be in trouble. What's your opinion ?

2. Using cron jobs:

Sometime we can do the calculation in a cron job and for each category save the results in a table and then retrieve the calculation from there in the front-end. Cron job will be executed every 10 minutes for example.

I think this solution is ok for heavy calculations , but for calculations like products count its not the case. What do you think ? Is it necessary to do this kind of tasks in a cron job even if it takes 0.01s seconds ? Will it makes trouble for simultaneous users if it calculated on the fly ?

3. Using event observers

We can write an event to re-calculate number of products every time we save, update, create or delete a product/category and then store the results in the table. What do you think about this idea ?

I myself currently don't have any idea how should I implement this for this example but I think it could be a little challenging. Any suggestions about how to do it is welcome.

Let me know if there is any other solutions available out there.


texts: Magento 1.7 Community Invalid cron expression

texts:
I have inherited a magento site owned by a customer and we are getting errors logged in var/reports every 5 minutes, I have checked our cron job setup with host and it appears to be in the correct SimpleTrigger format.  I've been researching the issue but I don't really understand how it works so I'm hoping someone can help point me in the right direction.
Thanks, J

a:4:{i:0;s:45:"Invalid cron expression: 0 5 10 15 20 * * * *";i:1;s:1238:"
#0 /chroot/home/domain/domain.com/html/app/code/core/Mage/Cron/Model/Schedule.php(68): Mage::exception('Mage_Cron', 'Invalid cron ex...')
#1 /chroot/home/domain/domain.com/html/app/code/core/Mage/Cron/Model/Observer.php(214): Mage_Cron_Model_Schedule->setCronExpr('0 5 10 15 20 * ...')
#2 /chroot/home/domain/domain.com/html/app/code/core/Mage/Cron/Model/Observer.php(168): Mage_Cron_Model_Observer->_generateJobs(Object(Mage_Core_Model_Config_Element), Array)
#3 /chroot/home/domain/domain.com/html/app/code/core/Mage/Cron/Model/Observer.php(128): Mage_Cron_Model_Observer->generate()
#4 /chroot/home/domain/domain.com/html/app/code/core/Mage/Core/Model/App.php(1338): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#5 /chroot/home/domain/domain.com/html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#6 /chroot/home/domain/domain.com/html/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('default', Array)
#7 /chroot/home/domain/domain.com/html/cron.php(46): Mage::dispatchEvent('default')
#8 {main}";s:11:"script_name";s:57:"/chroot/home/domain/domain.com/html/index.php";s:4:"skin";s:5:"admin";}


texts: Magento2 contact form in footer redirects to different page after submitting the form

texts:
Could anyone help? i want to use contact form in footer without redirects to different page after submitting the form.

Everything working fine but form redirects to different page after submitting the form. I want successful and error messages under the form.

i m using below code

{{block class="Magento\Contact\Block\ContactForm" name="contactForm" template="Magento_Contact::form.phtml"}}


texts: Programatically update a single attribute in Store View Scope

texts:
If you load a product in Store View scope, all the inherited data ("Use Default Values") comes with it... which makes perfect sense, so far so good.

$_product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($productId);

My problem is, if you then change one attribute and save, everything is saved at Store View scope.

$_product->setName($storeSpecificName)->save();

Now, if I look at the product in the admin, every "Use Default Values" checkbox is unticked :(

It doesn't help if I do  $_product->save() or $_product->getResource()->save($_product). I even tried:

$_resource = $_product->getResource();
$_resource->isPartialSave(true);
$_resource->save($_product);

Maybe I'm misunderstanding what isPartialSave() does.

So, how do I change one (or more, but not all) attributes at Store View scope?


texts: How to change the default product sorting when product is searched?

texts:
Basically when I search for product in search bar, the sort by section look like:

but I wanted to select product name by default instead of relevance.like this:


texts: Magento 1.9 server to localhost many errors in windows 10

texts:
I have an magento 1.9.3.7 installation on my server. I have to change something on codes. SSL is activated on server. I using ampps on my localhost. Error is

    Warning: file_get_contents(\app\etc\modules\Mstoreapp_App.xml): failed to open stream: Permission denied  in \lib\Varien\Simplexml\Config.php on line 496

#0 [internal function]: mageCoreErrorHandler(2, 'file_get_conten...', 'C:\\Program File...', 496, Array)
#1 \lib\Varien\Simplexml\Config.php(496): file_get_contents('C:\\Program File...')
#2 \app\code\core\Mage\Core\Model\Config.php(791): Varien_Simplexml_Config->loadFile('C:\\Program File...')
#3 \app\code\core\Mage\Core\Model\Config.php(318): Mage_Core_Model_Config->_loadDeclaredModules()
#4 \app\code\core\Mage\Core\Model\App.php(425): Mage_Core_Model_Config->loadModules()
#5 \app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Model_App->_initModules()
#6 \app\Mage.php(684): Mage_Core_Model_App->run(Array)
#7 \index.php(83): Mage::run('', 'store')
#8 {main}

Any idea?


texts: Magento 2 : Add, read and delete custom key value pairs in Redis

texts: I want to implement a custom cache for a feature and want to store key-value pairs in Redis for the same. Is there some standard class/implementation which I should follow to go about accomplishing this?


texts: When the sales_flat_order_item.qty_cancelled gets value? Is it updated as a result of RMA process? I am sure it is not updated when a credit memo is raised.


texts: Why Can't I Load a Product by SKU using loadBySku()?

texts:
Synopsis
I wanted to load a product by SKU there are many articles, blog posts, stack overflow results etc.  All I want to know is - why does it have to be so difficult to load a product by a SKU?
// This method does not work (Of all, I expect this to work)
$product = Mage::getModel('catalog/product')->loadBySku($sku);

// These do not work either
$product = Mage::getModel('catalog/product')->loadByAttribute($sku, 'sku');
$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);

// This does not work
$product = Mage::getModel('catalog/product')->load($sku, 'sku');

Of course, I am expecting far too much from Magento at this point a simple way of doing something (simple is a concept Magento clearly is not familiar with)
// This works:
$product = Mage::getModel('catalog/product');
$product->load($product->getIdBySku($sku));


texts: RWD Minicart - Error occurred. Try to refresh page

texts:
I've just started out with the RWD theme of Magento for our store and whenever try to use the minicart function to update the cart with Ajax I get the following error

  Error occurred. Try to refresh page.

Refreshing the page does indeed update the cart, but it's not the best customer experience.

I've not made any code changes to the minicart and was wondering if anyone had encountered the same issue.


texts: Setting different `footer version` from admin panel/table Magento 2

texts:
By default, I have footer version as footer_1.
On looking upon the code footer.phtml , there are multiple footer version
footer_2, footer_3, footer_4
How can I enable each footer from my Admin panel and from which table also.

<?php // Get footer version ?>
<?php $themeHelper = $this->helper('MGS\Mpanel\Helper\Data') ?>
<?php $footer = $themeHelper->getStoreConfig('mgstheme/footer/footer');?>

and condition for footer version check goes on

 <?php if($footer == 'footer_1'): ?> // footer version check

I don't understand, from where did the $themeHelper is getting the footer versions, and how can I change with other footer versions like footer_2, footer_3 etc.
If it has both approaches from admin panel and from database table too(so that I can use MySQL query to update) kindly enlighten me.
I am new to Magento


texts: Create Update product REST API magento2.1

texts:
I got below error on my rest API on magento2.1

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

My URL is: https://XXX/rest/all/V1/products

I want to add or edit the product in both POST and PUT method got the same error. my code to create/update is

 "product": {
        "sku": "B201-SKU",
        "name": "B202",
        "price": 30.00,
        "status": 1,
        "type_id": "simple",
        "attribute_set_id":4,
        "weight": 1
    }

Also, use postman and set authentication  on it, GET method is ok but PUT and POST gets error


texts: Magento Cart - Remove Excl. Tax Subtotal Only

texts:
Hi my current cart columns are as below because I want to show including and excluding tax on the cart. However, I don't want to show Inc. and Excl. for the Subtotal section so want to remove the one I bolded.

|  Price Inc. TAX   |   Price Excl. TAX  |   Subtotal Inc. TAX  |  Subtotal Excl. Tax  |

In the settings there is only the option to show both at the cart page and so I am stuck as to how to remove just this column!

Any help is REALLY appreciated!


texts: Magento Join Custom Collection with Product Collection

texts:
In Magento 1.9, I Have a custom admin grid.

I have product id in my custom collection. I need to add product name to that collection.
How to achieve it?

I am using the following code.

$productTable = Mage::getSingleton('core/resource')->getTableName('catalog/product');
$orders->getSelect()->join( array('product_data'=> $productTable),
'product_data.entity_id = main_table.product_id',
array('product_data.name'));


texts:
unfortunately in this situation I do not have $this->getChildHtml to assign false to it and then change my xml file for disabling cache I have this block in view.phtml:

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

and the function is in view.php as follow:

public function getCmsBlockHtml()
{
    if (!$this->getData('cms_block_html')) {
        $html = $this->getLayout()->createBlock('cms/block')
            ->setBlockId($this->getCurrentCategory()->getLandingPage())
            ->toHtml();
        $this->setData('cms_block_html', $html);
    }
    return $this->getData('cms_block_html');
}

any ideas on how to disable the cache here? my page is in category folder when displaying the products

Update:with help of Denis I understood that (for some pages) when I have something in constructor if the cache is enabled the constructor will not be called! and so I think that's the reason why setting the cache life time doesn't work there


texts: What does Mage_Catalog_Model_Product_Status::STATUS_DISABLED Do?

texts:
I wrote a script that searches for products with no active categories and disables the products.  This was in regards to our customer turning off some old categories, but the products still being searchable.  We figured it was best to set their status to disabled in bulk.

So in order to do this we call this line:

  Mage::getModel('catalog/product_status')->updateProductStatus($prod->getId(), $store_id, Mage_Catalog_Model_Product_Status::STATUS_DISABLED);

So a week later, we need to re-enable a product.  I log into the admin panel, and the status  is still showing as "enabled".  It took me running my script again hard coding the id to get it to show up in the store again:

  Mage::getModel('catalog/product_status')->updateProductStatus(370, $store_id, Mage_Catalog_Model_Product_Status::STATUS_ENABLED);

Obvioulsy my intention was that the status in the admin panel would be disabled, and then any user with admin access would be able to turn these products back on.  So I'm asking the community, what do the above lines actually do?  And how can I do what I intended.


texts: Magento 2 : How to use message manager without block in phtml file

texts:
I want to use message manager in template file without using block/controller.

I want to send error message on /customer/account/index/ when redirect here. I redirect it from registration template file.

How to do it..?

I used this type of code but it's not working...

$this->_messageManager->addError(__("Error"));
$redirect->setRedirect($this->getBaseUrl().'customer/account');


texts: How to add the product filter in the sidebar?

texts: I just want to add the default filter in my sidebar. When looking at the official Magento demo, you can see this on the left sidebar (Shopping Options.) I assume this is available out of the box to enable since the Magento demo shouldn't be using community modules (I think.)


texts: Customize "apply coupon" action when a particular coupon is applied and then re-update shipping in cart & checkout

texts:
I am running magento ver. 1.9.0.1 in my site.

I want to customize shipping rate when a particular coupon is applied.

How can I do that when "Apply Coupon" button is clicked, if a given coupon is the one, that is applied ?

I never had much encounter with code in price rule section so I am not aware of which controller is executed when "Apply Coupon"(Cart price rule) is clicked.


texts: Display the value of product position in category in Magento 2.x

texts:
Looking to display the value of the product position (i.e. sort-by field) via PHTML file.

How would one display the value of that field on the frontend?


texts: What have increased technically on Magento 2 Enterprise?

texts:
I saw something new on CLI and the Reward Module.

What are the things that improved in Magento Enterprise Edition?

Is there something technically different about 2.0 EE and 2.1 EE?

Thanks


texts: Magento2 - After changing Attribute set, dropdown attribute values changes to default store

texts:
I am using Magento 2.3.1. When I try to change attribute set in Magento admin product edit page, product's drop down attribute values changes from its store = 0 values to default store value.
Ideally it should not happen. It should not change the value by changing attribute set.
Anyone faced this issue?
Please let me know.


texts: Getting some error after going to checkout page

texts:
Getting a error while entering the checkout page, attached below is the screenshot.

Below is the code inside the file.

<?php
$mobileHelper = $this->helper('Meetanshi\Mobilelogin\Helper\Data');
if ($helper->isMobileloginEnabled()) {

if (!$mobileHelper->customerLoggedIn()) { ?>
    <div class="check-loginlink">
        <button class="action action-auth-toggle"
                id="checkoutlogin"><?php echo __('Already Have an Account? Click here to login') ?>
        </button>
    </div>
<?php } ?>
<script type="text/javascript">
    require(['jquery', 'jquery/ui'], function ($) {
        $(document).ready(function ($) {
            $('.authentication-wrapper').hide();
            $('#checkoutlogin').on('click', function () {
                $('.mobile-sendotp-popup').modal('openModal');
            });
        });
    });
</script>
<style>
    .authentication-wrapper {
        display: none;
    }

    .check-loginlink {
        width: 100%;
        text-align: right;
    }
</style>

I had tried re-installing the plugin, but its still the same. Please if anyone can help me out that would be great.


texts: Magento 2: Multiple websites and stores on apache or nginx server

texts:
I know this question may have been previously asked but I followed many reference links, but I cannot do this thing so please help me achieve it.
base URL = http://127.0.0.1/magento22/

1) Create a site in Magento with 4 languages

Deutschland (German)
Francais (French)
Nederland (Dutch)
Switzerland (Swiss)

2) Change code in index.php

<?php
/**
 * Application entry point
 *
 * Example - run a particular store or website:
 * --------------------------------------------
 * require __DIR__ . '/app/bootstrap.php';
 * $params = $_SERVER;
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website2';
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
 * $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
 * \/** @var \Magento\Framework\App\Http $app *\/
 * $app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
 * $bootstrap->run($app);
 * --------------------------------------------
 *
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

try {
    require __DIR__ . '/app/bootstrap.php';
} catch (\Exception $e) {
    echo <<getMessage()}

HTML;
    exit(1);
}
$params = $_SERVER;
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
switch ($actual_link)
{
    case 'http://127.0.0.1/magento22/deutschland/':
        $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'deutschland';
        $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
        break;
    case 'http://127.0.0.1/magento22/france/':
        $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'france';
        $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
         echo "11";
        break;
    case 'http://127.0.0.1/magento22/nederland/':
        $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'nederland';
        $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
        break;
    case 'http://127.0.0.1/magento22/switzerland/':
        $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'switzerland';
        $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
        break;
    case 'http://127.0.0.1/magento22/':
        $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'base';
        $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
        break;
    default:
        $params = $_SERVER;
        break;

}

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);


texts:
I'm adding Custom field/Column to Customer table. but it's not showing in table as well as customer grid from admin panel.

my code is:

C:\xampp\htdocs\magento\app\code\core\Mage\Customer\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Mage_Customer>
            <version>1.6.2.0.2</version>
        </Mage_Customer>
    </modules>
    <admin>
        <fieldsets>
            <customer_dataflow>
                <mobile>
                    <billing>1</billing>
                    <shipping>1</shipping>
                    <mapped>1</mapped>
                </mobile>
            </customer_dataflow>
        </fieldsets>
    </admin>
    <global>
        <fieldsets>
            <customer_account>
                <Mobile>
                    <create>1</create>
                    <update>1</update>
                </Mobile>
            </customer_account>
        </fieldsets>
   .....
</config>

C:\xampp\htdocs\magento\app\code\core\Mage\Customer\Model\Resource\Setup.php

<?php

class Mage_Customer_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup
{
    ...

 public function getDefaultEntities()
    {
        $entities = array(
            'customer'                       => array(
                'entity_model'                   => 'customer/customer',
                'attribute_model'                => 'customer/attribute',
                'table'                          => 'customer/entity',
                'increment_model'                => 'eav/entity_increment_numeric',
                'additional_attribute_table'     => 'customer/eav_attribute',
                'entity_attribute_collection'    => 'customer/attribute_collection',
                'attributes'                     => array(

                    'mobile'             => array(
                        'type'               => 'int',
                        'label'              => 'mobile',
                        'input'              => 'text',
                        'required'           => false,
                        'sort_order'         => 111,
                        'position'           => 111,
                        'visible'            => true,
                    ),

                )
            ),

        );
        return $entities;
    }
    ...
}

C:\xampp\htdocs\magento\app\code\core\Mage\Customer\sql\customer_setup\upgrade-1.6.2.0-1.6.2.0.2.php

<?php

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

$this->addAttribute('customer', 'mobile', array(

    'type' => 'varchar',

    'input' => 'text',

    'label' => 'mobile',

    'global' => 1,

    'visible' => 1,

    'required' => 0,

    'user_defined' => 1,

    'visible_on_front' => 1

));

Mage::log('Working');

$installer->endSetup();

$customerattribute = Mage::getModel('customer/attribute')->loadByCode('customer','mobile');
$forms = array('customer_register_address',
    'customer_address_edit',
    'adminhtml_customer_address');
$customerattribute->setData('used_in_forms',$forms);

$customerattribute->save();

Could you please tell me where I went wrong?

thanks in advance.


texts: Upgrading a clean 1.9.1.1 installation to 1.9.2, how?

texts:
Can somebody suggest the easiest way to upgrade from 1.9.1.1 installation to 1.9.2 ? Can it be done in-place without an intermediary server ?

ConnectManager may be one way, but is failing for me, so I am wondering what is another way to apply the upgrade in the  1.9.2 zip file ?

I have the question posted here, but there doesn't seem to be valid replies so far ... http://community.magento.com/t5/Version-Upgrades/Was-unable-to-upgrade-from-1-9-1-1-to-1-9-2-0-using/m-p/10186#M572


texts:
In Magento 2, what is the cleanest way to have the same CRON job run for every store, and pull relevant configuration settings from the appropriate store?

Would it be to add a loop inside Vendor/Module/Cron/Job.php, execute method, checking every store, and setting $this->storeManager->setCurrentStore at the top of the method?

Followed by,

$this->scopeConfig->getValue('...', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)


texts: How to filter Order Collection by Specific Product Item name?

texts:
I would like to know how to filter order collection by using a product item name in magento 2?
$collection = $this->_orderCollectionFactory->create()->addAttributeToSelect('*');
$collection->getSelect()->join(
        ["soi" => "sales_order_item"],
        'main_table.entity_id = soi.order_id',
        array('name')
    )
     ->where('soi.name', array('like' => '% '.$params['filter-text'].' %'))
    ->group('main_table.entity_id');

Just tried this way and it didn't work. I get no order collection using this collection filter. Any help will be appreciated! Thanks!


texts: How to add stock filter in stiemap.xml in Magento 2.3?

texts:
I want to exclude out of stock products from the sitemap.xml. I want to add stock filter like status or visibility filter in the product collection:
public function getCollection($storeId)
    {
        $products = [];

        /* @var $store Store */
        $store = $this->_storeManager->getStore($storeId);
        if (!$store) {
            return false;
        }

        $connection = $this->getConnection();
        $urlRewriteMetaDataCondition = '';
        if (!$this->isCategoryProductURLsConfig($storeId)) {
            $urlRewriteMetaDataCondition = ' AND url_rewrite.metadata IS NULL';
        }

        $this->_select = $connection->select()->from(
            ['e' => $this->getMainTable()],
            [$this->getIdFieldName(), $this->_productResource->getLinkField(), 'updated_at']
        )->joinInner(
            ['w' => $this->getTable('catalog_product_website')],
            'e.entity_id = w.product_id',
            []
        )->joinLeft(
            ['url_rewrite' => $this->getTable('url_rewrite')],
            'e.entity_id = url_rewrite.entity_id AND url_rewrite.is_autogenerated = 1'
            . $urlRewriteMetaDataCondition
            . $connection->quoteInto(' AND url_rewrite.store_id = ?', $store->getId())
            . $connection->quoteInto(' AND url_rewrite.entity_type = ?', ProductUrlRewriteGenerator::ENTITY_TYPE),
            ['url' => 'request_path']
        )->where(
            'w.website_id = ?',
            $store->getWebsiteId()
        );
// echo $this->_select;
        // var_dump($this->_productVisibility->getVisibleInSiteIds()); die('hii');
        $this->_addFilter($store->getId(), 'visibility', $this->_productVisibility->getVisibleInSiteIds(), 'in');
        $this->_addFilter($store->getId(), 'status', $this->_productStatus->getVisibleStatusIds(), 'in');

        // Join product images required attributes
        $imageIncludePolicy = $this->_sitemapData->getProductImageIncludePolicy($store->getId());
        if (\Magento\Sitemap\Model\Source\Product\Image\IncludeImage::INCLUDE_NONE != $imageIncludePolicy) {
            $this->_joinAttribute($store->getId(), 'name', 'name');
            if (\Magento\Sitemap\Model\Source\Product\Image\IncludeImage::INCLUDE_ALL == $imageIncludePolicy) {
                $this->_joinAttribute($store->getId(), 'thumbnail', 'thumbnail');
            } elseif (\Magento\Sitemap\Model\Source\Product\Image\IncludeImage::INCLUDE_BASE == $imageIncludePolicy) {
                $this->_joinAttribute($store->getId(), 'image', 'image');
            }
        }

        $query = $connection->query($this->prepareSelectStatement($this->_select));
        while ($row = $query->fetch()) {
            $product = $this->_prepareProduct($row, $store->getId());
            $products[$product->getId()] = $product;
        }

        return $products;
    }

I have tried this code:
$this->_addFilter($store->getId(), 'quantity_and_stock_status',1, 'in');

But it is not working. Can anyone suggest how can I do this?


texts: Shipping information in checkout/onepage/ not coming from app/code/core/Mage/Checkout/Block/Onepage/Progress.php

texts:
I'm trying to return a custom string from the function that returns the shipping method (can be seen here - http://imgur.com/pwqURAW)

I have overridden the core functionality and created app/code/local/Mage/Checkout/Block/Onepage/Progress.php and I have returned custom strings in the functions getShippingMethod() and getShippingDescription() but none are shown in the onepage checkout process.

As a test, I tried doing the return on getShippingMethod() and getShippingDescription() in the core file but that shows no results either.

My question is, how do I change the text "Please select one of the following options: - Send Package Express" that you see in the image link I have posted?