texts: How to execute a controller file using shell_exec in Magento 2?

texts:
I want to create product using controller so how would i hit the controller using shell_exec.
How would i do that ?
My controller file is
<?php
namespace Mageplaza\HelloWorld\Controller\Index;

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

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\Filesystem\DirectoryList $dir,
    \Magento\Catalog\Api\Data\ProductInterfaceFactory $productFactory,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
    \Magento\Framework\View\Result\PageFactory $pageFactory
    )
{
    $this->productFactory = $productFactory;
    $this->_dir = $dir;
    $this->productRepository = $productRepository;
    $this->_pageFactory = $pageFactory;
    parent::__construct($context);
}

public function execute()
{
  try {
    $product = $this->productFactory->create();
    $product->setSku('sku2');
    $product->setName('Product Name2');
    $product->setDescription("Product Description1");
    $product->setShortDescription("Product Short Description1");
    $product->setWebsiteIds([1]);
    $categories = ["3"]; //create an array of categories which you want to set for the product
    $product->setCategoryIds($categories);
    $product->setWeight(10);
    $product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE);
    $product->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH); // To make product visible in both catalog,search
    $product->setPrice("100");
    $product->setAttributeSetId(4); // Attribute set for products
    $product->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_DISABLED);
    $product->setUrlKey("Product URL Key");
    $product->setStockData(
        array(
            'use_config_manage_stock' => 0,
            'manage_stock' => 1,
            'is_in_stock' => 1,
            'qty' => 1
        )
    );
    $product = $this->productRepository->save($product);
    $product->save();
    } catch (Exception $e){
      echo $e->getMessage();
    }
}
}

Actually i have text file( .txt ) which have multiple fields which is used to create product  so on hitting the controller directly it might be an issue ( ex. timeout or any other ) because some months ago ( i have worked on wordpress so there will be an timeout issue so there i have used shell and it solves that problem ) so, here i think it will create same issue while creating these product so i want to hit that using shell so the process is run on terminal.


texts: Include configurable product price with simple product options price in Magento 2

texts:
Is it possible or any option to include  configurable price with simple product options price.

Ex - T-Shirt(configurable product) - price -$100
     with associated two simple products
    Color(option)
     Red - $50
     Blue - $60

Now will there any option that configurable product price will show:
 $160 when choose Red and $150 when choose Blue.
 Is there any configurable price option setting or is default ?
My requirement is to create configurable products only so I can handle inventory of each associated products. And simple product options price will include configurable product price too.


texts: Static CSS files being generated by JS isn't

texts:
I'm using default/Magento_Theme/layout/default_head_blocks.xml to add CSS and JS. In developer mode, CSS is being added to static files but JS and files are not.
<?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">
    <head>
            <link src="js/menu.js"></link>
            <link src="js/iehover-fix.js"></link>
    </head>
</page>


texts: Magento2 - Create A Custom Report Displaying Order Items

texts:
I'm trying to create a report that displays all order items along with some additional columns displaying things like customer name, customer billing address, order ID, payment method, etc.

Can anyone provide any links to articles about creating a custom report in Magento2?

Or explain the best practices?

I'm struggling to find any information on the subject.


texts: Display Products [Ordered] of Particular Designer after login

texts:
magento site : www.1234.com

We have lot of Designers in site (Seller/ Vendor). we assigned each product to one Designer  with help of attribute Designer ID as below image under Catalog > Manage Products section

we are displaying all the orders in custom page : www.1234.com/php/site6/orders.php

if we login as admin we can see all orders in page .

if we login as Designer1, than we can see all orders that contains Designer1's Products.

if we login as Designer2, than we can see all orders that contains Designer2's Products.

Now, Product 1 belongs to Designer1 [kidsdial2] , Product 2 belongs to Designer2 [kidsdial3].

if we login as Designer1 or Designer2 , we can see as above image.

It contains Products of both Designer 1 & Designer 2 as because customer ordered both products in single order.

but I want to display only Designer 1 product if we login as Designer1 & same for Designer 2

We are saving Designer id & Designer names in custom database with table tbl_users , columns : userID [Designer ID] , name [Designer]

function getDesignerCollection()
    {

    $user_home = new USER();
    require_once '../../app/Mage.php';

    Mage::app();

    $stmts = $user_home->runQuery("SELECT * FROM tbl_users WHERE userID=:uid");
    $stmts->execute(array(
        ":uid" => $_SESSION['userSession']
    ));
    $rows = $stmts->fetch(PDO::FETCH_ASSOC);

    $accountType = $rows['type'];
    if ($accountType == "admin")
        {
        $is_admin = true;
        $order = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('designer_id', array(
            'nin' => '0'
        ));

        }
      else
        {
        $order = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('designer_id', array(
            'like' => '%' . $_SESSION['userSession'] . '%'
        ));

        }

    $i = 0;

    foreach($order as $orderData)
        {
        $orderitems = $orderData['dproduct_id'];
        $orderitemsarray = explode(",", $orderitems);
        $k = 0;
        $oDate = new DateTime($orderData['created_at']);
        $sDate = $oDate->format("M d, Y");

        while ($k < count($orderitemsarray))
            {

            if ($orderitemsarray[$k] != '0')
                {
                $stmtorders = $user_home->runQuery("SELECT * FROM order_details");
                $stmtorders->execute(array(":dorder_id" => $orderData['entity_id']));
                $roworders = $stmtorders->fetch(PDO::FETCH_ASSOC);

                $productdetail = Mage::getModel('catalog/product')->load($orderitemsarray[$k]);
                $designerName = getDesignerName($productdetail->getDesignerID()) . " -(" . $productdetail->getDesignerID() . ")";
                $responce[] = array(
                    $orderData->getIncrementId() ,
                    $orderData->getIncrementId() ,
                    $orderitemsarray[$k],
                    $productdetail->getName() ,
                    $designerName,
                    $orderData['status'],
                    $orderData['grand_total'],
                    $orderData['customer_email'],
                    $commission,
                    $dorderStatus,
                    $sDate
                );

                }

            $k++;
            $i++;
            }
        }

    echo json_encode($responce);
    }

Edit : Sales_flat_order table

Edit 2

Below code is reason for displaying both Designers Products, what code i need to use for displaying only that designer products

$order = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('designer_id',array('like' => '%'.$_SESSION['userSession'].'%'));


texts: Simple products detached from configurabe products after import

texts:
I imported a simple spreadsheet into Magento 2.1.3 with stock updates and image updates. However, what this export seems to have also done is detach the simple products from the master configurable products for the items that were imported.

I tried to reconnect the simple products via a desktop application Magento Manager, however, this also failed as the products seem to still be associated with the configurable product in the database but not in the admin or website views.

Is there any way to either disconnect the simple products in the database and reconnect them so that they show up with the correct configurable product again.

Below I have added an example of which fields were added to the spreadsheet.
The import behavior was set to Add/Update only.

sku,    store_view_code,    attribute_set_code, product_type,   categories, product_websites,   name,   weight, product_online, tax_class_name, visibility, price,  url_key,    additional_attributes,  qty out_of_stock_qty,   additional_images,  base_image, small_image,    thumbnail_image swatch_image.


texts: In Magento 1.9.X how to call site2.com product list on site1.com through rest api

texts:
I have two website and both are developed by magento 1.9.x vesion.

As Example:

1. www.example1.com
2. www.example2.com

Now I need to show product list in www.example1.com  from www.example2.com of some particular category through SOAP/REST API.

I go through the Magento 1.x REST API But I didn't find any solutions.


texts: Magento 2 : Add Custom Fee to Paypal Express Checkout

texts:
I develop custom extension which add custom fee to order based on payment method selection. Every thing working fine except "Paypal Express Checkout".

When I select this method, it added custom fee into total fine and it show on checkout like this.

To pass this custom fee into paypal express checkout,
I do code like this.

app\code\Vendor\Extension\etc\events.xml

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

And Observer file like this.

<?php
namespace Vendor\Extension\Observer;

use \Magento\Framework\Event\ObserverInterface;
use \Magento\Framework\Event\Observer;
use \Magento\Checkout\Model\Session;

class AddFeeToPaypal implements ObserverInterface
{
    public $checkout;

    public function __construct(Session $checkout)
    {
        $this->checkout = $checkout;
    }

    public function execute(Observer $observer)
    {
        $cart = $observer->getEvent()->getCart();
        $quote = $this->checkout->getQuote();
        $address = $quote->getIsVirtual() ? $quote->getBillingAddress() : $quote->getShippingAddress();

        if ($fee = $address->getCustomFee())
        {
            $cart->addCustomItem('Paypal Payment Fee', 1, $fee);
        }

        return $this;
    }
}

But is show me error like this.

  PayPal gateway has rejected request. The totals of the cart item
  amounts do not match order amounts (#10413: Transaction refused
  because of an invalid argument. See additional error messages for
  details).

How can I solve this error?

Thanks in advance.


texts: Can I offer one product at a different retail price depending on store view?

texts:
I'm a relative newcomer.

I'm launching multiple stores under a single website, and was planning to rely on a particular functionality I saw in the official Price Scope documentation:

  "If the price configuration is set to the website level, the same product can be available at different prices in different stores."

source: https://docs.magento.com/m2/ce/user_guide/catalog/catalog-price-scope.html

But even with my price scope configuration set to "website", the above quote doesn't seem to be true. Can someone tell me if this is user error or if the documentation is just misleading/wrong?

To help illustrate, I want:

Store 1 : ProductA : $10

Store 2 : ProductA : $20

Store 3 : ProductA : $15

All stores are under the same website. Catalog price scope is set to "website" as recommended. But when I edit the price for "ProductA" in Store 1, it updates the price in Stores 2 & 3, as well. It seems impossible to customize product price by store, which I believe contradicts the quoted documentation?

I've come across a paid 'BSS Commerce' extension that allow you to set price scope to "Store View", but why is an extension necessary when Magento's own documentation purports to offer this functionality? Is the documentation wrong?


texts: How to disable given date in default calendar?

texts:
I have a table in the database which contains some dates. I want to disable those dates in magento default calendar. The calendar is in front-end checkout process (used to add delivery date for the order). Any suggestions will be appreciated.

I'm using Magento CE 1.7


texts: Magento 2.2.5: Disable Add to Cart button

texts:
I'm looking for solution to disable all add to cart button in every page in frontend without using phtml file or css.
I've found some solution but for disable price,but not add to cart button, i hope to find some solution like this:
How to hide price in magento2

Any idea, please help :) Thanks


texts: How to solve MGS\\Mpanel\\Model\\Category\\Attribute\\Source\\Perrow does not exist error in magento-2.2.7?

texts:
I have installed a MGSTheme in old Magento version 2.1.12. But Now it generate some error during update. If i will remove complete folder app/code/MGS after that we run update process. it updated successfully but when i click on Admin>>Catalog->Category in admin panel. It show some error :

  {"0":"Class MGS\Mpanel\Model\Category\Attribute\Source\Perrow does not exist","1":"#0 /opt/lampp/htdocs/magento_demo/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('MGS\\Mpanel\\Mode...')\n#1 /opt/lampp/htdocs/foxministry_stg/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44):

How to solve it, Please help me. I am using Magento-2.2.7 now.


texts: How is the width being applied to the sidebar from this LESS?

texts:
Please can someone explain what exactly does this mean and is doing...?
#lib-layout-columns > .left();

It can be found in _layout.less.
I have spent ages trying to backtrace where Magento is setting the column widths as I want to remove them as overriding with Bootstrap and I have traced it back to this line in the LESS.
.sidebar-main {
    #lib-layout-columns > .left(); /* this contains 'width: 16.66666667%;' */
    padding-right: @layout-column-main__sidebar-offset;
    &:extend(.abs-add-box-sizing-desktop all);
}

It is applying the width to the class sidebar-main - I have no idea how though.


texts: Magento CE 1.9.2 RWD search sidebar - what are my options?

texts:
In the Magento CE 1.9.2 demo store I've got installed, I'm using the responsive web design theme (3 column pages) and I'm trying to understand my options for having a search sidebar in either the left or right column that gives the customer the ability to search using some of my product attributes.

I've set the relevant product attributes up as searchable (Catalog > Attributes > Manage Attributes > Edit Product Attribute > Frontend Properties) but at the moment I can only see a couple of basic ways to use search functionality in Magento out-of-the-box. There is probably something really obvious I'm missing but all I see is the following two product search options in the frontend:

the simple search box in the top right hand corner of the home page
the advanced search page at mydomain.com/catalogsearch/advanced/

What's the right approach here - configure (e g. a search sidebar that comes with Magento that I just need to activate), build (something everyone designs and codes for themselves) or buy (a commercially available extension)?

I've googled it, I've looked through this site, I've tried searching for relevant extensions on the magento commerce site, I've looked through a couple of Magento books (they are pre-version 1.9 though, so not much use) all to no avail. I'm a Magento newbie - hopefully this question isn't too dumb but apologies if it is! I just can't figure this one out by myself... Thanks in advance for any help or pointers you can provide!


texts: Search for simple product as a part of a grouped product

texts:
In our Magento 1.9.1.1 shop we have grouped products with simple products as it part.
The simple products have the setting - not visible individually
The grouped products have setting - visible in Catalog and search.
As the result, when our customers are trying to search for the simple product by its number or title - the search result say: the are no items you are looking for.

Is this possible, that when a customer is searching for the simple product that is a part of a grouped product, in search autocomplete and among search results he/she can see the grouped product, that is a parent item for the product he is looking for.

Is there any module that can help us to solve the issue?


texts: how to add customer attribute with default values set for all existing entities?

texts:
I have code like this :

    $setup->addAttribute('customer', 'my_custom_attr', array(
            "type" => "text",
            "backend" => "",
            "label" => "Languages for filter in layered filter.",
            "input" => "text",
            "source" => "",
            "visible" => false,
            "required" => false,
            "default" => "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15",
            "frontend" => "",
            "unique" => false,
            "note" => "Imploded with comma array of language id's."
        )

attribute adds successfully but the default value is not avaliable for all existed entity:

    Mage::getModel('customer/customer')->getCollection()->getFirstItem()->getMyCustomAttr(); // null

but attribute exists, and i am able to update it, etc.

is it possible to set it as default or I need to update all existed records manually ?

I found this Set default value to custom attribute for all products but here it is Mage::getModel("catalog/product_action") model is used to update attributes, is there some way of doing it for customer entities ?


texts: How should I show the pre-sale price for grouped or configurable products in category view?

texts: By default, the pre-sale price and sale branding are shown for simple products that are on sale, but for grouped products for which one associated product is on sale, only the sale price is shown, without any indication that it is a sale price.


texts: Magento 2.3 Install Venia Data error in setup:upgrade commands

texts:
I am applying the PWA Venia theme on local setup via xampp (windows10).

I have referred the following guidelines:
https://magento-research.github.io/pwa-studio/venia-pwa-concept/setup/

Adding the Venia sample data modules to Magento is successful.But when I run the setup:upgrade command then following error occurs in the commandline

  Module 'Magento_ConfigurableSampleDataVenia':
  in C:\xampp-7.2.19\htdocs\mage232\vendor\magento\module-configurable-sample-data-venia\Setup\Swatches.php on line 116


texts: calling custom api in another custom api in Magento 2

texts: I am trying to get the result of one custom API in another custom API. Please help me with the same.


texts:
can you help with this? Setting up site at http://bulklolliesnz.co.nz/store/

Imported products which are showing in categories and search but when clicking product link they're not there. Flushed cache, re-indexed.


texts: Add to cart quantity reset to 1 even i added 2 qty in Arabic store Magento 2

texts: Minicart quantity reset to 1 even I added qty 2 Magento 2. I am having the Arabic store, in the Arabic store only this issue shows, is it the problem with Locales. Please help to solve it.


texts:
This simple query works as expected with SOAP V2:

$result = $proxy->catalogProductList($sessionId);
var_dump($result);

but swap the Role resource access to Catalog Inventory > Retrieve stock data  …and substitute this instead:

$result = $proxy->catalogInventoryStockItemList($sessionId, array('1', '2'));
var_dump($result);

…and the result is:

array(0) { }

But there are plenty of products with inventory of at least 1.

Any ideas? Thanks!

Magento 1.9.2.2

http://www.magentocommerce.com/api/soap/catalogInventory/cataloginventory_stock_item.list.html


texts: How to get Product via API right after product created?

texts:
Case : When product is created, I need to send SKU to 3rd party, and then they immediately call magento REST API to get product by SKU.

So far I'm using catalog_product_save_after event. And for testing purpose I call v1/products/{sku} inside observer.

public function execute(\Magento\Framework\Event\Observer $observer)
    {
     $product = $observer->getProduct();
     if($product->isObjectNew()){
       $ch = curl_init("http://xxx.xxx/index.php/rest/V1/products/".$product->getSku());
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . xxx));
        $result = curl_exec($ch);
     }
}

Observer is working fine and I can get $product.

However, unfortunatelly the result for calling rest api is error "message":"Requested product doesn't exist". But when i tried to call v1/products/{sku} with same SKU as before after few seconds, I got the product.

Is there any way to get what i want with that flow? Or I need to use another event?


texts: Exporting admin panel settings that are saved to the database

texts:
When handling different environments for dev and live sites, how to pass on changes that are only saved to the database to the other environment without having to export the whole database? Say for example I disabled an extension, changed the content of a static block, created a new static cms page, added a new shipping method, tax rule, or what have you. How do I pass on small changes like this to the live site without having to export and import the entire database? Obviously there is information on the live site that I wouldn't want overridden.

I'm sure someone else must have run into this, specially when using version control. We have implemented git, but that only works for file level changes. The files in both environments can be exactly the same but some config in the database can change so they behave differently.

I could keep track of all the changes I make in the admin panel, and then reproduce them in the other environment, but that seems very unpractical. The number of changes can be quite large as we are continuously tweaking the site to our satisfaction. Besides, other developers are working as well, and we even set up an environment for outsourced developers and technical support from Magento extension providers. I can't keep track of everything they do.

I've seen tons of posts on exporting products only, so that is not really the problem. I would like the other way around. Maybe someone has made a list of all tables required to clone a Magento site without products and orders and customer information. Just everything that is configurable in the admin panel.

Has anybody done this before?

UPDATE:
For the readers, I'm marking @mbalparda's answer on manual deploy files as accepted until something else comes up that does as required. I will enforce rules to keep logs on the changes in the admin panel from all developers involved so we have one unified list at the end. It isn't actually the answer to the question but it is the method I will use to solve this until I find a better process.


texts: Magento 2 devbox reset scipt command not found m2devbox-reset.[bat|sh]

texts:
I am trying to reset Magento devbox after restarting my mac and i keep getting the following error when running the command in the root folder.

  user-iMac:build-7204cee62e1e6ccb35bbdfc977c5e522 user$
  m2devbox-reset.[bat|sh]
  -bash: m2devbox-reset.[bat: command not found
  -bash: sh]: command not found


texts: Magento 2 validation exception message not translated

texts: At checkout page, when I click place order without accepting the terms and conditions the validation error it's showed in english instead of spanish. However, the store shows the interface in spanish and the translation line of that exact message is in the csv translation file


texts: Setting up Magento 2 for multiple stores

texts:
After creating a second website on my Magento admin (setting up the store, storeview, base url etc.) I can't reach the newly created store. Whenever I go try the url I want website to use I just get redirected to my main store.
I also configured the DNS settings correctly (I think).

Example:
Main Store: main.store.eu
Second store: store.second.eu

Whenever I use store.second.eu it redirects me to main.store.eu
I've been looking into the magento2/index.php file and magento2/nginx.config but the explanations aren't totally clear, talk about M1 or talk about an Apache server...

Can somebody please help :)


texts: URL key for specified store already exists. When importing

texts:
M 2.3.1

We are importing via Firebear.
When I import I am getting success.. the product imports but I get this error:

URL key for the specified store already exists.

Whenever I try and SAVE products...

We had previously deleted products from the table with
"delete from catalog_product_entity;"

If I change the URL key in the feed.. the import works ok and I can save the product...

How can I "clean up" my database so I can import the original feed with the original URL key and have it allow me to save the product.. without "URL key for specified store already exists" error?


texts: how to install premium theme to Magento 2.0 localhost

texts:
Recently i have brought a Magento Theme and trying to install it to my localhost. I am using Magento 2.0 in wamp in Windows. To install it, i have followed the instruction here

I just extract and copy-paste them directly to my project as instructed in the video. At the "Theme Installation" video of that link, i am somewhat lost because of the changed interface of Magento-2.0.

Even if i paste it right,on Magento 2.0 dashboard, under content->Design->Theme, it doesn't show any name of that theme.

So, guide me through the whole process step by step please.


texts: Get all quote id from custom column data magento 1.9

texts:
I have the following code. Where I pass a device id which is stored as a custom column in sales_quote and get all the quote ids to that device id.
By trying the below code I am able to get only first occurrence of quote id.

Can anyone please help.
Thanks

$deviceId=$device_id;
    $quote = Mage::getModel('sales/quote')->load($deviceId,'device_id');//here device_id is feild in database
    $cartItems = $quote->getAllVisibleItems();
    foreach ($cartItems as $item) {
    $pid = $item->getQuoteId();
    }


texts: service contract save method flow - magento 2

texts:
I can able to get custom table records from database using service contract but hard to understand the save flow.

di.xml

<preference for="Mobi\Service\Api\RcRepositoryInterface" type="Mobi\Service\Model\RcRepository"/>
<preference for="Mobi\Service\Api\Data\RcInterface" type="Mobi\Service\Model\Rc"/>

can anyone explain the flow with some key codes?


texts: It seems since extensions were moved from Connect to Marketplace the Connect Manager is no longer showing available updates for extensions. Is there any way to keep using the Connect Manager or will I have to go through my extension manually to check for updates?


texts:
I upgraded to Magento 2.3 and got this error on the top of the admin page.

  SQLSTATE[42S02]: Base table or view not found: 1146 Table
  'a15809b3_m2.magento_bulk' doesn't exist, query was: SELECT
  main_table., (IF( (SELECT count() FROM magento_operation WHERE
  bulk_uuid = main_table.uuid ) = 0, 0, (SELECT MAX(status) FROM
  magento_operation WHERE bulk_uuid = main_table.uuid) )) AS status
  FROM magento_bulk AS main_table WHERE (user_id = '1002') ORDER
  BY FIELD(status, 2,3,0,4,1), start_time DESC

where can I get this to add to the database?


texts: How to create custom product grid module in customer edit page in magento2?

texts: I want to create a custom tab in the customer edit page in that tab displays the product grid. I don't know how to implement this task could you please help me?


texts:
Please help, how will I get bundle parent id inside this block? also, I would like to get the parent product ID and one of the custom attribute label called "image_type"?

<?php
namespace Company\Tools\Block\Product\Bundle;

use Ewave\ExtendedBundleProduct\Block\Product\Bundle\Configurable as EwaveConfigurable;

/**
 * Class Configurable
 * @package Company\Tools\Block\Product\Bundle
 */
class Configurable extends EwaveConfigurable
{
    /**
     * Get product images for configurable variations
     *
     * @return array
     * @since 100.1.10
     */

protected function getOptionImages()
    {

        $images = [];
        foreach ($this->getAllowProducts() as $product) {
            $productImages = $this->helper->getGalleryImages($product) ?: [];
            foreach ($productImages as $image) {
                $images[$product->getId()][] =
                    [
                        'thumb' => $image->getData('small_image_url'),
                        'img' => $image->getData('medium_image_url'),
                        'full' => $image->getData('large_image_url'),
                        'caption' => $image->getLabel(),
                        'position' => $image->getPosition(),
                        'isMain' => $image->getFile() == $product->getImage(),
                        'type' => str_replace('external-', '', $image->getMediaType()),
                        'videoUrl' => $image->getVideoUrl(),
                        'swatch' => $this->_urlBuilder->getBaseUrl(['_type' => \Magento\Framework\UrlInterface::URL_TYPE_MEDIA])
                            . 'catalog/product'
                            . $product->getSwatchImage(),
                    ];
            }
        }

        return $images;
    }
}


texts: How to sort footer links via XML in Magento2

texts:
Referencing to this ticket: Magento 2 - Remove and change footer links

I have now the question if one can change the position from the respective links without removing them and reinitiating them afterwards.

Is there any sort parameter for XML?

<referenceBlock name="catalog-search-advanced-link" remove="true"/>
<referenceBlock name="search-term-popular-link" remove="true"/>
<referenceBlock name="sales-guest-form-link" remove="true"/>

<referenceBlock name="footer_links">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="ueber-uns">
            <arguments>
                <argument name="label" xsi:type="string">Über uns</argument>
                <argument name="path" xsi:type="string">ueber-uns</argument>
            </arguments>
        </block>
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="kundenservice">
            <arguments>
                <argument name="label" xsi:type="string">Kundenservice</argument>
                <argument name="path" xsi:type="string">customer-service</argument>
            </arguments>
        </block>
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="contact-us-link">
            <arguments>
                <argument name="label" xsi:type="string">Kontakt</argument>
<!--                 <argument name="path" xsi:type="string">customer-service</argument> -->
            </arguments>
        </block>
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="privacy-policy-link">
            <arguments>
                <argument name="label" xsi:type="string">Datenschutz</argument>
            </arguments>
        </block>
    </referenceBlock>

Results in:

Datenschutz
Kontakt
Über uns
Kundenservice

on the frontend (in this order), even if I declared "Über uns" BEFORE I changed the name of the contact-us-link and the privacy-policy-link


texts: Magento 2.2.6 disk space utilization - /var/lib/mysql/ folder is taking 43 gb

texts:
Due to some reason my magento 2 website  (Magento ver. 2.2.6) taking too much space from the server . Yesterday there is 1.2 gb available now only 240mb available . Please help on this .

Please see the attached picture now

  UPDATE : I have found that most of the disk space is taken by
  /var/lib/mysql/webna this folder (42 gb).  Here webna is my database name .In that folder i can see lots of IBD , FRM, MYI files. There is on file inside the webna folder called mageplaza_smtp_log.ibd and it's file size is 43 gb.

Please see the below image


texts: What does "We were unable to check for API ACL" in the Magento security check report mean?

texts:
We did the Magento security scan.

And got

unknown | Patch API ACL | We were unable to check for API ACL Please check out our Security Best Practices

What is that supposed to mean? Which security best practices?

EDIT

Is this about https://magento.com/security/best-practices/restricting-access-anonymous-web-apis -- but doesn't unkown mean, it could not be checked for some reason, not, that is open?


texts:
Hi there I keep getting "Please specify a shipping method" on my magento website when checkout with paypal express and also having issues with Paypal in general. I would really appreciate help.

Also get emails:

Please check your server that handles PayPal Instant Payment Notifications (IPN). Instant Payment Notifications sent to the following URL(s) are failing:

http://mywesite.co.uk/index.php/paypal/ipn/

If you do not recognize this URL, you may be using a service provider that is using IPN on your behalf. Please contact your service provider with the above information. If this problem continues, IPNs may be disabled for your account.

Thank you for your prompt attention to this issue.


texts: Add block in left column if it was removed in the default file

texts:
I have a 2 columns - left layout for the checkout_cart_index. In the checkout.xml file, the left column is removed:

<checkout_cart_index translate="label">
        <remove name="left"/>
</checkout_cart_index>

How can I add a block in the left column via local.xml?

<checkout_cart_index translate="label">
<reference name="left">
            <block type="catalog/navigation" name="catalog.polar.pagenav" template="catalog/navigation/pagenav.phtml"/>
</reference>
</checkout_cart_index>

Does not work.

Thanks!


texts: CSS has suddenly disappeared - No explanation (1.9)

texts:
I was doing some final finishing touches to a Magento 1.9 installation, refresh the page, and magically all the styles, apart from those that are inline, have stopped working.

On inspection, Magento is calling for skin/frontend/base/default/css/styles.css and there isn't a file there. (403 Error) I have checked in a previous backup, and the file wasn't there either, and I am using custom theme (Smartwave Mango > http://themeforest.net/item/mango-responsive-magento-theme/11629375?s_phrase=&s_rank=157), so I presume it shouldn't be looking there

I can't work out why magento is trying to find styles.css from that folder at all. I have changed no CSS since yesterday, only a static block, so nothing has been edited.

Things I have tried:

Cleared all Caches, multiple times (Browser + Magento)
Cleared Indexes
Verified the base URL is correct
Checked a backup to see if files have somehow got lost- can't see any change
Looked for a replacement styles.css- it doesn't exist.
Checked in Chrome + FF
Checked that Magento is using the correct theme

It does seem that Magento is ignoring my local.xml in app/design/frontend/smartwave/mango/layout, and putting default references in the Head of the generated HTML, but being a noob, am not sure. Images are loading, but custom JS isn't either.

(Almost) tearing hair out here- thanks for any help!


texts: Set block cache lifetime for block in layout xml

texts:
Magento 2.1.1.

I have added custom sorting of products in catalog pages, by random order and I want my block to be dynamicall, so with every change of sorting for random the collection should be shuffled.

I would like to set cache lifetime for block in layout xml if possible. I can exclude it completly from caching using `cacheable="false", but that's not exactly I need.
I have noticed something like this:

<block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="html/topmenu.phtml" ttl="3600" before="-"/>

I am not sure how to test if it working - I set 15 seconds for my block, but actually order of product never changed.

If I find out how to set ttl for block, nice improvment would be one from  here:
https://www.schmengler-se.de/en/2015/09/show-random-products-in-magento-you-are-doing-it-wrong/

First, make sure that you don’t load random products on every request. Use the cache. Even with a cache lifetime of just a few minutes, this will reduce load on a frequently visited page significantly. If you want to avoid showing the same products to the same user on a page refresh, you can cache multiple versions of the block using different cache keys and select one of the tags based on time, a counter in the session, or randomly.

The following method in a block caches 10 versions of the block and rotates them for each user. With a low cache lifetime most users will not see the same version twice:

In similiar situation I can add my block in a few versions to cache (preventing the same user watching the same order of products), but I don't know how to achieve that.


texts: Using variables in Category Title. Meta and descriptions - e.g. product count

texts:
is there an easy way to make certain variables available in the field for: category title, category description or category meta?

Suppose we want to make our category title "{COUNT}+ Brand name products in our store" where {COUNT} holds the number of items in the category? (and it updates every time it re-indexes)

Or maybe we want to make it a little more complex and round the cound to the nearest 10fold and use that?

Is there a different nifty way? (maybe a after_html PHP regex)

on a sidenote: Will this be indexed properly? for search?

Appreciate your help


texts: How to add github module to magento2 site?

texts:
I want to create a gallery in magento2 but No free extension is avalilable . So now I am trying to install that module from github

  https://github.com/daniel-rose/magento2-gallery

I extracted that in my

  /var/html/www/magento2/app/code/infornite/Gallery/

I made this folder Gallery and in this folder full folder with code reside in a folder gallery. After that I run all three commands

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

but still nothing happens. I am using Ultimo paid theme . can somebody help me ?

EDIT : When I run this I got this error

Fatal error:  Interface 'DR\Gallery\Api\Data\ImageInterface' not found in /var/www/html/magento2/app/code/Infortis/Gallery/Model/Image.php on line 16


texts: How to implement google conversion tracking on a form

texts: We have a form on our magento site for folks to apply for financing. The results get emailed. Simple enough. When someone submits the form, there is no redirect to a thank you page, only a message that pops up. What I don't know is what url I am supposed to use to track form submissions or what I need to do to get it working. The tag assistant in chrome shows the analytics is alive and well on the finance/apply page, which is where the success message pops up. I am not the programmer of the magento site, rather the marketing person told to figure this out. I've set up tracking successfully on the /checkout/onepage/success/ and it is working. I just am not sure how to handle form submission. Any and all help is appreciated.


texts: My Account page Back to My Orders link how to move after Order Information in magento 2.3.6

texts:
My Account Page Sales order invoice page Back to My Orders link how to move after Order Information in magento 2.3.6

http://magento2.com/sales/order/invoice/order_id/22361/
vendor/magento/module-sales/view/frontend/templates/order/invoice.phtml

<?= $block->getChildHtml('invoice_items') ?>

        <a href="<?= $block->escapeUrl($block->getBackUrl()) ?>" class="action back">
            <?= $block->escapeHtml($block->getBackTitle()) ?>

vendor/magento/module-sales/Block/Order/invoice.php

<?php
 /**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
 namespace Magento\Sales\Block\Order;

 use Magento\Customer\Model\Context;

 /**
 * Sales order view block
 *
 * @api
 @since 100.0.2
 */
 class Invoice extends \Magento\Sales\Block\Order\Invoice\Items
{
/**
 * @var string
 */
protected $_template = 'Magento_Sales::order/invoice.phtml';

/**
 * @var \Magento\Framework\App\Http\Context
 */
protected $httpContext;

/**
 * @var \Magento\Payment\Helper\Data
 */
protected $_paymentHelper;

/**
 * @param \Magento\Framework\View\Element\Template\Context $context
 * @param \Magento\Framework\Registry $registry
 * @param \Magento\Framework\App\Http\Context $httpContext
 * @param \Magento\Payment\Helper\Data $paymentHelper
 * @param array $data
 */
public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Framework\Registry $registry,
    \Magento\Framework\App\Http\Context $httpContext,
    \Magento\Payment\Helper\Data $paymentHelper,
    array $data = []
) {
    $this->_paymentHelper = $paymentHelper;
    $this->httpContext = $httpContext;
    parent::__construct($context, $registry, $data);
    $this->_isScopePrivate = true;
}

/**
 * @return void
 */
protected function _prepareLayout()
{
    $this->pageConfig->getTitle()->set(__('Order # %1', $this->getOrder()->getRealOrderId()));
    $infoBlock = $this->_paymentHelper->getInfoBlock($this->getOrder()->getPayment(), $this->getLayout());
    $this->setChild('payment_info', $infoBlock);
}

/**
 * Return back url for logged in and guest users
 *
 * @return string
 */
public function getBackUrl()
{
    if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) {
        return $this->getUrl('*/*/history');
    }
    return $this->getUrl('*/*/form');
}

/**
 * Return back title for logged in and guest users
 *
 * @return \Magento\Framework\Phrase
 */
public function getBackTitle()
{
    if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) {
        return __('Back to My Orders');
    }
    return __('View Another Order');
 }

}


texts: Changing Design Configuration Settings Aren't Reflected on Frontend

texts:
As you can see below, I have changed the footer text information but on the frontend it still shows the old footer text.

New Footer

Website Footer

Steps I have taken so far to try to fix this:

Deleted all contents in pub/static folder
Deleted all contents in var_view_preprocessed folder
Ran php bin/magento setup:static-content:deploy command
Disabled all magento caching/Flushed and Cleaned caches
Set to developer mode and then back to production mode

Information about my website:

Using Magento 2.1.6
installed through github clone

I'm completely frustrated and lost with this issue. Please help!


texts: Why Magento2 set entity_type_id statically at CategorySetup, CustomerSetup

texts:
I am trying to create a custom Eav entity in Magento 2.
I have gone through two core eav entity modules in Magento which are Catalog and Customer.
There are a couple of things which I found strange in these two modules.
Setup Files

CategorySetup.php :

'entity_type_id' => self::CATEGORY_ENTITY_TYPE_ID

CustomerSetup.php :

'entity_type_id' =>
\Magento\Customer\Api\CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER

It seems like Magento sets entity_type_id statically here.
Q1: Why Magento sets entity_type_id statically here though it manages dynamically within  eav_entity_type table?

Q2: When are the records in eav_entity_type table created?
Q3: If  I need to create a custom EAV model, the how should I define entity_type_id for that model


texts: After upgrade magento version 2.3.1 to 2.3.3, i face an error in checkout shipment form, there is "county and country" text field. So i need to hide "county" field in checkout shipment form. Is it possible, let me know thanks?


texts: Magento 2 - frontend notices and login do not work

texts:
I just installed Magento 2.1.5. I can login on the admin side and everything appears to work as expect there. However, I cannot login on the customer side and no notifications appear during the login process.

I can see in the cookies that messages are being set (invalid password, etc..)
When I dump the values provided in the form key validator I see that Magento's form keys are not matching
My site is accessible at m2.domain.com. My cookie domain is set to m2.domain.com.


texts:
I migrated my magento project (magento version 1.9.1 ) to live server. But when I try to access the live site, it gets redirected to localhost. I have followed everything I could find regarding this issues like:

changed the secure/insecure base_url values in core_config_data table.
deleted all the contents of /var/ folder
cleared browser cache
modified the permission of /var/ folder to 777
changed the database name, username and password in local.xml file.

Still the problem is not solve.

Futhermore, if I try to access the backend, the login page in the live server is accessible but once I login, I get redirected to the backend of localhost or my local computer. Also, it is a multi-website projects. I have two websites for national and international clients.

What am I missing here?


texts:
I've created a controller within my custom module to add items to my basket and i'm trying to make an ajax call across to it. However, I can't even call my controller currently as I get a 404 error from my ajax call.
This is how my Controller currently looks:
<?php

namespace Vendor\TestModule\Controller\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;

class Test extends Action
{

    public function __construct(
        Context $context
    ) {
        parent::__construct($context);
    }

    public function execute()
    {
        return "Success";
    }
}

This is the ajax call in my phtml file:
var data = "";
var addToCartUrl = "<?php echo $block->getUrl('testmodule/index/test'); ?>";

$.ajax({
    url : addToCartUrl,
    dataType : 'json',
    type : 'POST',
    data: data,
    success : function(res)
    {
        console.log('Success');
    },
    error : function()
    {
        console.log('error');
    }
});

Here is my routes.xml file:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="admin">
    <route id="test_testmodule" frontName="test_testmodule">
        <module name="Test_TestModule" />
    </route>
</router>

I've tried to manually visit the URL that i'm sending the ajax call to and that doesn't display anything either.


texts:
http://i.imgur.com/bEe8dD2.png

Is there an extension that will display the category id next to the name of categories? It would be handy to know the id without having to click on various categories first.

For instance, you may have some static blocks on your site rotating products of various categories. You may want to copy that block to a new location and display different products instead. Personally I don't have any of my category ids memorized so simply being able to know what they are without having to do much digging will be helpful.


texts: Info_buyrequest not loading after editing quote on cart configure product page

texts: I am running magento 2.3 using Redis as cache. When an item it added to the basket I store additional info into info_buyRequest. If I then goto the cart page and select edit I get sent to the cart configure page (product_page) but the contents of info_buyrequest is blank. If I reload the cart configure page then I see the Params saved in the info_buyrequest array. I thought at first magento was reloading a cached version of the product page but I can see the Item->Id.


texts: Magento 2 : use_config_min_sale_qty on website states 10

texts:
When I add a new product or a product option to a configurable product it sets the min_sale_qty to 10 which states a message like: The fewest you may purchase is 10.

I want to set this for all products to 1 because this is the min order qty for the cart. Where in the database or magento can I set a default setting for all products and override old settings.


texts: Magento show custom attribute selected value while navigating from cart edit page

texts:
Question: I want to display the custom attribute selected values when clicking edit button from cart page

Where I want to configure custom attribute to display the selected option ?

Ex: I have created new custom attribute called as "car model" dropdown in backend, for each product they will select the "model" dropdown values.

In frontend, "model" attribute will display as dropdown depend on the each product selected values.

I will saved the selected attribute value to the cart, have problem when editing the added product from the cart.

I need idea for how to display the selected attribute value will be selected in product view page, when clicking the "Edit" button in cart page.


texts: Remove commodity from cart if customer does not start checkout within after 20 minutes

texts:
So my shop is going to sell entry Tickets of all kind.
How can I reserve the Ticket for 20 minutes and then remove it if the customer did not start a checkout?


texts: Can't edit categories in Magento after upgrade to 1.9.4

texts: After upgrade to Magento 1.9.4 I can create new categories but I can't edit them. Is it some missing patch?


texts: Magento 2: Sending a Custom Header/Response from a Controller

texts:
In Magento 2 is it possible, from a controller execute method, to manipulate the request to send a custom header and error page.

In Context: We're implementing a small, limited REST API endpoint that returns specific data.  We don't want to use the new Magento 2 API endpoints because 1. Unproven; 2. User experience in setting up authentication. 3. Full control over data formats to support the specific application. Suggestions to do so will be smiled at, and politely ignored.

I'd like to send a proper 403 Forbidden response when the API receives unauthorized requests.  I realize I could do something like

function execute()
{
    if(not authorized)
    {
        header('HTTP/1.0 403 Forbidden');
        echo "What are you doing here?";
        exit;
    }
}

But that's less than ideal -- especially since halting execution will stop other events and Magento processes from firing.

Most PHP frameworks have a way to directly Manipulate the Response to set a custom header and response string.

Does Magento 2 have something similar?

If so, what's the syntax/procedure/best-practice for using it in a controller's execute method?  Can I just get a reference to the response object and set things?  Do I need to return something specific from execute (instead of the standard page factory).  Is there a higher level abstraction for doing this that doesn't require manipulating the response? Throwing a specific exception? etc.


texts: How long does it take to make amendments to an already uploaded and approved magento 2 extension

texts:
For example I am developing a payment method module for magento 2.
Suppose I have submitted the module for review. All the tests pass, my module is approved, up and running.
Some magento websites already use my extension.
Now i want to make changes to the module. How is the process carried out? is it the same as in uploading the module for the first time? how long will it take ?
Also once the modified version is also approved and updated, how will this affect users who were already using my extension before the upgrade. /
Thanks in advance.


texts:
/rest/base/V1/stockItems/{sku} shows wrong stock_id in response.
{
  "item_id": 47,
  "product_id": 47,
  "stock_id": 1,
  "qty": 80,
  "is_in_stock": true,
  "is_qty_decimal": false,
  "show_default_notification_message": false,
  "use_config_min_qty": true,
  "min_qty": 0,
  "use_config_min_sale_qty": 1,
  "min_sale_qty": 1,
  "use_config_max_sale_qty": true,
  "max_sale_qty": 10000,
  "use_config_backorders": true,
  "backorders": 0,
  "use_config_notify_stock_qty": true,
  "notify_stock_qty": 1,
  "use_config_qty_increments": true,
  "qty_increments": 0,
  "use_config_enable_qty_inc": true,
  "enable_qty_increments": false,
  "use_config_manage_stock": true,
  "manage_stock": true,
  "low_stock_date": "2019-08-19 13:46:07",
  "is_decimal_divided": false,
  "stock_status_changed_auto": 0
}

in whick "stock_id":1 is showing by default for all products.
I need to get correct stcok_id for all products


texts: magento 2 checkout slow loading after all optimization done

texts:
The checkout page on our Magento 2 store is loading insanely slow. Does anyone know what causes this or how to fix this?

I provided a screenshot of the chrome waterfall. As you can see, some files are queued taking more time to load

How can we speed this up? I checked the TTFB by enabling profiling, but that didn't show any significantly slow things. Please check screenshot.

i have done js and css merging and advance bundling done. cdn, cache enabling varnish and redish also configured stil it is slow
m1 is loading with 200 items load time - 7- 8
m2 is loading with 200 items load times - 30 -35
any solution sujections pls to match m2 chekcout to m1


texts: Magento 1.8 "Load More Product" Button Not working

texts:
Am creating a button for Load More Product. I refer this link to create this Reference Link.

And am using coolbaby theme in my store. In coolbaby theme this code not working properly, but i tried in default rwd theme it's working.

  Path: app/design/frontend/coolbaby/default/template/catalog/product/list.phtml

This is the code:

<button id="load-more-products" class="button btn-primary">Load more products</button>
    <script>
        function sendLoadMoreProductsRequest(url) {
        new Ajax.Request(url, {
            onSuccess: function(response) {
                //Create dummy element
                var div = document.createElement('div');
                div.innerHTML = response.responseText;
                //refresh the page class element
                $$('.pages')[0].innerHTML = $(div).select('.pages')[0].innerHTML;
                //append the list to the existing product list
                $$('.category-products')[0].innerHTML += $(div).select('.category-products')[0].innerHTML;
                //check if there are more products to be loaded or not
                if(!$(div).select('.next.i-next')[0]){
                    $('load-more-products').style.display = "none";
                }
            }
        });
    }

    function callbackFunc(e) {
        if($$('.next.i-next')[0]){
            var nextPageUrl = $$('.next.i-next')[0].readAttribute('href');
            sendLoadMoreProductsRequest(nextPageUrl);
        }
        else{
            //hide button
            $$(e.currentTarget).hide();
        }
    }

    //Assigning click event to the button which triggers the "next" link
    $('load-more-products').observe('click', callbackFunc);
    </script>
    <script>
    //<![CDATA[
        //check if there are more products to be loaded or not
        if(!$$('.next.i-next')[0]){
            $('load-more-products').style.display = "none";
        }
        function testScroll(ev){
            if($$('.scroll-to-top')[0]){
                console.log(window.pageYOffset);
                if(window.pageYOffset>400){
                    $$('.scroll-to-top')[0].style.display = "block";
                }
                else{
                    $$('.scroll-to-top')[0].style.display = "none";
                }
            }
        }
        window.onscroll = testScroll;
    //]]>
    </script>

Please any one help to fix this error. Or suggest me for load more product extension.

Note: Show load more button in list page, after click this button only load other products.


texts: Call to undefined method Mage_Directory_Helper_Data::getRegionJsonByStore() in admin sales order create

texts:
This is very strange. I disabled both app/community and app/local as well as replaced app/core with stock Magento files and yet I keep getting the following error:

  Call to undefined method Mage_Directory_Helper_Data::getRegionJsonByStore() in /var/www/site-root/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Renderer/Region.php on line 87

Not sure how to troubleshoot from here.


texts: Area code is already set when auto create coupon code

texts:
I am having this issue with magento 2.4.1 instance.
Scenario is:

Create new cart price rule for discount
Fill all rules and set Coupon to Auto
Save Rule
Edit rule and go to Manage Coupon Codes and Generate 1 Coupon qty
Magento throws message that Coupon creation is added to queue and will received in a white
Coupon never created

An error in system.log is created:
report.ERROR: Area code is already set
#0 /home/public_html/vendor/magento/module-message-queue/Console/StartConsumerCommand.php(87): Magento\Framework\App\State->setAreaCode('global')
#1 /home/public_html/vendor/symfony/console/Command/Command.php(255): Magento\MessageQueue\Console\StartConsumerCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /home/public_html/generated/code/Magento/MessageQueue/Console/StartConsumerCommand/Proxy.php(143): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /home/public_html/vendor/symfony/console/Application.php(1009): Magento\MessageQueue\Console\StartConsumerCommand\Proxy->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /home/public_html/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Magento\MessageQueue\Console\StartConsumerCommand\Proxy), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /home/public_html/vendor/magento/framework/Console/Cli.php(115): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /home/public_html/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /home/public_html/bin/magento(23): Symfony\Component\Console\Application->run()

After searching further this file:

vendor/magento/module-message-queue/Console/StartConsumerCommand.php

In line 87 has this:
$this->appState->setAreaCode($areaCode ?? 'global');

And the whole function is:
     /**
     * @inheritdoc
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $consumerName = $input->getArgument(self::ARGUMENT_CONSUMER);
        $numberOfMessages = $input->getOption(self::OPTION_NUMBER_OF_MESSAGES);
        $batchSize = (int)$input->getOption(self::OPTION_BATCH_SIZE);
        $areaCode = $input->getOption(self::OPTION_AREACODE);

        if ($input->getOption(self::PID_FILE_PATH)) {
            $input->setOption(self::OPTION_SINGLE_THREAD, true);
        }

        $singleThread = $input->getOption(self::OPTION_SINGLE_THREAD);

        if ($singleThread && !$this->lockManager->lock(md5($consumerName),0)) { //phpcs:ignore
            $output->writeln('<error>Consumer with the same name is running</error>');
            return \Magento\Framework\Console\Cli::RETURN_FAILURE;
        }

        $this->appState->setAreaCode($areaCode ?? 'global');

        $consumer = $this->consumerFactory->get($consumerName, $batchSize);
        $consumer->process($numberOfMessages);
        if ($singleThread) {
            $this->lockManager->unlock(md5($consumerName)); //phpcs:ignore
        }

        return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
    }

Which seems fine because setAreaCode is in the right place, in execute not in _construction or config
Any ideas please?


texts: Store-Frontend: What is the first event that can be observed?

texts:
With a current, vanilla Magento 1.9.1 (CE) or 1.14.1/1.14.2 (EE) what is the first event that can be observed?

for the frontend (via /index.php; when the installer did run already)
for the frontend, when the installer did not yet run (if it makes a difference)
for the adminhtml
in cron
in webservice API 1
in webservice API 2

(this question might be looking for pure facts, but more interesting in the scope of Magento 1 is how to find these events in code)

In process of finding out more, I've collect some web-resources:

What's the earliest event Magento dispatches? (Q&A Jun 2011)
Magento Startup Events (Sep 2012; by Alan Storm)
What is the first event fired in Magento? - (Apr 2014; by E. Schrade)


texts: Product images does not show in collection

texts:
I am learning Magento. I am trying to list out my product images.

Firstly I tried with a single product and it worked:

<?php
$productModel = Mage::getModel('catalog/product');
$product_1 = $productModel->load(1);
?>

<a href="<?php echo $product_1->getProductUrl();?>"><img src="<?php echo $product_1->getImageUrl()?>" />

Then, I create a collection to show a list of pictures, but it showed all Magento logos, not product pictures. (I checked base, small and thumbnail image in admin already)

<?php
  $product_collection = Mage::getModel('catalog/product')->getCollection()->setOrder('name', 'asc');
?>

<?php
  foreach($product_collection as $_product)
       {
?>

<a href="<?php echo $_product->getProductUrl();?>"><img src="<?php echo $_product->getImageUrl()?>" />

<?php
        }
?>

Please help! Thank you!


texts:
I am currently making a Magento 2 store, and have two separate searches; the first one is just a normal query that searches the whole product database. However, it's the second one that I'm having issues with.

I want users to be able to select their animal from a dropdown list and then type in the problem they're experiencing (Horse, and Broken Leg) for example. This will then bring back products that have been selected to appear based off the search term. See image for a better example of what I need to do.

Currently I just have a placeholder CMS block in there that doesn't do anything.

Any advise on how I would go about this is greatly appreciated.


texts: Product prices including/excluding tax dependent customer session

texts:
In Magento Backend Configuration Settings > Tax > Price Display settings
"Display Product Prices In Catalog" is set to "Including and Excluding Tax".

In front-end ,
If customer is logged in and is assigned to 21% Tax Group, Products are shown as
Excl. Tax: 4,12 USD
Incl. Tax: 4,99 USD

If a customer is logged in and is assigned to Zero Tax Group, Products are shown as
Excl. Tax: 4,12 USD
Incl. Tax: 4,12 USD

I want to override the "Display Product Prices In Catalog" as

If a customer is logged in and has ZERO Tax% Group then

"Display Product Prices In Catalog" is set to "Excluding Tax". Means it will show one price on pages.

Else

"Display Product Prices In Catalog" is set to "Including and Excluding Tax". Which will display price like below:
Excl. Tax: 4,12 USD
Incl. Tax: 4,99 USD

I was planing to rewrite class where they are getting this config setting. But after searching on code I found that it has been used in so many place. I can achieve this by rewriting but is there any another approach that I can adopt.


texts: How to change a state placeholder from the cart and checkout shipping summary

texts:
I want to change state placeholder on the cart and checkout summary section.

In dropdown state/Province for showing "Please select state".

Instead of "Please select state" I want to display "Please select Province".

Thanks in advance.


texts: How to get value of customer custom attribute load by customer Id in phtml file in Magento2.3.0?

texts:
How to get the value of customer custom attribute load by customer Id in phtml file in Magento2.3.0?

$customer = $this->customerRepositoryInterface->getById($customerId);
$value = $customer->getCustomAttribute('business type)->getValue();

I have referred many links, but not able to achieve the value.
Any help would be appreciated.


texts: Price attribute not showing in admin panel in magento2

texts:
Product prices are shown in admin product grid correctly.

But, if I click on Edit button to edit the product, the price attribute is not shown there!

I have checked the price attribute and it is showing visible as No,

I am not sure if this is the reason or anything else. I also could not find any way to update those values after opening the attribute in admin.
Please let me know how I can view product prices to edit them from backend Admin.


texts: How to add extension attribute Magento 2

texts:
I'm trying to add an extension attribute to sales_order (\Magento\Sales\Api\Data\OrderInterface), and I have the following extension_attributes.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Sales\Api\Data\OrderInterface">
        <attribute code="order_status" type="string">
            <resources>
                <resource  ref="anonymous"/>
            </resources>
            <join reference_table="aytech_order_approval" reference_field="order_id" join_on_field="entity_id">
                <field>order_status</field>
            </join>
        </attribute>
    </extension_attributes>
</config>

I have already created the table aytech_order_approval with the fields order_id and order_status, and in my code I am trying to test getting the attribute like this (I have manually inserted a row into the table with order_id = 1 and order_status = 'approved':

$orders = $this->orderRepository->getList(\Magento\Framework\App\ObjectManager::getInstance()->create('Magento\Framework\Api\SearchCriteriaInterface'))->getItems();

echo $orders[1]->getExtensionAttributes()->getOrderStatus();

However, I keep getting null. What am I doing wrong? Also I've made sure to clear the var/generation, and the generated class does indeed have the getOrderStatus method


texts: Link my Magento 1.9 store to Parcelforce

texts:
I'm trying to link my store (Magento 1.9) to Parcelforce using the instruction provided by Parcelforce:

I've created a new user and a new role in System->Web Services->SOAP/XML-RPC - Users / SOAP/XML-RPC - Roles according to the instructions but when I want to "link my magento store" (see picture 1) I get the following error: "Oops! Something went a bit wrong. You shouldn't be here..." Did anyone managed to link their store to Parcelforce?


texts: Magento 2: Display tier prices in tabular format

texts:
How can we display tier prices in tabular format in product page ? Like below...

Qty    Price
1- 10  50
11-20  40
...


texts: Magento Customer created from code not login to the website

texts:
I am creating a customer from the code for a specific group code created a new record in the customer_entity table but when I try to login from the website its shows invalid username or password error while the customer created from the magento admin panel working fine and login to the website and redirect to the account page. check my code below:

public function editAction()
{

    $oenologist = Mage::getModel('tandem_oenologistuser/oenologist');

    if ($oenologistId = $this->getRequest()->getParam('id', false))
    {
        $oenologist->load($oenologistId);

    }

    if ($postData = $this->getRequest()->getPost('oenologistData'))
    {
        try {
            $oenologist->addData($postData);
            $oenologist->save();

            if(!$this->getRequest()->getParam('id'))
            {
                $name = $postData['name'];
                $email = $postData['email'];
                $password = '1234567';
                $groupId = 4;
                $websiteIdVal = 1;

                $websiteId = Mage::app()->getWebsite()->getId();
                $store = Mage::app()->getStore();

                $customer = Mage::getModel("customer/customer");
                $customer->setWebsiteId($websiteIdVal)
                         ->setStore($store)
                         ->setFirstname($name)
                         ->setEmail($email)
                         ->setPassword($password)
                         ->setGroupId($groupId)
                         ->setIsActive(1);

                try{
                    $customer->save();
                }
                catch (Exception $e) {
                    Zend_Debug::dump($e->getMessage());
                }

            }

            $this->_getSession()->addSuccess(
                    $this->__('The oenologist has been saved.')
                );

            return $this->_redirect(
                'tandem_oenologistuser_admin/oenologist/edit',
                array('id' => $oenologist->getId())
            );
        } catch (Exception $e) {
            Mage::logException($e);
            $this->_getSession()->addError($e->getMessage());
        }

    }

    Mage::register('current_oenologist', $oenologist);

    $oenologistEditBlock = $this->getLayout()->createBlock(
        'tandem_oenologistuser_adminhtml/oenologist_edit'
    );

    $this->loadLayout()
        ->_addContent($oenologistEditBlock)
        ->renderLayout();
}

Also, its add the website id to 0. I need to check the user on login for this specific group and redirect user to a custom controller action which is the user's custom profile page or is there any way i can customize the account page.

I have used the this link to create the users programmaticaly.


texts: Magento 2.1 Layered Navigation Category filter

texts:
Category filter is not displaying on layered navigation if cache is enabled. If i disable cache from backend it display category filter.

How to solve such issue ?

Any suggestion highly appreciated.


texts:
Previously i was using Magento 2.3.4 and upgraded to 2.3.5 using command line
I now see that there is also a 2.3.5-p1.
When 2.3.6 comes out later this month do i go straight from 2.3.5 to 2.3.6 or do i need to install 2.3.5-p1?


texts: html / code not working in static block to add price in a specific block?

texts:
I've tried multiple snippets of code to add an item price to a specific block without success.

On the example item page :

https://fixlcdscreens.com/default/catalog/product/view/id/10234/s/ACER-ASPIRE-V5-571-6868-15.6%22-Laptop-LCD-LED-Display-Screen/

I would like to add the product price in the right column block where I have put the text [INSERT PRICE HERE]

The following result happens from entering this code:

$this->getPriceHtml($_product, true);

The next snippet of code here results in the following :

<?php
    $productBlock = new Mage_Catalog_Block_Product;
    echo $productBlock->getPriceHtml($_product);
    ?>

Can someone please help me achieve this in what you believe is the simplest way.
For reference I am trying to add the price (not move the original) to the block
identifier : block_product_secondary_bottom


texts: M1 - How to set different tax class IDs on different instances of the same product in a cart based on custom options

texts:
I'm using the latest version of Magento 1.9 and I'm stuck trying to make a change. I checked all the related questions and couldn't find a solution. I figured I should see if someone can help before I start diving deeper into the internals of the framework.
The problem
I have products defined with custom options. Depending on which custom options are selected, the products may or may not need to be zero-rated for tax purposes. This means that based on what custom options are selected, I may or may not have to charge the user tax.
What I have tried
I'm trying to achieve my goal by swapping the tax class ID on the products in the cart. The way I did this is by setting up an Observer on the 'sales_quote_collect_totals_before' event. Inside my observer, I'm doing the following:
$quote = $observer->getQuote();
$cartItems = $quote->getAllVisibleItems();

foreach ($cartItems as $item) {
        $product = $item->getProduct();
        $customOptions = $product->getCustomOptions();

        if (<nasty custom option condition here>) {
                $product->setTaxClassId(2);
        } else {
                $product->setTaxClassId(0);
        }
}

I'm 90% of the way there, but there's one last issue I haven't been able to solve and that is when a customer buys 2 of the same product ID but with different custom options where one would need tax class ID 2 and the other would need tax class ID 0, all products get whatever tax class ID was last set for that product in the loop. That is, it seems that even if I set different class IDs on the different instances of the same product, it just uses the last one set for the general product ID and disregards what was set on the different product instances in the cart.
Does anyone know how to deal with this so that if the same customer adds the same product to their cart with different custom options set I can charge tax on one but not the other?
Any guidance would be greatly appreciated.


texts: Error when migrate data in data migration of magento 2

texts: I have this error, "Integrity constraint violation: 1062 Duplicate entry '3841' for key 'WISHLIST_CUSTOMER_ID'"


texts:
Heloo,

I want to get my all customer information i want to just export all table my table and install in other site but both version are not same new site is in 1.8.0.2 it can may be problematic ?and which table are related to customer information so i can be do my stuff


texts: What is the meta name for short description?

texts: In product fields auto generation, if i want short description instead of description should i use {{short.description}} instead of {{description}}. Please advise.


texts:
My theme (Claue of MGS) has been working very good.
I updated my Magento version to 2.3.1, after that it started to generated some few errors that i've been solved.

Now i have this problem: My chrome console is generating some error 500 with some JS Files, the others are working good. In the console with those files say:

jquery-storageapi.js:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)

lazyload.js:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)

ETC.. There are 14 different JS Files

I've tried a lot of things (deploy, permission, htaccess, etc) but still can't solve  it.

Someone have any idea of how to solve this?


texts: I got this error in my Magento admin panel login page and I don't know what's the issue.


texts: Block not appearing when giving custom type

texts:
I am trying to nest one block inside another block but the child block isn't showing when I set custom block type.

If I set both blocks as page/html then both blocks show fine:

<?xml version="1.0"?>
<layout version="0.1.0">
    <mobilemenu_index_index>
        <block type="page/html" name="root" output="toHtml" template="company_mobilemenu/test_page.phtml">
            <block type="page/html" name="company_mobilemmenu" template="company_mobilemenu/menu.phtml" />
        </block>
    </mobilemenu_index_index>
</layout>

But when I declare my custom block type so that I can use the custom block methods the block doesn't show.

<?xml version="1.0"?>
<layout version="0.1.0">
    <mobilemenu_index_index>
        <block type="page/html" name="root" output="toHtml" template="company_mobilemenu/test_page.phtml">
            <block type="mobilemenu/mobilemenublock" name="company_mobilemmenu" template="company_mobilemenu/menu.phtml" />
        </block>
    </mobilemenu_index_index>
</layout>

I have made this file: app/code/local/Company/MobileMenu/Block/MobileMenuBlock.php that has this contents:

<?php
class Company_MobileMenu_Block_MobileMenuBlock extends Mage_Core_Block_Template
{
    public function getNestedMenu()
    {
        return 'nested menu goes here';
    }
}

In my config.xml I register it like so:

<config>
    <modules>
        <Company_MobileMenu>
            <version>0.1.0</version>
        </Company_MobileMenu>
    </modules>
    <global>
        <blocks>
            <mobilemenu>
                <class>Company_MobileMenu_Block</class>
            </mobilemenu>
        </blocks>
    </global>
    <frontend>
        <routers>
            <mobilemenu>
                <use>standard</use>
                <args>
                    <module>Company_MobileMenu</module>
                    <frontName>mobilemenu</frontName>
                </args>
            </mobilemenu>
        </routers>
        <layout>
            <updates>
                <mobilemenu>
                    <file>company_mobilemenu.xml</file>
                </mobilemenu>
            </updates>
        </layout>
    </frontend>
</config>

What am I doing wrong with custom block registration?


texts:
When I turn on Full Page Cache in our Cluster users are able to see other users accounts.

We are using REDIS for Objects and FPC now (Separate instances)
I switch sessions to the database
We have 4 web heads and one database server
Magento Enterprise 1.13.1
Use SID on Frontend is set to NO
NOTE: I am using two different REDIS instances on two different ports. I XX'd out the url and the port number. The problem IS NOT with REDIS as we had this same problem with storing via FILES and with a different theme

I confirmed I was getting traffic to the FPC REDIS instance (We are using Object Rocket)

   <session_save><![CDATA[db]]></session_save>
    <cache>
       <backend><![CDATA[Mage_Cache_Backend_Redis]]></backend>
        <backend_options>
        <server><![CDATA[xxxxxxxxxxxxxxxxxx.rackspaceclouddb.com]]></server>
       <port><![CDATA[xxx12]]></port>
        <database><![CDATA[0]]></database>
        <password>LikeIWillPublishthePassword</password>
       <force_standalone><![CDATA[0]]></force_standalone>
       <automatic_cleaning_factor><![CDATA[0]]></automatic_cleaning_factor>
      <compress_data><![CDATA[1]]></compress_data>
      <compress_tags><![CDATA[1]]></compress_tags>
      <compress_threshold><![CDATA[20480]]></compress_threshold>
      <compression_lib><![CDATA[gzip]]></compression_lib>
     <lifetimelimit><![CDATA[43200]]></lifetimelimit>
    </backend_options>
    </cache>

Here is the added XML for the Enterprise FPC

<config>
    <global>
        <cache>
            <request_processors>
                <ee>Enterprise_PageCache_Model_Processor</ee>
            </request_processors>
            <frontend_options>
                <slab_size>1040000</slab_size>
            </frontend_options>
        </cache>
        <full_page_cache>
            <backend>Mage_Cache_Backend_Redis</backend>
            <backend_options>
            <server>7xxxxxxxxxxxxxxxxublb.rackspaceclouddb.com</server>
              <port>xxxxxxxx31</port>
              <persistent></persistent>
           <database>0</database>
               <password>SomePassword</password>
              <force_standalone>0</force_standalone>
              <connect_retries>1</connect_retries>
              <lifetimelimit>57600</lifetimelimit>
              <compress_data>0</compress_data>
            </backend_options>
         </full_page_cache>
    </global>
</config>

(I used the Inchoo Example for FPC)

Please let me know if I forgot something. The only thing that I could think of is if the web heads didn't get all the relevant XML after we published the new enterprise file

EDIT FROM CLIENT:

  I just first noticed on the home page but I was actually able to click
  on on /customer/account  and see the other person's recent orders


texts:
In the Sales Quote related files there is a FLAG called "inventory_processed" , but it is not available in database or anywhere else, actually what is the use of it ?

Source Code File location :

magento1.8\app\code\core\Mage\CatalogInventory\Model\Observer.php


texts: How to find out which getter methods are available

texts:
Often I'm working on a Magento template or block and while looking for a variable I try to use a getter method.

I use xDebug so normally I just go through the debugger and find what I need and guess the getter method, and usually it works. for example:

$this->getProduct()->getId();

But sometimes I can't find the getter method and use xDebug with PHPStorm to evaluate the expression for the value I need.

This usually gives me an expression like the below:

$program['type']->_data['special_url_key']

While this works it does not seem to be the best way to do it, I've tried using $program->getType(); but it doesn't work.

Am I missing something?  The example above is from a custom module, I thought with Magento's Magic Getter & Setter methods it should still work.  Although, looking at this module the block in question inherits or extends from Mage_Core_Block_Template


texts: How to add some text before price in product detail page in magento 2

texts:
How to add some text before price of product in product details page . for

  example:- price - $200.00.

Guys any suggestion from your end.Thanks


texts: How to check if duplicate meta title present for category in Magento2

texts:
I am generating a report for the categories with duplicate Meta titles.

I have loaded all the categories and checking conditions one by one like below with the direct MySQL queries.

$connection = $this->_resource->getConnection(\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION);
$categoryId = 4;// current categoryID
$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $_objectManager->create('Magento\Catalog\Model\Category')->load($categoryId);
$metaTitle = $category->getMetaTitle();
$query = "SELECT value FROM catalog_category_entity_varchar WHERE attribute_id='49' AND entity_id <> '".$categoryId."' and AND VALUE='".$metaTitle."'" ;
$Result = $connection->query($query);
$resultData = $Result->fetchAll();
if(count($resultData) > 0{
    $error = "Duplicate present";
}else{
    $error = "No Duplicate";
}

The above code working fine, but I like to modify the code by the standard. Is there any way to load category collection with filter and check the condition like above.

I am checking if the duplicate meta title presents apart from the selected category, needs to show the message.

Please, someone, suggest me how this can be achieved.


texts:
In my test extension I try create plugin for
Magento\Directory\Helper\Data::isRegionRequired method.
My frontend/di.xml contain:

<type name="Magento\Directory\Helper\Data">
    <plugin name="Sample_Test::isRegionRequired" type="Sample\Test\Plugin\Country\DirectoryHelperAfter" sortOrder="1" disabled="false"/>
</type>

And class Sample\Test\Plugin\Country\DirectoryHelperAfter contain

public function afterIsRegionRequired($subject, $result)
{
    exit('test');
    $myResult = true;
    return $myResult;
}

On the front I get next error on generating my plugin (before call plugin method):

Source class "\DirectoryHelperData" for "DirectoryHelperDataProxy" generation does not exist.

In /app/code/Magento/Directory/etc/di.xml I found:

<virtualType name="DirectoryHelperDataProxy" type="Magento\Directory\Helper\Data\Proxy">
    <arguments>
        <argument name="instanceName" xsi:type="string">Magento\Directory\Helper\Data</argument>
    </arguments>
</virtualType>
<type name="Magento\Directory\Model\ResourceModel\Country\Collection" shared="false">
    <arguments>
        <argument name="helperData" xsi:type="object">DirectoryHelperDataProxy</argument>
    </arguments>
</type>

My question is "How I can use plugin for class if it used in proxy"?


texts: Magento2 add view more colours link if color swatches are more then 5

texts:
Magento2 How can I add view more colors link if swatches are more then 5.
In short on the listing page or related products etc except product details page if color swatches of config products are more then 5 then add view more colors link
It should display the first 5 watchers & then add view more colors links & redirect to details page


texts:
I need all product information like in default magento theme but without tabs.
And i need to order of product details like this:
first: additional information
below it a separator line or box and:
second: description
below it a line and:
Reviews
I use magento 1.9.1.0 with rwd theme


texts: Add third party tracking code to sales_quote_remove_item event

texts:
I am working on the process of integrating third party tracking code into Magento 1.9.3.3 and managed to add tracking for customer registration, Add to cart, Successful checkout.

But Remove an item from cart is not been able to trigger the tracking code. Please have a look on my code and let me know valuable suggestions.

My config.xml code:

<events>
    <sales_quote_remove_item>
        <observers>
            <sales_quote_remove_item_smartech>
                <class>smartech/observer</class>
                    <method>removeFromCartScript</method>
                </sales_quote_remove_item_smartech>
         </observers>
    </sales_quote_remove_item>
</events>

My observer code:

public function removeFromCartScript ($observer) {
     $item = $observer->getEvent()->getQuoteItem();
     $p_url = $item->getUrl();
     $p_id = $item->getId();
     $p_name = $item->getName();
     $p_qty = $item->getQty();
     $p_price = $item->getFinalPrice();
     Mage::getSingleton('core/session')->setProductFromShoppingCart('remove_from_cart');
     $removeProductVariable = Mage::getSingleton('core/session')->getProductFromShoppingCart();
     Mage::log("Session Variable: ".$removeProductVariable, null, "smartech.log");
}

and my PHTML code:

<?php
    $removeProductVariable = Mage::getModel('core/session')->getProductFromCart();
    if($removeProductVariable === 'remove_from_cart') {
    echo "Remove from cart called";
    ?>
     <script>
     //Following script need to be triggered with deleted product details respectively
     smartech('dispatch', 5, {
            "s^prurl": "<?php echo $p_url ?>",
            "i^prid": "<?php echo $p_id ?>",
            "s^prname": "<?php echo $p_name ?>",
            "i^prqt": "<?php echo $p_qty ?>",
            "f^prprice": "<?php echo number_format((float)$p_price, 2, '.', '')?>"
        });
    </script>
    <?php
    // Clear add_to_cart session variable:
    Mage::getModel('core/session')->unsProductFromCart();
    }
?>


texts: Magento 2: How to move additional product attributes to Details tab?

texts:
In Blank theme, attributes other than description display under More information tab.
In my theme, I want to move attributes from More Information to Details tab.

  Example:
  Details tab contains description. More information tab contains color and brand.

How to move only color attribute from More information to Details tab?

How to move both color and brand attributes and remove More information tab?


texts: Magento2: Reset password custom email template

texts:
I have created new custom Reset password email template to overwrite default reset password from the Admin->Communications->Email Templates.

Now I have change configuration from the STORES->Configurations->Customers->Customer Configuration->Password Option->Reset Password Template, I changed with my custom email template.

And checking on frontend to see changes, But my custom email template not call on reset password email.

I have flush pub/static also var/ also run magento deploay, clear n all.

But still my custom email not call.


texts: How to move place order button to next page

texts:
I want to move the place order button of payment section to next part. How can i do it.

Here the continue to paypal button need to go on summary page.


texts: I'm very confused. I exported all my products and saw I have the same product in default store and "no store", I mean, my catalog have the same products twice. Not sure what it causes and how this happened but one of the problems is that I cannot see the real url_key for many items, inside the product page in backend I need to switch store view and I believe sitemap is not sending the correct url_key for items. Is this scenario normal? Thank you.


texts: Magento join customer collection with customer address

texts:
In Magento i want to search the customer with the address(state,city,zipcode), can you explain to me how to the achieve that.

The customer collection query

$collection = Mage::getModel('customer/customer')->getCollection();
$collection->addAttributeToSelect(array('userid','firstname','lastname','profile_image','specialist','latitude','free_consult','longitude'));
$collection->addAttributeToFilter('group_id',Federallawyer_Customer_Helper_Data::LAWYER);

also my shipping and billing address is same.


texts:
Create a new api for social login, we send access token to Facebook,
based on the token read the customer details from  Facebook and create a customer account. In response should be a username and password.


texts: I have created module but checkbox not working properly in magento?

texts:
have create module all filed work properly but checkbox edit time not checked automatically.

$fieldset->addField('hobbies[]', 'checkboxes', array(
            'label' => Mage::helper('contactform')->__('Checkboxs'),
            'name' => 'hobbies[]',
            'values' => array(
                array('value' => 'read', 'label' => 'read'),
                array('value' => 'write', 'label' => 'write'),
                array('value' => 'games', 'label' => 'games'),
            ),
            'value' => array('read', 'games'),
             'disabled' => array('1'),
        ));


texts: Contact page disappear after save category

texts:
I have a online store in Magento 2.2.3 with i18n stores. In menu i create new Catalog Category with name: Contacts, Contactos and Contacts in order EN, PT and FR. I configure this category to redirect for url key contact.
I use rokanthemes / bs_cogito_1 and i have one xml with name contact_inxex_index.html in this file i make a reference to personalized block contact-info.
<referenceContainer name="col.right.sidebar">
    <container name="contact.info" as="contact_info" htmlTag="div" htmlClass="contact-info">
        <block class="Magento\Cms\Block\Block" name="contact-info">
           <arguments>
                <argument name="block_id" xsi:type="string">contact-info</argument>
           </arguments>
        </block>
    </container>
</referenceContainer>

I have these blocks for three languages. Check bellow.

And in configuration path Stores > Configuration > Catalog > Catalog > Search engine optimizations i removed .html from url, clear cache and flush cache, reindex all and rebuild static content.

configuration path Stores > Configuration > General > Contacts i enable Contact us.

this already worked, but only for the portuguese language in the url /contact, french and portuguese directed to contacts.html, when I edited the URL Key to contact the menus of all language direct to /contact, but all content is gone.
thought that the contact stop in the url was reserved and always pointed to the xml file contact_index_index.
Any idea?


texts:
For instance, say I have the role "category manager" and the role "product manager", but then there are some users which need to have access to both categories and products. Ideally, I would like to be able to say that user X has the permissions from both roles, rather than having to create a third "category and product manager" role.

In the backend, assigning a user to a role is done by a radio button, which seems to imply that a user can only have one role. But, the role management backend allows me to select any users to add to the role, and I don't see anything to say that adding a user to the role will remove the user from their current role.

So, can users be added to more than one role?

If it is not possible through the backend, can I assign users to more than one role via the database? i.e. if I add to the database links connecting a user to more than one row, will it apply all of the permissions, or will it only use one of them?


texts:
I just upgrade from Mag CE 1.5 to 1.7.0.2 and heck, fall in to troubles in a row..fixed a few but stuck at top menu..

app/design/frontend/default/tenniskarma/template/page/html/topmenu.phtml contains

* @see Mage_Page_Block_Html_Topmenu
 */
?>
<?php $_menu = $this->getHtml('level-top') ?>

<?php echo var_dump($_menu) ?>
<?php if($_menu ==  ""): ?>

    <?php echo 'test test test' ?>
        <?php echo $_menu ?>

<?php endif ?>

and istead of menu, it prints out string "" and test test test, meaning that I am not getting $menu back...

see this

  MY menu does show at all, can somebody tell me whats happening with
  me?

my page.xml holds

 <block type="page/html_header" name="header" as="header">
                <block type="page/template_links" name="top.links" as="accountLinks"/>
                <block type="page/switch" name="store_language" as="store_language" template="page/switch/languages.phtml"/>
                <block type="core/text_list" name="top.menu" as="topMenu" translate="label">
                    Navigation Bar
                    <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
                </block>
                <block type="page/html_wrapper" name="top.container" as="topContainer" translate="label">
                    Page Header
                    <action method="setElementClass"><value>top-container</value></action>
                </block>
</block>

for menu inclusion..

please help me..I am near to striking my head with wall


texts:
Good Morning,

I'm trying to achieve the following: customers can choose While register for new account  between two options. First option is one in which fix amount of fee is added to access or subscribe for download section(category) .In the second option no fee or don't subscribe for download section.


texts:
I want to override page title of catalog pages to include selected attributes and subcategories.

e.g. "Shoes - Adidas - Red | Brand"

What observer or model should I override to modify the page title? And how can I get current category?

Thank you very much!


texts: Multi Store view - product name for each store

texts:
I'm using Magento 1.9.0.1

I have a store in English, I want to have the same store (same categories and products) just translated to Spanish.

I used this tutorial to achive this: Ref.

I created another store view in my store. Under System->Configuration->General->General->Locale Options->Locale for the Spanish store view, I un-checked the "Use Website" and selected "Spanish".

Under Catalog->Manage Categories I changed the store view to Spanish and I translated the Name of each category to Spanish.

Under Catalog->Manage Products I changed the store view to Spanish and I translated the Name of each product to Spanish.

Now, In the frontend, when I switched the the Spanish store view (using the language switcher), I can see my store in Spanish, including the categories and products.

But when I add a product (that I can see in Spanish in the category page) to the shopping cart and goes to the shopping cart, I can see the product, but is name is in English (although I'm in the Spanish store view). Also under Order Review in the Checkout page it's in English.

What can be the problem?
How can I fix it?

Thanks

EDIT:
I upgraded my store to 1.9.2.3 and it doesn't help.


texts: How to check if customer password is match

texts: I have a string variable, and i want to check if this string variable match with the current customer password, is there a way to do this?


texts: Grunt less:theme fails @media-common is undefined

texts:
I am using a theme that I have created based on a third party theme 'Optimus' and I am trying to use Grunt to compile the LESS.

However, when I run grunt less:theme it fails with the following error:

>> NameError: variable @media-common is undefined in pub/static/frontend/vendor/theme/en_GB/css/source/_optimus-lib.less on line 6, column 9:
>> 5
>> 6 & when (@media-common = true) {
>> 7
Warning: Error compiling pub/static/frontend/vendor/theme/en_GB/css/_optimus.less Use --force to continue.

Aborted due to warnings.

Grunt works perfectly on the ultimate parent theme (magento/blank) but it also fails with the same error on the Optimus theme.

Clearly it isn't finding @media-common but searching around this seems to be a Magento variable that defines the type of device (mobile or desktop).

UPDATE:

I think I have resolved this but I would appreciate any feedback to confirm that this is the right thing to do.

I read this post on StackExchange which suggested adding this code:

@import (reference) "../source/lib/variables/_responsive.less";
@import (reference) "../source/lib/_responsive.less";

(I think my file structure is the same as in the post)

Having done this grunt less:theme seems to work but I want to be sure this is correct.


texts:
<block type="customer/account_dashboard_mydesigns" name="customer_account_dashboard_mydesigns" as="mydesigns"   template="customer/mydesigns.phtml"/>

Above code does not load mydesign.phtml file. But It loads when I change as="mydesigns" to as="info". As I change so, magento fails to load info.phtml.

<block type="customer/account_dashboard_info" name="customer_account_dashboard_info" as="info" template="customer/account/dashboard/info.phtml"/>


texts: Magento 2.1: grid list in admin: data displayed but still the "loading" animation

texts:
I created three grids in the back end of a Magento 2.1 admin. The two first a working properly, but there is a little problem with the last one: while the data are displayed in the list, there is still the loading animation on the front overlay.

Note 1: With Chrome I can hide this overlay and I can normaly use the grid.

Note 2: The two working grids have very few lines (37 and 110 respectively) while the problematic one has ~38000 lines. Even with the pagination, I have this problem.