texts: Weird issue using addFieldToFilter via a helper method

texts:
I've got a really strange situation ! I'm new to magento, but this is looking really weird, hope anyone can help me with that !

Here is the controller action I have :

public function searchSpecialOpeningsAction(){
            $shops = Mage::getModel("shops/shops")
                ->getCollection()
                ->addFieldToFilter("status", 'open')
                ->addFieldToFilter('type', array('eq' => 'ok'))
                ->addFieldToFilter('opening_special', array('neq' => ''))
                ->setOrder('name', 'asc');
            $shops2 = Mage::helper('shops')->getSpecialOpenings();

//            Mage::log('before_shops1-'.$shops->count());
//            Mage::log('before_shops2-'.$shops2->count());

            $dates = Mage::helper('shops')->getSpecialOpeningsDates();
            $shops->addFieldToFilter(array('postcode','city'), array(array("like" => trim($search)."%"), array("like" => "%".trim($search)."%")));
            $shops2->addFieldToFilter(array('postcode','city'), array(array("like" => trim($search)."%"), array("like" => "%".trim($search)."%")));

            Mage::log('sql1-'.$shops->getSelect()->__toString());
            Mage::log('sql2-'.$shops->getSelect()->__toString());

            Mage::log('after_shops1-'.$shops->count());
            Mage::log('after_shops2-'.$shops2->count());
}

And here is Mage::helper('shops')->getSpecialOpeningsDates();

public function getSpecialOpenings($sort_field = 'name', $sort_dir = 'ASC')
    {
        $collection = Mage::getModel("shops/shops")
            ->getCollection()
            ->addFieldToFilter("status", "open")
            ->addFieldToFilter('type', array('eq' => 'ok'))
            ->addFieldToFilter('opening_special', array('neq' => ''))
            ->setOrder($sort_field, $sort_dir);
        ;

        if(count($collection) > 0) {
            return $collection;
        }
        return 0;
    }

As you can see $shops in the action is just the content of getSpecialOpenings method from the helper.
When $search = "06", "after_shop" should be equal to 0 but here is the output :

2014-04-03T15:04:17+00:00 DEBUG (7): sql1-SELECT `main_table`.* FROM `shops` AS `main_table` WHERE (status = 'open') AND (type = 'ok') AND (opening_special != '') AND ((postcode LIKE '06%') OR (city LIKE '%06%'))
2014-04-03T15:04:17+00:00 DEBUG (7): sql2-SELECT `main_table`.* FROM `shops` AS `main_table` WHERE (status = 'open') AND (type = 'ok') AND (opening_special != '') AND ((postcode LIKE '06%') OR (city LIKE '%06%')) ORDER BY name ASC
2014-04-03T15:04:17+00:00 DEBUG (7): after_shops1-0
2014-04-03T15:04:17+00:00 DEBUG (7): after_shops2-2

Why the order clause is present on sql2 but not on sql1 ?
Why when I use my method "after_shop" = 2 and when I use the content of my method "after_shop" = 0 !?

I've got also another really weird issue when i decomment the 2 log lines, watch the input :

2014-04-03T15:04:05+00:00 DEBUG (7): before_shops1-2
2014-04-03T15:04:05+00:00 DEBUG (7): before_shops2-2
2014-04-03T15:04:05+00:00 DEBUG (7): sql1-SELECT `main_table`.* FROM `shops` AS `main_table` WHERE (status = 'open') AND (type = 'ok') AND (opening_special != '') AND ((postcode LIKE '06%') OR (city LIKE '%06%')) ORDER BY name ASC
2014-04-03T15:04:05+00:00 DEBUG (7): sql2-SELECT `main_table`.* FROM `shops` AS `main_table` WHERE (status = 'open') AND (type = 'ok') AND (opening_special != '') AND ((postcode LIKE '06%') OR (city LIKE '%06%')) ORDER BY name ASC
2014-04-03T15:04:05+00:00 DEBUG (7): after_shops1-2
2014-04-03T15:04:05+00:00 DEBUG (7): after_shops2-2

"after_shops1" value becomes 0, but i've just decommented 2 log lines, why it would affect the code !? And you can see that the order clause is now present on both select.

I guess the order clause is affecting the result but first why ? and why in one case it is addded to the select and not on the other case ? plus why decommenting log lines are affecting the execution ?

Thanks for any help !


texts: Magento2 - Unable to Manage Options (Values of Your Attribute) in Product Attribute

texts:
I am baffled. I cannot add to, or reorder existing product attributes. (Note: This is a site I inherited, so I didn't build it.).

I have max_input_vars set at 20000, up from 10000. Nothing I try works. It simply doesn't save in the database, and I get no error messages.

Using Magento EE 2.3.4, but the issue is also on 2.3.1 as well.


texts:
I have created a custom controller that should show a list of products in the account area.
For this purpose I added a custom block that extends the ListProduct block via layout. The basic idea is to reuse the category handling as much as possible. I only need to tell this block what category to display.
So I was browsing through the code and found a hint that seems to give me the control over which category's products to display:
private function initializeProductCollection()
{
    $layer = $this->getLayer();
    /* @var $layer Layer */
    if ($this->getShowRootCategory()) {
        $this->setCategoryId($this->_storeManager->getStore()->getRootCategoryId());
    }

    // if this is a product view page
    if ($this->_coreRegistry->registry('product')) {
        // get collection of categories this product is associated with
        $categories = $this->_coreRegistry->registry('product')
            ->getCategoryCollection()->setPage(1, 1)
            ->load();
        // if the product is associated with any category
        if ($categories->count()) {
            // show products from this category
            $this->setCategoryId(current($categories->getIterator())->getId());
        }
    }

    $origCategory = null;
    if ($this->getCategoryId()) {
        try {
            $category = $this->categoryRepository->get($this->getCategoryId());
        } catch (NoSuchEntityException $e) {
            $category = null;
        }

        if ($category) {
            $origCategory = $layer->getCurrentCategory();
            $layer->setCurrentCategory($category);
        }
    }
    $collection = $layer->getProductCollection();

    $this->prepareSortableFieldsByCategory($layer->getCurrentCategory());

    if ($origCategory) {
        $layer->setCurrentCategory($origCategory);
    }

    $this->_eventManager->dispatch(
        'catalog_block_product_list_collection',
        ['collection' => $collection]
    );

    return $collection;
}

As I read it any category can be forced to show by just implementing the function getCategoryId() which returns the category of my choosing. I did that and checked if it returns the proper category id, which it does.
This is my custom block:
namespace My\Module\Block\Account;

class Products extends \Magento\Catalog\Block\Product\ListProduct
{
    /**
     * @return mixed
     */
    public function getCategoryId()
    {
        // this returns the desired category id
        return $this->_scopeConfig->getValue('my_module/general/category_bonus');
    }
}

Still the returned collection does not work. It just returns ALL products in the catalog.
Any idea what I got wrong here?
Thank you


texts: How can I disable the View as grid/list buttons in Magento 2.1?

texts:
I am working on a Magento 2.1.7 shop.

On my category pages, I need to have the grid view only, without giving the customer the possibility of switching to the list view.

What is the easiest and/or the most appropriate way to do this?


texts:
in the setup of magento i have i have set backorders to be on but i only needed them on so that out of stock items could be added to the cart from an order editor

i've been making changes to magento so that insted of checking if a product is in stock or not it's checking if the qty if 0 as that is a clear sign that a product is out of stock in my setup

in Mage_Catalog_Model_Product i have changed isSalable to false and while every item that i go into says it's out of stock, they still show up in the catalog and when i do a search

so how does magento check if a configure/grouped product is out of stock in the catalog/search cause it's obviously not from using isSalable


texts: How to override "add to cart" button in wishlist using magento custom module?

texts:
How to override template file -

vendor/magento/module-wishlist/view/frontend/templates/item/column/cart.phtml

using custom module?


texts: Custom design for Category with exception

texts:
I have 4 themes (desktop, desktop_child, mobile, mobile_child).

I currently set desktop for default (desktop) theme (System -> Configuration -> General -> Design -> Themes -> Default) and an exception: mobile for default (mobile) theme.

I set desktop_child as custom design for a specific category (eg: Clothing). Things work fine.

Now, I expect that when I visit Clothing category on smartphone, mobile_child will be applied.

How to do that?

Thank you.


texts: Magento 2 : How to forward controller defaultNoRoute?

texts:
I create a custom module in which if data is found the template is shown else I need to show default 404-page content & set the status to 404.

I have tried below code to set the status to 404 without changing the URL(i.e, not redirecting to noroute)

$resultPage->setStatusHeader(404, '1.1', 'Page Not Found');
$resultPage->setHeader('Status', '404 Page Not Found');

But I'm unable to show the default 404 error page content.

I have tried below code to forward the controller to default no route page, but it's not working for me.

$this->_forward('defaultNoRoute');

Can anyone help me out from this? Thanks in advance.


texts: How to sort admin grid filter elements in Magento 2?

texts:
Using Magento 2.2.5 - I have an install with many stores - ~30. In the sales order grid, the filter for 'Purchase Point' lists all the stores, but in the order they were created. Is it possible to sort the filter list by the store name rather than store_id?

In vendor/magento/module-sales/view/ui-component/sales_order_grid.xml I see the filter defined as:

<filterSelect name="store_id" provider="${ $.parentName }">
   <settings>
       <options class="Magento\Store\Ui\Component\Listing\Column\Store\Options"/>

All Store Views

       Purchase Point
       <dataScope>store_id</dataScope>
       <imports>
          <link name="visible">ns = ${ $.ns }, componentType = column, index = ${ $.index }:visible</link>
       </imports>
   </settings>

What is the ${ $.parentName } in the provider? Is there a way to sort the components data with a setting? (is there a way to default this sorting across all places where the stores select is visible, or does it need to be handled for each UI_Component?)


texts: I try to call a custom phtml in category backend

texts:
I created a new phtl file in vendor/magento/module-catalog/view/fronted/templates/prodcut/list_rent.phtml and i want to call it from my category backend/layout updates but it dosen't work.
Now that category take the list.phtml from exact same path as list_rent.phtml, and a want to change list.phtml with list_rent.phtml

Can anyone have a idea?


texts: Magento 2 : How to Override Checkout Process

texts:
I have created an observer event in custom extension. I want to check something before order will be created. When condition not true then checkout process schould be break and go back to cart. Here is my code

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="sales_order_place_before">
       <observer name="company_module_observer_check" instance="Company\Module\Observer\Check" />
   </event>
</config>

and

class Check implements \Magento\Framework\Event\ObserverInterface
{

    /** @var  LoggerInterface */
    protected $logger;
    /**
     *
     * @param LoggerInterface $logger
     * @param array $data
     */
    public function __construct(LoggerInterface $logger) {
        $this->logger = $logger;
    }
    public function execute(\Magento\Framework\Event\Observer $observer)
    {

       //TOTO i want do things like below
        $condition // condition will be got from an API service
        if($condition){
             return $this;
        }else{
            return // Go back to cart
        }
    }
}

Can somebody help me?


texts: How do you change the breakpoint at which mobile menu appears in Magento 2?


texts:
I need my extension to throw an exception which includes a stack trace.

I tried Mage::throwException('message') but nothing is logged in var/log/exception.log nor at var/log/system.log nor in the vhost error log

I am calling the line from a helper class.


texts:
I have a product object and I need to get product URL of it that will include all its categories e.g. - http://example.com/category/subcategory/product_name

I've managed to find a way that will return to me such type of url. Here is is:

// $product - is defined

$categoryIds = $product->getCategoryIds();
$cats_collection = Mage::getModel('catalog/category')->getCollection()
        ->addAttributeToFilter('entity_id', $categoryIds)
        ->addAttributeToFilter('is_active', 1);
// I filter the categories by their level, so they always go cat/sub-cat/sub-sub-cat
$cats_collection->getSelect()->order('level DESC')->limit(1);

// I get a product URL that looks like http://example.com/product_name
$productURL = $product->getProductUrl();

// I get just product_name part
$productSlug = substr( $productURL, strrpos( $productURL, '/' )+1 );

// http://example.com/cat/sub-cat/sub-sub-cat
$categoryUrl = $cats_collection->getFirstItem()->getUrl();

// Final result: http://example.com/cat/sub-cat/sub-sub-cat/product_name
echo  $categoryUrl . '/' . $productSlug;

But my guts are telling me that this can be done simpler.

Is there any simpler way of getting such URL? Or is it possible to optimize some part of my code?

Thank you.


texts: Not showing order tab at customer details page in admin panel

texts:
Few tab like (Orders, Product Reviews, Billing Agreements, Newsletter, Wish List, etc...) are not showing in customer details page in admin panel after magento2 upgrade.

All above tab's are showing at frontend side but not showing in admin panel.


texts: Magento 2 : how can we use of setup:db-schema:upgrade?

texts: Can we add or update the database schema and if yes, so can anyone give example?


texts: How to place Widgets (footer links) side by side in magento2?

texts:
I created 3 widgets, each has one static block with links for the footer.
Now the "position" is kinda messed up, and i want to place each "link block"
side by side.

Any idea how to do that?

Thanks alot and have a nice day / evening!


texts: Magento 2.3 - To add the google captcha in cash on delivery payment method on payment step before place order button

texts:
I need to show google captcha on particular cash on delivery payment method on payment step before placing an order as a part of manual verification of humans.

For checkout i'm using Magento standard checkout process not any third party extensions onestepcheckout.


texts: Can you export a configurable product .csv and reuse it? Not working for me

texts:
Another attempt to solve this, but it did not work.

Is it possible, or not, to export a configurable product .csv and reuse it?

I downloaded a different configurable product that had the exact same info except for a slight sku # change and one word is different in the product title, description, etc. I replaced everything necessary and triple-checked my work.

It still gives the same error.

I have hundreds of each type of configurable product and want to use spreadsheets instead of doing this one at a time. Thanks in advance.

Using Magento (version 1.9) System - Import.

I created a configurable product of four sizes using my attribute set (chains)and downloaded it to use as a template.

I replaced one section at a time and checked the data with magento import.

The .csv was accepted until I replaced the super products sku's. I have no changes to the super products such as prices, etc.

When I check data, I get:

Product with specified super products SKU not found: : 1, 2, 3, 4


texts: How can I remove all products images for a specific store/website?

texts:
When I import CSV file for products I got every time duplicate products images.
I must import the CSV file every time with products images value for all products there for I got duplicate products images.

Now, I must remove all products images for a specific store/website before import same products with CSV.


texts: Display tax calculation on Cart Index page Magento 2

texts: How do I go about adding the tax calculation on the summary page? Currently it only shows the tax when you enter a full address but is there anyway I can calculate at least an estimate tax based on zip code? If so, how do I implement this?


texts: Choosing product attributes in frontend without order

texts: When a customer wants to buy a T-Shirt he has to choose the color first and then he can choose the size. But I want him to do this also the other way around. So that he can choose the color or size first. At now, he is not able to choose the size before he chose the color.


texts: Security Patch 7405 Pulling API 500 internal error logs

texts:
I've spent hours looking over the internet and cannot figure out where is the issue with the changed PHP lines. Problems only started after successfully updating patch 7405. Website and all other functionality runs fine, we are using an api to pull order to another shipping software resulting in 500 internal error at every pull. I Can't figure out what's going wrong... Looking at the log I get the following errors:

[error] 493#0: *746 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Class 'Varien_File_Csv' not found in /app/code/core/Mage/Core/Model/Translate.php on line 313" while reading response header from upstream
[error] 493#0: *748 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Class 'Varien_File_Csv' not found in /app/code/core/Mage/Core/Model/Translate.php on line 313" while reading response header from upstream
[error] 493#0: *750 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Class 'Varien_File_Csv' not found in /app/code/core/Mage/Core/Model/Translate.php on line 313" while reading response header from upstream
[error] 493#0: *853 access forbidden by rule, client: request: "POST /app/etc/local.xml HTTP/1.1",
[error] 493#0: *929 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /web/lib/Varien/File/Csv.php on line 93" while reading response header from upstream,
[error] 493#0: *1189 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /web/lib/Varien/File/Csv.php on line 93" while reading response header from
[error] 477#0: *115 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /web/app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 684"

thanks for helping


texts: Set Pagination with Toolbar in frontend .html file

texts: I don't have any idea to put pagination. i have to display all order commission details. this is first time to me to create front end so no idea how to create. what are the files needed. pagination with toolbar.


texts: Magento 2: Customer is_active field not working?

texts:
I'm trying to use this field that is in the table customer_entity but seems it's doing nothing. I change this value in the ddbb but the customer still can login, place orders, etc.

Is this a bug? Am I missing something?

I saw this similar question: What does the Customer is_active flag do?, but it's on Magento1, so I decided to open this for M2. Don't know if it's still the same or they changed something about this.


texts: Add extension attribute in Product Custom Option Value

texts:
I would like add extension_attribute field in ProductCustomOptionValue entity.

My idea is to use extension_attribute.xml to create news attributes to this entity liking with a new table.


texts: googlebot crawls PLP pages and SERVER is down due to hugh CPU load

texts: We are seeing very HIGH cpu load on our magento2.2.3 cloud and the site is getting down. This happens when googlebot crawls the category pages. LHN is there. Also we have infinite Ajax scroll feature implemented.


texts: How to generate shopping cart rules programmatically?

texts:
I am trying to generate shopping cart rule dynamically for particular product my matching the sku in condition. Rule is getting generated but the condition part is not setting up.
my code :

        $data = array(
        'product_ids' => null,
        'name' => sprintf('discount', Mage::getSingleton('customer/session')->getCustomerId()),
        'description' => 'Auto generated',
        'is_active' => 1,
        'website_ids' => array(1),
        'customer_group_ids' => array(1),
        'coupon_type' => 2,
        'coupon_code' => Mage::helper('core')->getRandomString(16),
        'uses_per_coupon' => 1,
        'uses_per_customer' => 1,
        'from_date' => null,
        'to_date' => null,
        'sort_order' => null,
        'is_rss' => 1,
        'rule' => array(
        'conditions' => array(
            array(
            'type' => 'salesrule/rule_condition_product_found',
            'attribute' => 'sku',
            'operator' => '==',
            'value' => 'tp'
            )
        )
        ),
        'simple_action' => 'by_fixed',
        'discount_amount' => 30,
        'discount_qty' => 0,
        'discount_step' => null,
        'apply_to_shipping' => 0,
        'simple_free_shipping' => 0,
         'stop_rules_processing' => 0,
        'rule' => array(
        'actions' => array(
            array(
            'type' => 'salesrule/rule_condition_product_found',
            'attribute' => 'sku',
            'operator' => '==',
            'value' => 'tp'
            )
        )
        ),
        'store_labels' => array('30% Summer discount')
    );
          $model = Mage::getModel('salesrule/rule');
          $data = $this->_filterDates($data, array('from_date', 'to_date'));
          $validateResult = $model->validateData(new Varien_Object($data));
           if ($validateResult == true) {
           if (isset($data['simple_action']) && $data['simple_action'] == 'by_percent'
            && isset($data['discount_amount'])) {
        $data['discount_amount'] = min(100, $data['discount_amount']);
        }
        if (isset($data['rule']['conditions'])) {
        $data['conditions'] = $data['rule']['conditions'];
        }
        if (isset($data['rule']['actions'])) {
        $data['actions'] = $data['rule']['actions'];
        }
        unset($data['rule']);
        $model->loadPost($data);
        $model->save();
    }


texts:
I am trying to get all the reviews for current product detail page which are 5 star rated.How are  we suppose to  filter ?

 $storeId = Mage::app()->getStore()->getId();
            $_product = $this->product();
             $summaryData = Mage::getModel('review/review_summary')
                    ->setStoreId($storeId)
                    ->load($_product->getId());


texts: Di compile error while installing Magento 2.3.5

texts:
Hi i am installing Magento 2.3.5 but getting error on di:compile command
MiBErrors during compilation:
Dotdigitalgroup\Email\Model\Apiconnector\EngagementCloudAddressBookApi
Incompatible argument type: Required type: \Dotdigitalgroup\Email\Logger\Logger. Actual type: \Dotdigitalgroup\Email\Helper\File; File:
/home/stylekulcom/public_html/vendor/dotmailer/dotmailer-magento2-

extension/Model/Apiconnector/EngagementCloudAddressBookApi.php

Total Errors Count: 1


texts:
Jimit\Categorytree\registration.php

<?php
    \Magento\Framework\Component\ComponentRegistrar::register(
        \Magento\Framework\Component\ComponentRegistrar::MODULE,
        'Jimit_Categorytree',
        __DIR__
    );

Jimit\Categorytree\etc\module.xml

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

Jimit\Categorytree\etc\frontend\routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="categorytree" frontName="categorytree">
            <module name="Jimit_Categorytree" />
        </route>
    </router>
</config>

Jimit\Categorytree\Controller\Index\Index.php

<?php

namespace Jimit\Categorytree\Controller\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\App\ResponseInterface;
use Magento\Framework\View\Result\PageFactory;

class Index extends Action {

    private $pageFactory;

    public function __construct(
        Context $context,
        PageFactory $pageFactory
    )
    {
        parent::__construct($context);
        $this->pageFactory = $pageFactory;
    }

    public function execute()
    {
        $page = $this->pageFactory->create();
        return $page;
    }
}

Jimit\Categorytree\Block\Categorytree.php

<?php

namespace Jimit\Categorytree\Block;

use Magento\Framework\View\Element\Template;

class Categorytree extends Template
{
    public function getText() {
        return "Category";
    }
}

Jimit\Categorytree\view\frontend\layout\categorytree_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Jimit\Categorytree\Block\Categorytree" name="categorytree" template="Jimit_Categorytree::categorytree.phtml" />
        </referenceContainer>
    </body>
</page>

Jimit\Categorytree\view\frontend\templates\categorytree.phtml

JIMIT Test

URL:
https://localhost/Magento-CE-2_3_3/categorytree/index/index

When I run URL in browser white blank screen showing, not getting any error while commands and also not in logs.

Can anyone help me to find an issue?

Note: I have debugged, both methods from the controller are calling.

Thanks


texts: Is there a way I can generate are report showing all the product prices, showing what the normal RRP is, and if there is a sale price on an item what the sale price is?


texts: Magento indexing causing website downtime

texts:
Magento is creating 700 + connections leading to database breakdown whenever cache is flushed or indexing is triggered. Production site remain down for 20 mins till all connections clears. All connections firing same query. And remain in state creating sort index. Using very high database configuration. DB on Amazon rds.Any help is appreciated. This is breaking our production site.

Show full pprocesslist getting below query being fired 600 times and is struck at creating sort index.

  SELECT main_table.entity_id, main_table.name, main_table.path, main_table.is_active, main_table.is_anchor, url_rewrite.request_path FROM catalog_category_flat_store_1 AS main_table LEFT JOIN core_url_rewrite AS url_rewrite ON url_rewrite.category_id=main_table.entity_id AND url_rewrite.is_system=1 AND url_rewrite.product_id IS NULL AND url_rewrite.store_id='1' AND url_rewrite.id_path LIKE 'category/%' WHERE (main_table.is_active = '1') AND (main_table.include_in_menu = '1') AND (main_table.path like '1/2/%') ORDER BY main_table.position ASC


texts: Reindexing products overwriting my custom url-key feature

texts:
I am importing products through soap api and while importing i am concatenating url_key for products with product name and sku.i am doing this because i have some products which has same name. so though product has same name i am concatenating products name and sku to make it unique.products are importing fine with the url key concatenating with the name and sku

Now the problem is whenever i am re-indexing this feature of url key concatenating with the products and sku is gone.how can i maintain this my custom feature.

My code is

$client->catalogProductCreate($session, 'simple', $set, $sku, array(
    'name' => $name,
    'description' => $row["QDS_DESCRIPTION"],
    'short_description' => $row["QDS_DESCRIPTION"],
    'weight' => '1',
    'status' => $status,
    'visibility' => '4',
    'price' => $price,
    'tax_class_id' => 0,
    'stock_data' => $stock_data,
    'additional_attributes' => array(
        'single_data' => array(
            array('key' => 'url_key', 'value' => $url_key),
    ),
)


texts:
The Problem
I'm looking at removing a specific quantity of an item that I already know is within the cart. There are lots of guides explaining how to remove items completely from the cart but let's say I have an item in the cart with a quantity of 2 I just want to remove a quantity of 1 rather than the product itself.


texts:
I have installed a fresh Magento2 but style sheet is not loading  and When I
check the page source, the style sheet isn't there, and of course, the
page looks terrible:

http://unisolinternational.magemojo.io/

It has the ClickBoom theme by Magentech, and I used their "quickstart" to install Magento and the theme all at once.

Here's what I've already tried:

deployed content, set the pub
directory to 777` confirmed I have a "/" at the end of the URL
replaced the .htaccess files with sample .htaccess files.

I appreciate any suggestions you can provide.


texts:
How do I get the processed Template in Magento 2 ? In version Magento 1 it worked like this:
$email_template = Mage::getModel('core/email_template')->load($templateId);
$email_template_variables = array();
$processedTemplate = $email_template->getProcessedTemplate($email_template_variables);


texts: Change Shipping label in cart and checkout page

texts:
I want to change shipping lable on cart and checkout page from Delivery to Shipping and I get file from it's coming but I can't find that from where it's coming to this file.

in shipping.phtml file I get below line from it's coming.

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

So where can I find it?


texts: small_image, image not generating for products in magento 1.9

texts:
The below code snippet not working for list.phtml and media.phtml:
 <img src="<?php echo $this->helper('catalog/image')->init($_prod, 'small_image')->resize(47,47); ?>" width="47" height="47" alt="<?php echo $this->htmlEscape($_prod->getName()); ?>" />

 <img src="<?php echo $this->helper('catalog/image')->init($_prod, 'image')->resize(47,47); ?>" width="300" height="300" alt="<?php echo $this->htmlEscape($_prod->getName()); ?>" />

Only the  $this->helper('catalog/image')->init($_prod, 'thumbnail')->resize(150,150); is working.


texts: How to remove some cms pages from sitmap.xml in magento 2?

texts: Hello Guys, how to remove some cms pages from sitemap.xml


texts:
I am trying to find a solution for showing the stock status for 2 warehouses on the frontend Category and Product page.
To explain a Little better. I have 2 sources connected to our saleable stock - Main warehouse and replenishment warehouse. The main is of course the priority warehouse but when stock is finished there it is then sent from our replenishment warehouse. In this case the delivery time is longer.
I would like to show for the customer which source they are purchasing from.
The frontend should show -

Main - in stock / out of stock (depending on stock level)
Replenishment - in stock / out of stock  (level)

As i see it the way of doing this is - if saleable stock minus replenishment stock is <1 and replenishment stock is >0 - Main would be out of stock and replenishment in stock

if saleable stock minus replenishment stock is >1 and replenishment stock is >0 - Both would be in stock

if saleable stock minus replenishment stock is >1 and replenishment stock is <1 - Main would be in stock and replenishment out stock

I am making this more difficult than it should be?

best regards
Philip


texts: Magento randomly logging us out on Admin and customers out of front end

texts:
We've got a very odd issue with our Magento 1.9.0.1 installation which has suddenly started periodically logging us out of the back end whilst simultaneously on the front end it seems to forget peoples session. So on the back end you're suddenly sent to the log in page and even if you can log in again you get logged out pretty much straight away if you click on anything. Then on the front end weird things happen like if you click 'add to basket' it just sends customers to 'there is nothing in your basket' page. Refreshing the page sometimes puts the item back in the basket. If customers are logged in then suddenly they are logged out as well. It's like it's alternating between forgetting and remembering the session.

We have 2 web servers, a database server and a load balancer. My thought was it was an issue with the sessions being stored incorrectly but the hosting company have investigated and everything seems correct from their end. We store sessions in redis across both servers.

It only happens periodically - like once a day for approx 20-30 mins which makes it infuriating to capture. By the time I get hold of the server company it's starting to resolve itself and they can't replicate the issue.

Long shot but anyone any ideas what could be causing this?

Thanks


texts: How to Enable Customer Ajax Login / Register Captcha in Magento 2 Not Working

texts: Now i am trying add CAPTCHA is Customer Configuration but CAPTCHA is not shown at ajax Login/register form.


texts: How can i avoid attributes display all sub categories

texts:
How can avoid particular attribute display all my sub categories.
Example:
Category name mobile attribute brand. When i go sub category name "os" right after the attribute display as well as mobile, i dont want to display brand attribute for my sub category "os


texts: Adding custom sales order attribute to order grid

texts:
I have created a custom sales order attribute using the installer of my custom mage module like this:

$installer = new Mage_Sales_Model_Mysql4_Setup;
try
{
    $installer->addAttribute('order', 'sales_rep', array
    (
        'type'            => 'varchar',
        'backend_type'    => 'varchar',
        'frontend_input'  => 'varchar',
        'is_user_defined' => true,
        'label'           => 'Sales Rep',
        'visible'         => true,
        'required'        => false,
        'user_defined'    => false,
        'searchable'      => false,
        'filterable'      => false,
        'comparable'      => false,
        'default'         => ''
    ));
}
catch (Exception $ex) { }
$installer->endSetup();

This attribute value is normally set when orders are created programatically.

Now, I would like to show this attribute on the sales order grid, so I have duplicated this file:

  app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php

To

  app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php

and amended the _prepareCollection() method like this:

protected function _prepareCollection()
{
    $collection = Mage::getResourceModel($this->_getCollectionClass());
    $select = $collection->getSelect();
    $select->joinLeft(array
    (
        'order' => Mage::getModel('core/resource')->getTableName('sales/order')),
        'order.entity_id=main_table.entity_id',
        array('sales_rep' => 'sales_rep')
    );
    $this->setCollection($collection);
    return parent::_prepareCollection();
}

I've verified this is generating the correct SQL by doing this:

  exit($collection->getSelect());

and it outputs:

  SELECT main_table.*, order.sales_rep FROM sales_flat_order_grid AS main_table
  LEFT JOIN sales_flat_order AS order ON order.entity_id=main_table.entity_id

I've also verified that this returns result by executing the above query in phpMyAdmin and I get the following:

Having done all the test, I proceeded to update the _prepareColumns() method on Grid.php by adding the following (just before status):

$this->addColumn('sales_rep', array(
    'header' => Mage::helper('sales')->__('Sales Rep'),
    'index' => 'sales_rep',
    'type'  => 'options',
    'width' => '70px'
));

Now, when I refresh the sales order grid in magento backend, I am not getting any values back, it looks like this:

Any ideas what I am doing wrong here?


texts: I want check what is the request paypal sending at a time of placing order. and what is the response getting. because i got a error invalid token #10410. when i try to place order using paypal payment method.


texts:
Is there a right way pass data (request value) to form ui-component?

I have try to setData from DataProvider define in form-ui.xml but not work. After form load complete this field must be populated data (initial value)

/**
 * Get data from provider and populate
 * @param void
 * @return array
 */
public function getData()
{

    if (isset($this->loadedData)) {
        return $this->loadedData;
    }

    if ($itemId)
        $items = $this->collection->getItems();

    $data = $this->dataPersistor->get('form_item');
    if (!empty($data)) {
       //Do something
    } else {
       //When form init without any data
       // I want to setData for some field here
    }

    return $this->loadedData;
}

My current question:
1 - How to setData in the right way for ui way? If my way not right is there a better way to do setdata for field
2 - Side question: How core-team can make magento find exactly which form to interactive. In old way form , we can define form original with form tag, htmlIdPrefix ... etc But in new form i can't find anywhere in uiform.xml to configuration id form, form prefix .. I am curious how it work
 It will be great if know about it


texts: Redirection issue after website duplication with Magento 2

texts:
I'm currently working a Magento 2 (2.1.14 exactly) mutli-store website and I have some problems for create a development website. I'm the only back-end developer in the company and had never work on Magento 2 before so I'm learning little by little how does it works.

We need to upgrade the Magento version, some plugins and add some functionnalities but I really need to have a clean development setup to work in, without the fear to break the production website.

Problem ⚠

Current mode : developer

I followed these steps below but the dev website (dev.mywebsite.ch) still redirect me on the production server (www.mywebsite.ch).

Create folder on server dev.website.ch
Create a sub-domain and point to the newly created folder
Copy all files and folders in it with rsync -avz source/* dest/
Create a database dump filedump.sql
Clean the dump file (advice from MgtCommerce) like sed "s/\/\*[^\/]*DEFINER.*\*\///" dump.sql > clean_dump.sql
Import the dump file in the suitable DB
Change the database detail in app/etc/env.php
Change base URL and base secure URL in core_config_data table in the dev database

I also executed all commands I use when I want to upload a new thing/bug fix (SSH) :

chmod 775 /home/cloudpanel/htdocs/*/ -R
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy en_US fr_FR de_DE
php bin/magento cache:flush
php bin/magento cache:clean

Questions I used...

How to make a copy of my magento site to my computer
How duplicate your live store on a development store and try installation on it in advance


texts: Internal Server Error (500) in Installation of magento 1.9.2.1 on aruba hosting

texts:
I have uploaded all files to server (aruba.it) and saw below errors when browse the folder to install magento:

  Internal server error

  The server encountered an internal error or misconfiguration and was
  unable to complete your request.

  Please contact the server administrator at postmaster@abc.com to
  inform them of the time this error occurred, and the actions you
  performed just before this error.

  More information about this error may be available in the server error
  log

Other important details:

Magento works well if i install from scriptaculas.
But if i upload files from local then i get " Internal Server Error".
I have checked these links: With .htaccess file Server Gives error "500 : internal server error", https://minhnvt1.wordpress.com/2013/08/19/magento-solved-internal-server-error-500-error/. so dont suggest these.
magento version: 1.9.2.1
I tried by removing .htaccess too but that also didnt work.

  It seems to be basic question but It wasted a lot of time before i posted question here.

  This question will solve the pain of few developers who are facing challenges from aruba like hostings. Aruba ranks in top 10 in italy.


texts: How to keep banner in list page with respective to the selected category?

texts: I magento 1.9.2.4 , I want to add banner in the product list page randomly with respect to the selected category.Someone kindly guide me in getting this done.


texts: show all order count of a customer in order grid

texts: I want to show all the record of the customer who have multiple order in one row as per customer entered email in my order grid, any who have tried this earlier please suggest me the way.


texts:
I get error

PHP Parse error: syntax error, unexpected T_FUNCTION, expecting ‘)’ in site.com/app/code/community/EbayEnterprise/Affiliate/Helper/Data.php on line 41

from Data.php

37 public function getAllProgramIds()
 38 {
 39 $config = Mage::helper(’eems_affiliate/config’);
40 return array_unique(array_filter(array_map(
 41 function ($website) use ($config) {
 42 return $config->getProgramId($website->getDefaultStore());
 43 },
 44 Mage::app()->getWebsites()
 45 )));
 46 }

this code for php 5.3 - but I use only php 5.2.17, and can not apdate - please help change this line 41 - that can be work on php 5.2.17


texts:
Hi I am having issues with subscriptions and my site sending emails out. I'm pretty sure they are being caused by the same thing but I can't figure out what. Whenever a user tries to subscribe they get this message: "Something went wrong with the subscription."

Also, the site is not sending out any emails (Account Signup, Newsletter, Forgot Password Request, etc)

Mandrill is disabled. (Disabling this fixed one of my other sites but not this one.)


texts:
I want to add images to top navigation menu, I use this code:

app/code/local/Mage/Catalog/Model/Observer.php

        $categoryData = array(
            'name' => $category->getName(),
        'id' => $nodeId,
        'url' => Mage::helper('catalog/category')->getCategoryUrl($category),
        'is_active' => $this->_isActiveMenuCategory($category),
        'thumbnail' => Mage::getModel('catalog/category')->load($category->getId())->getImage()
        );

and this:

app/code/local/Mage/Page/Block/Html/Topmenu.php

    $urls = Mage::getBaseUrl('media').'catalog/category/'.$child->getData('thumbnail');
    $img = '';

    $html .= '
_getRenderedMenuItemAttributes($child) . '>';
    $html .= 'getUrl() . '" ' . $outermostClassCode . '>'
        . $this->escapeHtml($child->getName()) . ''.$img.' ';

The images are in the menu and everything work fine but in the frontend I see this error:

"NetworkError: 404 Not Found - http://example.com/media/catalog/category/"

What is wrong?


texts: Does indexer:reindex need "var", "generated" and "pub/static" to be writable?

texts:
I would like to know if, when doing "php bin/magento indexer:reindex" the folders "var", "generated" and "pub/static" have to be writable ?

Alternatively, does reindexing only work at database level?

All advice and opinions are welcome! Thanks!


texts:
I need to set a 10% sales tax if total cart amount is $1000 and above. This is because we are shipping item outside from Australia, therefore there is a tax charges for that case.

Is it possible to set tax rule based on cart amount from admin panel? I'm not sure if there is any way to set this rule?. If it's not possible, any programmatic way to do that? Thanks.


texts:
I am using an extension for payment cc form,. I added zip code field in my cc form and I want to save zipcode from the zipcode field into my database. So, if user comes again there is no need to enter it again.

Where can I save zipcode in database in magento2.


texts: Magento 2: How to Add or Update different store product attribute options label based on default label and store id?

texts:
I have a custom Product options dropdown attribute and i want to add or update the label option based on the store id and default label, for example, I have a data like this:
$attribute_code = 'impression';
$default_label = 'Love';
$label = 'Liebe';
$storeId = '2';

First i need to get the default attribute code option id by the label, which i have successfully done like this:
public function getOptionId($attributeCode, $label, $force = false){

    /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */
    $attribute = $this->getAttribute($attributeCode);
    $id = $attribute->getSource()->getOptionId($label);
    if (!empty($id)) {
      return $id;
    } else return false;

    // Build option array if necessary
    if ($force === true || !isset($this->attributeValues[ $attribute->getAttributeId() ])) {
        $this->attributeValues[ $attribute->getAttributeId() ] = [];

        // We have to generate a new sourceModel instance each time through to prevent it from
        // referencing its _options cache. No other way to get it to pick up newly-added values.

        /** @var \Magento\Eav\Model\Entity\Attribute\Source\Table $sourceModel */
        $sourceModel = $this->tableFactory->create();
        $sourceModel->setAttribute($attribute);

        foreach ($sourceModel->getAllOptions() as $option) {
            $this->attributeValues[ $attribute->getAttributeId() ][ $option['label'] ] = $option['value'];
        }
    }

    // Return option ID if exists
    if (isset($this->attributeValues[ $attribute->getAttributeId() ][ $label ])) {
        return $this->attributeValues[ $attribute->getAttributeId() ][ $label ];
    }

    // Return false if does not exist
    return false;
}

Then i need to add the check if the  label already exists based on store id and if not add the label that referenced to the option id, if exists then update it, for this part i have no idea how to do it??


texts:
I have created a cron group as below,

cron_groups.xml

<?xml version="1.0"?>
<!--
/**
 * path:
 * magento_home/app/code/vendor/module/etc/cron_groups.xml
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/cron_groups.xsd">
    <group id="sync_api">
        <schedule_generate_every>1</schedule_generate_every>
        <schedule_ahead_for>4</schedule_ahead_for>
        <schedule_lifetime>2</schedule_lifetime>
        <history_cleanup_every>10</history_cleanup_every>
        <history_success_lifetime>60</history_success_lifetime>
        <history_failure_lifetime>600</history_failure_lifetime>
        <use_separate_process>1</use_separate_process>
    </group>
</config>

And my crontab.xml as below

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">

<group id="sync_api">

    <job name="custom_cronjob" instance="Ucs\Api\Sync\Test" method="execute">

        <schedule>*/5 * * * *</schedule>

    </job>

</group>

</config>

After adding this, I executed, upgrade, compile, cache:clean commands, Once it is done,

I've run a command as php bin:magento cron:run

Once all done, I checked cron_schedule and have found my next cron is not at all scheduled.

Also, in the admin stores->configuration->advance->cron tab I can see my sync_api tab. I have configured Generate Schedules Every as 1.

After all these tries, nothing works.

** Edit **

Obviously, I did cron run by group,

Even after doing that I haven't found the scheduler in cron_schedule table.


texts: Magento2: filter product collection by custom attribute

texts:
I am using Magento ver. 2.3.6.
I want to filter product collection by custom product attribute and I am using below code:-
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Block\Product\ProductList\Toolbar">
        <plugin name="Vendor_CustomModule::customCollection" type="Vendor\CustomModule\Plugin\Product\ProductList\Toolbar"/>
    </type>
</config>

Toolbar.php
<?php

namespace Vendor\CustomModule\Plugin\Product\ProductList;

class Toolbar
{

    public function aroundSetCollection(\Magento\Catalog\Block\Product\ProductList\Toolbar $subject, \Closure $proceed, $collection)
    {
        $result       = $proceed($collection);
        $currentOrder = $subject->getCurrentOrder();
        $dir          = $subject->getCurrentDirection();

        $subject->getCollection()->addAttributeToFilter('country_of_manufacture', ['eq' => 'IN']);
        return $result;
    }
}

Above code filter the product collection only on category page, I want this filter result in whole website, including, new product, featured product, bestseller products, realted products, upsell products, crosssell products and search result.
Please let me know where I add my custom filter in product collection, So filter result will show on whole website products.


texts: checkout_cart_update_item_complete is not firing

texts:
config.xml :-

  <events>
  <checkout_cart_add_product_complete>
    <observers>
      <checkout_cart_product_add_after_handler>
        <type>model</type>
        <class>observertest/observer</class>
        <method>addToCartAdditionalItem</method>
      </checkout_cart_product_add_after_handler>
    </observers>
  </checkout_cart_add_product_complete>

   <checkout_cart_update_item_complete>
    <observers>
      <checkout_cart_update_item_handler>
        <type>model</type>
        <class>observertest/observer</class>
        <method>updateCartItem</method>
      </checkout_cart_update_item_handler>
    </observers>
  </checkout_cart_update_item_complete>
 </events>

In the events tag you can see 2 event in which first one(checkout_cart_add_product_complete) is working fine but second one is not.

Where i'm doing wrong, please let me know.

Note:-

I also tried to use checkout_cart_update_items_after instead of  checkout_cart_update_item_complete it's working fine but by using this event not getting updated cart total price (just getting old one). e.g- suppose before updating my cart if in my cart a product having 4 qty & it's subtotal is $80($20*4) & if i went to update  3 more qty(20*7=$140)  then this time by using event checkout_cart_update_items_after  i'm getting $80 on my event action(updateCartItem) but i want $140.

Thanks!!!


texts: Magento 2 Show Login Popup [ Guest Checkout is disable ] Even Customer Already Login

texts:
We set guest checkout disable to show login popup at cart when customer click on process to checkout.
But the problem is when customer is already login then also login popup show at cart page when click on process to checkout.


texts: Attribute filter with checkboxes , Magento2

texts:
Has an product attribute filter with checkboxes by default for category view ?

For example


texts: Error when Join table with joinTable method

texts:
I am joining search collection with category table with joinTable method.
I want to join category name and category url with search collection.
What i've tried is below

 $res = Mage::getSingleton('core/resource');
  $eav = Mage::getModel('eav/config');
  $nameattr = $eav->getAttribute('catalog_category', 'name');
  $nametable = $res->getTableName('catalog/category') . '_' . $nameattr->getBackendType();
  $nameattrid = $nameattr->getAttributeId();
$results->joinTable('catalog/category_product',
        'product_id=entity_id', array('single_category_id' => 'category_id'),
        null, 'left')
        ->groupByAttribute('entity_id')
        ->joinTable($nametable,
        "entity_id=single_category_id", array('single_category_name' => 'value'),
        "`$nametable`.attribute_id=$nameattrid", 'left');

This perfectly return category_name but how i can also insert category url in this join condition?


texts:
In magento all config.xml files from all modules are merged to a single file at the end.

Is it possible to show the content of that file for debugging purposes?


texts: Class 'Memcached' not found when trying to configure sessions in Memcached

texts:
I'm getting the below error when I run the following PHP:

$mem = new Memcached();
$mem->addServer("127.0.0.1", 11211);

$result = $mem->get("blah");

if ($result) {
    echo $result;
} else {
    echo "No matching key found.  I'll add that now!";
    $mem->set("blah", "I am data!  I am held in memcached!") or die("Couldn't save anything to memcached...");
}

And the error:

[Mon Nov 13 10:14:44.751598 2017] [proxy_fcgi:error] [pid 8091:tid 140212336183040] [client 127.0.0.1:39055] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Error: Class 'Memcached' not found in /opt/bitnami/apps/magento/htdocs/cache-test.php

I ran

ps wuax | grep memcached

And can see Memcached on localhost 11211.

Just trying to configure Memcached to control all the session files in Magento 2 and was running a test to seem if it is all configured properly. If Memcached is installed then why the error, could anybody point me in the right direction?


texts: updating custom variable value programatically

texts:
I want to update the value of a custom variable programmatically, I am using magento 1.9.2

I have tried the solution given at programmatically create a custom variable but this is for creating custom variable but I want to update the value of an existing variable, and also this solution is not working in magento 1.9.2

Any help regarding this issue?

thanks


texts:
Last two days I have spent to set default value in checkout page. Please anyone give suggestion about what is flow behind checkout page field?

for example take one field city, give the full flow list about city field.I am not expecting whole process just hints of flows enough.


texts:
I am having problem in Printing invoice when the costumer time Arabic Character in checkout. The Arabic word is become square charcter.

Anyone knows possible alternative on this ?


texts: Magento Recommended way to add comment to order

texts:
I am looking for the Magento recommended best practice for adding a comment to an order. I can easily accomplish this using things such as $order->addCommentToStatusHistory($message)->save() and similar actions. However I know that using a direct save action is not recommended on models and you should instead us managers/repositories.

I have also found that there is a \Magento\Sales\Api\OrderStatusHistoryRepositoryInterface now which provides the save function. So what I'm trying to figure out is how to approach this properly. This is my best guess.

private $orderStatusHistoryRepository;

public function __construct(
    \Magento\Sales\Api\OrderStatusHistoryRepositoryInterface $orderStatusHistoryRepository
) {
    $this->orderStatusHistoryRepository = $orderStatusHistoryRepository;
}

public function myFunction(\Magento\Sales\Api\Data\OrderInterface $order)
{
    //... additional logic here
    $history = $order->addCommentToStatusHistory($message);
    $this->orderStatusHistoryRepository->save($history);
}

What I'm not certain about is if this is the proper approach AND should I also be saving the order using OrderRepositoryInterface, or if that is unnecessary.

I have looked through a lot of questions and answers around this as well as looking through some tutorials and documentation. However all of these provide conflicting information and most of them recommend ways that I know are not Magento best practice.

If there is documentation out there that would answer my question and I have overlooked it please point me in the right direction.

This is for Magento 2.3.0.


texts: Checkout page not working on SOME computers

texts:
I'm using Magento 1.9.3.10 and I have a checkout page where all fields of the checkout page are displayed on the page at the same time. It was working fine until about 2 weeks ago. Now after I enter my shipping information suddenly some fields I cannot click on. The mouse just stays as an arrow and I am unable to select shipping method, enter credit card info or even go back and change my name. Some fields remain clickable but not all. And here's the kicker: my developers CANNOT reproduce the problem! They say everything is fine when they try it (they aren't local). Why would this problem occur for some and not others? (yes we had customers call with the same issue)

Yes, I tried different browsers which are all up to date and it still happens. Java is up to date, my computer OS is up to date (it happens on MAC and PC, but I am using a PC).

Can ANYONE offer me ANY possibility why this might be happening??


texts: How to make Catalog Price Rule not applying, if Special Price gives lower discount?

texts:
Magento 1.9.4.5
I need to apply Catalog Price Rule only for products without Special Price.
But, if the Special Price gives lower discount (it set for 15%), I can see that Catalog Price Rule, not the Special Price is working.
For example if Price is 100, Special Price is $90, Catalog rule gives 15% = $85 and this price is displaying.
But I need to display $90 (Special price).
I've tried to set condition like on this image, but it still showing Rule price instead of Special price.


texts: Magento 2.3.5-p1 Special Price still displayed after expiration

texts:
We are facing a problem with Special Price End date on Magento 2.3.5-p1.
We are updating the prices using the Rest API on a multi store English & Greek. When we add the special price with the start/End date all work fine until the end date is past. The product remains in discount after the expiration date and the only way to fix the issue is to resave all the affected product on both stores.
Our cron jobs seems to work fine.
Did anyone face the same issue and any way to resolve it.
Regards
Polys


texts: what does $this->getUrl('fastorder/index/saveOrder') refers to

texts:
i am new to magento and i didn't understand purely about the structure of magento

what problems me is this

$this->getUrl('fastorder/index/saveOrder')

i need to find where this line refers to used in the following code

 <form id="fastorder-form" action="<?php echo $this->getUrl('fastorder/index/saveOrder')?>" method="post">

because my form post values to this location and i need to do few modifications.

I appreciate the help, thanks


texts: I would like to export ALL of my products and their fields into an XML file. I tried this but didn't work. I'm using Magento 1.9.


texts:
Like we view Gallery images in View template by default,

I tried to copy chidHtml code of View/Media for Gallery images into my List page.

But it is not working.

The code I pasted for Gallery images in my List template is,

<?php if (count($this->getGalleryImages()) > 0): ?>

<?php echo $this->__('More Views') ?>

    <?php $i=0; foreach ($this->getGalleryImages() as $_image): ?>
        <?php if ($this->isGalleryImageVisible($_image)): ?>

            <a class="thumb-link" href="#" title="<?php echo $this->escapeHtml($_image->getLabel()) ?>" data-image-index="<?php echo $i; ?>">
                <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(75); ?>"
                     width="75" height="75" alt="<?php echo $this->escapeHtml($_image->getLabel()) ?>" />

        <?php endif; ?>
    <?php $i++; endforeach; ?>

<?php endif; ?>


texts:
Can anyone explain what does /rest/default/V1/carts/mine/payment-information it mean?

I want to hide Cash payment option. By using jquery I am able to hide cash payment option but when page get refreshed through order summary page, then Cash payment option get displayed.


texts: Magento 2 : Display multiple grids in admin area

texts:
I have displayed my one custom table in a grid format. Now, I want to display one other custom table in a grid format (Under different menu). But I am little bit confused, how to add code in di.xml file

Here is my di.xml which I have created for my first grid :
app/code/Ved/Mymodule/etc/di.xml :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <virtualType name="Ved\Mymodule\Model\ResourceModel\News\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">ved_zipcodes</argument> <!-- here ved_zipcodes this is the db table name -->
            <argument name="resourceModel" xsi:type="string">Ved\Mymodule\Model\ResourceModel\News</argument> <!-- Path -->
        </arguments>
    </virtualType>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <!-- Here name value, we will use in mymodule_my_grid.xml layout file -->
                <item name="mymodule_news_grid_data_source" xsi:type="string">Ved\Mymodule\Model\ResourceModel\News\Collection</item> <!-- Collection path -->
            </argument>
        </arguments>
    </type>
</config>

How should I update my di.xml for displaying second grid in admin using the same custom module?

Any help would be highly appreciated. Thank you.


texts: newsletter popup after 15secs on site? [magento2]

texts:
Does someone know how or where to get a popup on magento2 after 15 seconds, which collects email addresses for newsletter?
Is there a good free extension or is it better to make it myself?


texts: Wishlist for guest in cart page not working shows "The requested cart item doesn\'t exist.'" in magento 2

texts:
I have added wishlist icon on cart page, If customer clicks the icon , it works fine and moved the product to the wishlist.

If the guest tries to click wishlist icon, I have triggered login popup, and forced the customer to logged in.
After the logged in by guest(Now they became customers), But failed to move the products to the wish list,It shows error like

  'The requested cart item doesn\'t exist.'

Please provide me a solution


texts: How can I get the attribute set collection using ObjectManager in Magento 2

texts: How can I get the attribute set collection using the ObjectManager?


texts: Curious about 'Exclude' option on product image tap

texts:
Manage Product - Product Detail - Images Tap

There are

Base Image  /   Small Image  /  Thumbnail  /  Exclude  /   Remove

I found most of my image have checked on 'Exclude'

I tried to uncheck or check but can't find anything different

What do this checkbox? Do I have to check or uncheck?

Curious exactly mean the checking 'Exclude'


texts: Magento2 Order Summary - unable to process binding

texts:
I'm getting issues with the Order Summary on the checkout of my magento2 site.

No products or information about the order is being displayed at all and in console I get a knockoutjs error which I'm struggling to see how it helps.

  Uncaught ReferenceError: Unable to process binding "if: function (){return maxCartItemsToDisplay < getCartLineItemsCount() }"

  Message: maxCartItemsToDisplay is not defined
      at if (eval at createBindingsStringEvaluator (knockout.js:2624), :3:55)
      at ko.computed.disposeWhenNodeIsRemoved (knockout.js:3989)
      at evaluateImmediate (knockout.js:1737)
      at Object.ko.computed.ko.dependentObservable (knockout.js:1946)
      at init (knockout.js:3988)
      at knockout.js:2989
      at Object.ignore (knockout.js:1249)
      at knockout.js:2988
      at Object.arrayForEach (knockout.js:151)
      at applyBindingsToNodeInternal (knockout.js:2974)

Any help with this or how to debug this would be appreciated.


texts:
Can anyone suggest me any article or URL's that will explain how to configure magento with Mongodb as model resource for particular module say Catalog/Product. I have tried to find from this URL but I am getting getConnection fatal error as mentioned below.

Error:

Fatal error: Call to a member function getConnection() on a non-object in /app/code/core/Mage/Core/Model/Resource/Db/Abstract.php on line 322


texts: Need to override Magento\VersionsCms\Block\Hierarchy\Menu.php in M2

texts:
Need to override  Magento\VersionsCms\Block\Hierarchy\Menu.php

How i can do that please help

what i tried:

I have created a module in M2

registration.php:-

<?php /**  * @license http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)  * @author Hervé Guétin <kensium.guetin@gmail.com> <@kensiumguetin>  * @copyright Copyright (c) 2016 Agence Soon (http://www.agence-soon.fr)  */ \Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Kensium_Version',
    __DIR__ );

module.xml:

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

di.xml:

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">   <preference for="Magento\VersionsCms\Block\Hierarchy\Menu" type="Kensium\Version\Block\Hierarchy\Menu" /> </config>

Menu.php:

<?php /**  * Copyright © 2016 Magento. All rights reserved.  * See COPYING.txt for license details.  */ namespace Kensium\Version\Block\Hierarchy;

/**  * Cms Hierarchy Context Menu  */ class Menu extends \Magento\VersionsCms\Block\Hierarchy\Menu {
    protected function _getNodeReplacePairs($node){
        echo 'here';
        exit;

    $label=$node->getLabel();
        $arr=explode(',',$label);
        if(count($arr)>2) return ['__ID__' => $node->getId(), '__LABEL__' => $arr[0], '__CITY__' => $arr[1], '__COUNTRY__' => ','.$arr[2] , '__HREF__' => $node->getUrl()];
        else if(count($arr)>1) return ['__ID__' => $node->getId(), '__LABEL__' => $arr[0], '__CITY__' => $arr[1] , '__COUNTRY__' => '', '__HREF__' => $node->getUrl()];
        else return ['__ID__' => $node->getId(), '__LABEL__' => $node->getLabel() , '__CITY__' => '' , '__COUNTRY__' => '' , '__HREF__' => $node->getUrl()]; } protected function _getLink($node)
    {

        $template = $this->_getData('_link_template');
        if (!$template) {
            $template = '_allowedLinkAttributes as $attribute) {
                $value = $this->getData('link_' . $attribute);
                if (!empty($value)) {
                    $template .= ' ' . $attribute . '="' . $this->escapeHtml($value) . '"';
                }
            }
            $template .= '>__LABEL__
Location :
__CITY____COUNTRY__';
            $this->setData('_link_template', $template);
        }

        return strtr($template, $this->_getNodeReplacePairs($node));
    }

}


texts: Hide price of config & simple for particular category

texts: How to hide price for a particular category products from list & details page & featured products etc?


texts:
I'm having an issue with changing the meta tag on category pages from:

<meta name="robots" content="INDEX,FOLLOW">

To:

<meta name="robots" content="NOINDEX,FOLLOW">

I tried adding the following XML in Layout updates of the category:

<head><meta name="robots" content="NOINDEX,FOLLOW"/></head>

I flushed cache, but no luck. Any ideas?
The current results is that the meta tag has the old value:

<meta name="robots" content="INDEX,FOLLOW">

I tried the XML on a CMS page and it's working fine. Magento version is 2.1.10.


texts: Magento 2.2.4 - Free Shipping Cart Price Rule ONLY for given products

texts:
We are trying to include a free shipping method for Specific SKU/Products that have a subtotal over 500 when in the cart by themselves.

This is accomplished by using the conditions:

If ALL  of these conditions are TRUE :
    If an item is FOUND  in the cart with ALL  of these conditions true:
        SKU  is one of  XX-1103, XX-1201, XX-1301, XX-...

Subtotal  equals or greater than  500

And the actions:

If ALL  of these conditions are TRUE :
    SKU  is one of  XX-1103, XX-1201, XX-1301, XX-...

Free Shipping: For Matching Items Only

This all works when adding the specified SKUs and subtotal over 500, however the issue is that the customer can add any other products to help get over 500, or even be over 500 with correct SKUs, but still add other products to the order and the Free Shipping will still be available even though non-qualifying SKUs are currently in the cart.

We have tried plenty of mix and match methods within the conditions and actions, but can't find anything to satisfy this issue.

Any ideas??


texts: Magento 2 : We need to save product two time After generating Custom Option programmatically?

texts:
I have work on Custom Module.
In Our Module I had use

<event name="catalog_product_save_after">
    <observer name="add_custom_option" instance="Namespace\Modulename\Observer\AddCustomOption" />
</event>

In observer i Had Generate Product Custom Option Programmatically

            $product->setHasOptions(1);
            $product->setCanSaveCustomOptions(true);
            foreach ($options as $arrayOption) {
                $isHasOptions = $product->getTypeInstance()->hasOptions($product);

                 $option = \Magento\Framework\App\ObjectManager::getInstance()
                        ->create('\Magento\Catalog\Model\Product\Option')
                        ->setProductId($product->getId())
                        ->setStoreId($product->getStoreId())
                        ->addData($arrayOption);

                $this->customoptionOperation($option, 'save');
                $product->addOption($option);
                //$product->save();
            }

i have use this code for generate Product custom Option.

  //$product->save();

i had comment this code because it provide me Error

  No Such Entity

After saving Product.

Product Options are generated Successfully in Product But Not Display in Front-end

I had Run All Commands

setup:upgrade
setup:static-content:deploy -f
indexer:reindex
cache:flush

But Custom Option Not Appears in Front-end

But When i have save product second time after saving product the Options are Appears in Front-end Without need Run any Commands.

  I Need Solution to save Product One time and Get Product Option Front End

Is This Possible ?


texts: set acl permission for delete button on customer view

texts:
Is it possible to set ACL permission for delete button on customer view Page in admin panel

Is it possible ?


texts: magento2.2 order status doesnt match status in grid

texts:
There is issue for some orders status in grid doesn't match actual order state in order itself, for example order have status "processing", but some why appears as "pending in grid":

same order inside:

re-indexed, cache flushed.
any suggestions?


texts: Magento 1.9 - how to change order stage email template?

texts:
How can i change the order when email to be send depending on order status, for example i would like to send one when order is saved(new order), then one when order is dispatched. Not on every status change.

At this moment customers receiving emails on order creation, order confirmation, picking products, dispatching ... far too many.
Is there an option to configure sending email on certain stages?


texts: Where can I change the Shopping cart title?

texts:
On the checkout/cart page I need to change the Shopping cart title.

Where can I find it in the code?


texts: I would like to set search page /catalogsearch/result/AVMP as the home page. Anyone have any idea?


texts: M2: Use extra css file in addition to LESS compiled styles

texts:
Is there a way to add an additional CSS-File to theme?

In default_head_blocks.xml I added my css file via

<css src="css/override.css" />

My shop therefore looks for

domain.tld/pub/static/frontend/[vendor]/[theme]/[locale]/css/override.css

I added the file override.css in [Vender]/[Theme]/web/css/override.css and used setup:static-content:deploy to build my theme.
But then, the override.css doesn't appear in pub/static/frontend/[vendor]/[theme]/[locale]/css/

What did I missed to do?


texts: Configurable product with limited values

texts:
I have a configurable product which involves a date and a time.
There are some restriction on these that are only known at the time of the customer request.

When displaying the product, how would I go about finding the valid configurations, and displaying only these in the frontend?

I'm using Magento 1.9


texts: Convert \Magento\Quote\Model\Quote to \Magento\Sales\Model\Order: Magento 2

texts:
I have a custom module that creates and displays the quote details. I need to display the items in a quote similar to the items grid in view order page in Magento 2 sales module.

I have created a cutom block for getting the items: Items.php as which is calling the items collection.

class Items extends \NameSpace\Moudle\Block\Adminhtml\Items\AbstractItems {

/**
 * Retrieve quote items collection
 *
 * @return Collection
 */
public function getItemsCollection() {
    return $this->getQuote()->getItemsCollection();
  }
}

In my AbstractItems class I m trying to get the quote using the magento quote module like below,

/**
 * Retrieve current quote from registry
 * @return Magento\Sales\Model\Order
 */
public function getQuote() {

    $quoteId = $this->quotes->getParam('quote_id');

    //To get the quote object instance.
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $options = $objectManager->create('Magento\Quote\Model\Quote');
    $_quote = $options->load($quoteId);
    return $_quote;
}

The issue here is that the above function is returning a quote isntance whereas I need an order since. I need an order instance since I need to call the methods such as displaySubtotalInclTax() and formatBasePricePrecision() to get the prices of the items.
However, a quote instance does not have the above methods due to which I am getting an "Invalid method" error.

Is there any way to convert the Magento\Quote\Model\Quote into Magento\Sales\Model\Order instance.

PS: I know the using objectManager directly is not recommended and I have plans to change it once I get the item details.

Please, can anyone help.


texts: Preventing user checkout with observer on sales_order_place_before event

texts:
When trying to stop checkout process with observer on 'sales_order_place_before' event, process is stopped but observer Exception doesn't show up,  rather
Magento/Checkout/Model/PaymentInformationManagement message is showing up ('Unable to place order. Please try again later.')

Is it possible to have observer's message or at least both?

public function execute(Observer $observer) {
    $this->_logger->debug('SingleVendorOrderObs:sales_order_place_before');

    /** @var $order \Magento\Sales\Model\Order */
    $order = $observer->getOrder();

    $cartVendors = [];
    foreach($order->getAllVisibleItems() as $item) {
        $cartVendors[] = $item->getUdropshipVendor();
    }

    if(count($cartVendors) > 1) {
        /* dev debug */
        $this->_logger->debug('cnt: ' . count($cartVendors) . ' vendors: ' . json_encode($cartVendors));

        throw new LocalizedException(__("You can't order items from multiple vendors! "));
        // override savePaymentInformationAndPlaceOrder app/code/Magento/Checkout/Model/PaymentInformationManagement.php
    }
}


texts: Magento 2 How to uninstall attributes added by custom module?

texts: So far I know that when uninstalling a custom module, it is possible to remove custom tables or columns added by custom module by using uninstall.php which extends \Magento\Framework\Setup\UninstallInterface. But how to remove custom attributes added by InstallData.php when uninstalling the module? Thanks in advance!


texts: Get configurable product if child product have special price in collection

texts:
I tried to get a product collection and filter it by special price attribute. Here is my code:
public function getSpecials()
    {
        $currentTime = $this->_dateTime->date()->format('Y-m-d H:i:s');

        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->addAttributeToFilter('special_price', ['notnull' => true]);
        $collection->addAttributeToFilter('special_from_date', ['lteq' => $currentTime]);
        $collection->addAttributeToFilter('special_to_date', ['gteq' => $currentTime]);
        $collection->addStoreFilter(1);
        $collection->addAttributeToFilter('status',\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
        $collection->addAttributeToSort('updated_at', 'DESC');
        return $collection;
    }

Problem is this collection just give me simple product and child product which have special price. I want to get only configurable product if child product have special price.
How should I do it?
Thank you very much!


texts: Magento 1.14 : To add extra block inside order detail page

texts:
I want to place a link in order detail page. When clicked on it, it should add an extra parameter to

/sales/order/view/order_id/xxx url.

After that a separate phtml will be open in content.
I am FE developer and new on backend. Please provide a solution


texts: Magento Catalog Search not working properly 1.9.2?

texts: My code is perfect, i have tested on another database, but on current live server database i can't search any result in my portal. can you please help me which issue is occurring in database ? Thanks


texts:
I add a tab like this:

$this->addTab('subcategorie_volgorde', array(
            'label'     => Mage::helper('catalog')->__('Subcategorie volgorde'),
            'content'   => "
Hello world
",
        ));

I have tried this, but I don't really understand how it works:

$this->getLayout()->createBlock('yourmodule/yourblock')->toHtml()


texts: Magento 2 Category Url not working after migration from magento 1

texts:
I have a problem with my magento 2 site. this site was originally migrated from magento 1. now my problem is that. the original url is not working for example:

Instead of this one: site.com/products it will result to

site.com/catalog/category/view/s/products/id/3/

which is the first url will result to 404 not found.


texts: Mass updates of prices using a .csv file

texts:
I am updating around 2500 product prices and I thought I can simply use the import/export function from Magento.

What I´ve done is an export of all products, updated the .csv file and now I want to import all the products again, in small batches of 200-300 products.
For the export I only used the "SKU" and "price" and thats all what I want to import again also.

I´ve used my dev instance to do a test and it worked fine for all 2500 products, besides the fact that it took really long.

Now before I want to use it on my live instance I was wondering if there is anything missing or if anything could go wrong the way i do it.
I´m thinking about Flat Catalog data or will this be ok?


texts:
I am using magento 1.9 version site:

http://hotwheelstoys.in/one/em0113-full-package/index.php/

but customer is not able to login to the site.

I tried in all browsers by clearing history. Also I checked in lot of systems. There also I am not able to login.

I followed this

Customer Login Doesn't Work in 1.9

but still customer can not able to login to the site.


texts: Want to add multiple column into Magento 2 admin panel left side menu

texts:
I am trying to add multiple column into Magento 2 admin custom module. I have added screen shot for more details. Which explain what I am looking for.

Please share your ideas and help.


texts: Reload shipping methods in checkout page

texts:
I notice that everytime I change Country, State/Province in checkout page, it reloads the Shipping Methods section. Depending on the country/state, it would be 1 or 2 shipping methods.
If I choose UK, there is only 1 shipping method

If I choose US; there is 2 shipping methods

I wonder how it can listen to the input changes and which function in checkout module updates shipping methods. Could you guys show me?


texts: Magento 2.3 - How to handle Preference Error - Type Error occurred when creating object

texts:
I am using Magento 2.3.4 small bug in it (LINK) then Update the following code
https://github.com/magento/magento2/blob/db69693bd929bd8665015ff6d9b6a3845584aa0b/lib/internal/Magento/Framework/Search/Dynamic/Algorithm.php
For testing, if i apply code directly to vendor/magento/framework/Search/Dynamic/Algorithm.php bug solved.
For avoiding conflicts i am trying to use Preference,
app/code/Gta/Solver/etc/di.xml
<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Framework\Search\Dynamic\Algorithm" type="Gta\Solver\Search\Dynamic\Algorithm" />
</config>

app/code/Gta/Solver/etc/module.xml
<?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
        <module name="Gta_Solver" schema_version="0.0.1" setup_version="0.0.1"></module>
</config>

app/code/Gta/Solver/registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Gta_Solver',
    __DIR__
);

app/code/Gta/Solver/Search/Dynamic/Algorithm.php
Code : https://paste.ofcode.org/eggKeUuvGeE3izxV6K9rUC
After creating preference i am getting error, i am using same code what i used for the test.
Error : 1 exception(s):
Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Magento\Framework\Search\Dynamic\Algorithm\Improved
NOTE : I did di compile and clear the cache still i am facing an error.
How to solve the error.


texts:
I'd added a cart link to my magento site as:

<action method="addLink" translate="label title" module="checkout">
    <label>Cart</label>
    <url helper="checkout/url/getCartUrl"/>
    <title>Cart</title>
    <prepare/>
    <urlParams/>
    <position>150</position>
</action>

But I want to display an icon instead of label cart. How could I add image in the above xml code


texts:
Where and why checkout-data section from local storage object cleaned after added product to cart?

Before:

{
  "checkout-data": {
    "selectedShippingAddress": null,
    "shippingAddressFromData": {
      "company": "",
      "telephone": "",
      "firstname": "Tetwe",
      "lastname": "twetwet",
      "street": {
        "0": "twetew",
        "1": "",
        "2": ""
      },
      "city": "213123",
      "postcode": "123123",
      "country_id": "DE",
      "region": ""
    },
    "newCustomerShippingAddress": null,
    "selectedShippingRate": null,
    "selectedPaymentMethod": null,
    "selectedBillingAddress": null,
    "billingAddressFromData": null,
    "newCustomerBillingAddress": null,
    "validatedEmailValue": "tesdasd@asd.ru",
    "inputFieldEmailValue": "tesdasd@asd.ru"
  }
}

After added product to cart and reload checkout page:

{
  "checkout-data":{
    "selectedShippingAddress":null,
    "shippingAddressFromData": null,
    "newCustomerShippingAddress":null,
    "selectedShippingRate":null,
    "selectedPaymentMethod":null,
    "selectedBillingAddress":null,
    "billingAddressFromData":null,
    "newCustomerBillingAddress":null
  }
}


texts: Possible to link to product that has multiple URL Keys for different store views? (multilingual)

texts:
I am setting up a Magento shop which has three languages:

DE (German)
EN (English)
JP (Japanese)

We have set up each language as a separate shop with different text/info etc in their appropriate languages.

We have also set up unique URL Keys so that the URLs are in their appropriate languages. The problem is, we need to link to products from another portion of the website which is run by Wordpress.

The issue we have, then, is that we can't seem to find a way to link to a product and have it display in its appropriate language as any full URL with the corresponding URL key will go only to that language/store view.

eg:

'http://storedomain.com/en/product-blue.html'

vs

'http://storedomain.com/de/product-blau.html'

Is there any way to have a generic link to the product which will cause Magento to then see which store the user currently has set as default (in the 'store' cookie) and redirect accordingly?


texts:
How to implement custom php library in magento2 inside vendor directory and use it in module. I have moved the custom php library in vendor folder and now i want to use that library in my module. what is the way to do that.

Thanks


texts: Using Observer stop execution of next function in Magento 2

texts:
I am using an observer on event sales_order_save_before to check for a condition and based on that condition I was to stop the save functionality.
Currently I am using it on Submit Comment in Sales Order view (Admin Panel)
My Observer execute function is called and condition is met. but it doesn't stop the save functionality when I raise error using throw new \ErrorException()
Is there any other way to completely stop the save order process?


texts: Magento 2 How to change the order of input fields of first name and last name

texts:
I want to swap the order of the first name and last name fields on the account creation page.

I would like to provide input fields tailored to Japanese.
Please tell me if you know how to do it.


texts: Add custom dropdown after shipping in checkout and generate options by API call

texts:
I have to add one dropdown field after shipping methods on checkout page and populate options by API call result.

To add field i am referring below link and i am able to display dropdown after shipping methods but not understanding where to call that API and how to pass dynamic options to dropdown.

Magento 2 add custom extesion html file in shipping method block

In view/frontend/layout/checkout_index_index.xml

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

    <referenceBlock name="checkout.root">
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="checkout" xsi:type="array">
                        <item name="children" xsi:type="array">
                            <item name="steps" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="shipping-step" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="shippingAddress" xsi:type="array">
                                                <item name="children" xsi:type="array">
                                                    <item name="shippingAdditional" xsi:type="array">
                                                        <item name="component" xsi:type="string">uiComponent</item>
                                                        <item name="displayArea" xsi:type="string">shippingAdditional</item>
                                                        <item name="children" xsi:type="array">
                                                            <item name="iqmetrix-store" xsi:type="array">
                                                                <item name="component" xsi:type="string">Namespace_Module/js/view/checkout/shipping/iqmetrix-store</item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>

In view\frontend\web\js\view\checkout\shipping\view\frontend\web\js\view\checkout\shipping.js

define([
'uiComponent'

], function (Component) {
'use strict';

return Component.extend({
    defaults: {
        template: 'Evdpl_Iqmatrix/checkout/shipping/iqmetrix-store'
    }
});
});

In view\frontend\web\template\checkout\shipping\iqmetrix-store.html

   <select name="rqstore" class="validate-select">
              <option value="">Select iQmetrix Store</option>
              <option value="">iQmetrix - Davidson</option>
              <option value="">iQmetrix - Vancouver</option>
   </select>

I have to display this select dropdown on checkout only if logged in customer have some data in custom fields in backend and i have to populate this options by API.

Please provide me some solution.


texts: How to include external .inc file in Magento 2 Custom Module

texts:
I am trying to integrate magento 2 with an ERP system. I want to include one .inc file in my module.

Can anyone guide me, which is the best place to include this file and how to achieve it.


texts: PayPal - Magento failing to update order status to "Closed" after full refund

texts:
Just recently, order statuses for fully refunded orders will fail to update to "Closed" after refund processing. This is for PayPal Express / Standard.

After the "Processing" status, instead of going to "Closed", it goes back to "Complete".

It's hard to narrow down the actual day it began happening, but from what I can tell, it was around the time I issued my first refund for my second store. I have two stores that use the same IPN notification URL, and I'm unsure if this is the reason. Both stores are under the same domain, however the second one is a subdomain. The first one (the one under the main domain) is the one having the issue.

I'm not getting any warnings/errors being sent from PayPal.

I haven't added any new code that would interfere with anything order-related, nor have I added any new plugins. This is more of a nuisance than anything else, so if anybody has any ideas what could cause this or a possible fix, it would be much appreciated.


texts: Magento 2 - How to write data to window.checkoutConfig from PHP?

texts:
I created a new shippping method, I need to generate data and pass it to the window.checkoutConfig javascript object.
Normally you do this by implementing the ConfigProviderInterface from vendor/magento/module-checkout/Model/ConfigProviderInterface.php, but this only works if the data already exist and you just have to write it into the $config.
I need to generate the data during runtime while I am generating the shipping method. The data is simply a HTML code.
How can I write the data into the config, so that it is available under window.checkoutConfig.express_note?
Shipping Method:
MODULE/Model/Carrier/Express.php
<?php
/**
 * Copyright ©  All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Company\Shipping\Model\Carrier;

use Magento\Quote\Model\Quote\Address\RateRequest;
use Magento\Shipping\Model\Rate\Result;

class Express extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements
    \Magento\Shipping\Model\Carrier\CarrierInterface
{

    protected $_code = 'express';

    protected $_isFixed = true;

    protected $_rateResultFactory;

    protected $_rateMethodFactory;

    /**
     * Constructor
     *
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory
     * @param \Psr\Log\LoggerInterface $logger
     * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory
     * @param \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory,
        \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory,
        array $data = []
    ) {
        $this->_rateResultFactory = $rateResultFactory;
        $this->_rateMethodFactory = $rateMethodFactory;
        parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data);
    }

    /**
     * {@inheritdoc}
     */
    public function collectRates(RateRequest $request)
    {
        if (!$this->getConfigFlag('active')) {
            return false;
        }

        $note = "
dynamically generated html code
";    // How to make this data available under window.checkoutConfig.express_note ?

        $shippingPrice = $this->getConfigData('price');

        $result = $this->_rateResultFactory->create();

        if ($shippingPrice !== false) {
            $method = $this->_rateMethodFactory->create();

            $method->setCarrier($this->_code);
            $method->setCarrierTitle($this->getConfigData('title'));

            $method->setMethod($this->_code);
            $method->setMethodTitle($this->getConfigData('name'));

            if ($request->getFreeShipping() === true || $request->getPackageQty() == $this->getFreeBoxes()) {
                $shippingPrice = '0.00';
            }

            $method->setPrice($shippingPrice);
            $method->setCost($shippingPrice);

            $result->append($method);
        }

        return $result;
    }

    /**
     * getAllowedMethods
     *
     * @return array
     */
    public function getAllowedMethods()
    {
        return [$this->_code => $this->getConfigData('name')];
    }
}


texts: Magento 2: Add cart price rule for unique customer

texts:
I'd need to create price rules for an unique customer, like:

For certain products:

General: 0% discount
Retailer: 5% discount
Wholesale: 10% discount
Customer1: 20% discount
Customer2: 22% discount
Customer3: 15% discount
etc.

I know you can do a group customer for an unique customer, but I think I will work better having directly the option to add price rule for a certain customer.

I thought about adding another field below Customer groups: "Customers" And could add ID customer inside the field.

But I have no idea how to begin, you think it will be a nightmare?


texts: Programatically get required values from single product collection

texts:
I am working on module and i want to gather all important values of product related to store and website id. I want name, quantity, barcode, price, special price. I am using following collection query,

$collection_check = Mage::getModel('catalog/product')->getCollection();
            $collection_check->setStoreId($store_id);
                $collection_check->addWebsiteFilter($website_id);
                $visibility = array(
                Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,
                Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG
                );

            $collection_check->addAttributeToFilter('visibility', $visibility);

            $cond[] = '{{table}}.is_in_stock=1';
            $collection_check->joinField(
             'inventory_in_stock',
             'cataloginventory/stock_item',
             'is_in_stock',
             'product_id=entity_id',
             '(' . join(') OR (', $cond) . ')'
             );


texts: magento 2.1.9 disable category attribute on condition

texts:
I've got a custom category attribute on backend which is currently available for all categories.

I want this attribute to be available for main categories only. In order to achieve this I've added a data provider to my module which extends \Magento\Catalog\Model\Category\DataProvider and (following this link: Disabling a UI component field upon condition in Magento 2) I've added this line to my category_form.xml:

<item name="disabled" xsi:type="string">${ $.provider }:data.do_we_hide_it</item>

But now I'm stuck: I don't understand how to inject my new value (data.do_we_hide_it): in the previous link it's said to use the getData method but I cannot understand how to do it.

Can you help me?

My data provider now has nothing more than the getData method:

class DataProvider extends \Magento\Catalog\Model\Category\DataProvider {
 public function getData() {
  $data = parent::getData();
  return $data;
 }
}

If I leave the method as it is (it simply extends the parent method), I get the categories with my field disabled for all the categories. If I add the lines as explained in the link, I get a blank page.

Can someone help me?


texts: Magento-2 How to add website_id column to my custom existing table by Upgrade Schema

texts:
I want to add website_id column to my custom table with index and foreign key by UpgradeSchema.

It is easy to add by InstallSchema but I want to add website_id column by UpgradeSchema in my existing custom table.

Thanks


texts: Can this shipping rule be done without an extension?

texts:
I am using the community version of Magento.  What I want to do it as follows:

Some products will be assigned free shipping regardless of quantity or whatnot.  Other products will have calculated shipping.  Finally, all shipping will be free once a certain subtotal threshold has been met.  Can I do this without using an extension the way the version of magento I am using now is?

Thanks.