texts: data patch changes does not affect database

texts:
I have created Data Patch, debugged it and everything works as expected, products are removed from the collection but after running setup upgrade changes are not made in the database, what can be cause of the error ? My code is below

<?php

declare(strict_types=1);

namespace DevAll\ExtensionSettingConfig\Setup\Patch\Data;

use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Exception\StateException;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Api\AttributeRepositoryInterface;
use Magento\Catalog\Model\ProductRepositoryIn;
use Magento\Framework\Api\SearchCriteriaBuilder;
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Framework\App\Area;
use Magento\Framework\App\State;
class RemoveLGManufacturer implements DataPatchInterface
{
    private $eavSetupFactory;

    private $attributeRepository;

    private $_productRepositoryInterface;

    private $collectionFactory;

    private $state;

    private  $productCollectionFactory;

    private $productRepository;

    private $searchCriteriaBuilder;
    public function __construct(
        State $state,
        CollectionFactory $collectionFactory,
        SearchCriteriaBuilder $searchCriteriaBuilder,
        AttributeRepositoryInterface $attributeRepository,
        ProductRepositoryInterface $productRepositoryInterface,
        array $data = []
    ) {
        $this->state = $state;
        $this->searchCriteriaBuilder = $searchCriteriaBuilder;
        $this->_productRepositoryInterface = $productRepositoryInterface;
        $this->attributeRepository = $attributeRepository;
        $this->collectionFactory = $collectionFactory;
    }

    /**
     * @inheritDoc
     */
    public static function getDependencies()
    {
        return [];
    }

    /**
     * @inheritDoc
     */
    public function getAliases()
    {
        return [];
    }
    public function apply()
    {
          //$searchCriteria = $this->searchCriteriaBuilder->addFilter('manufacturer','LG')->create();

        $productcollection = $this->collectionFactory->create()->addAttributeToSelect('manufacturer','LG')->load();
        foreach ($productcollection as $product) {
            try {
                $productcollection->removeItemByKey($product->getId());
            } catch (StateException $e) {
            }
        }
        return $productcollection;
    }

}


texts: Magento 2.2 How many websites I can create in community version?


texts: how to create new magento structural blocks to change theme layout?

texts: I have problem with magento  layout xml. I want to  create custom structural blocks as accomplish following. I want to create custom as following.


texts:
I am facing mini cart update issue - to replicate the issue you need to browse the site and add a product to the cart - then continue shopping. If you press checkout (instead of continue shopping) the cart shows right qty. If you continue to shop (though the cart is updated, but the mini cart shows 0 products in  cart) If we browse through any other product on the website the cart starts showing the right qty.

I am not sure what is this issue exactly.


texts: Show custom multi-select attribute values as images

texts:
I am trying to display a custom multiselect attribute as images on the frontend if they have been selected by the store admin.

So far I have been able to get the values "as text" on the frontend but I am not sure how I can go about associating each value with an image...

Here is what I have so far

 <?php
   $multiSelectArray = $this->getProduct ()->getAttributeText('suitable_for');
   $lastItem = end ($multiSelectArray);
   foreach ($multiSelectArray as $multiSelectItem) {
   echo $multiSelectItem;
   if ($multiSelectItem != $lastItem) echo ", ";
     }
 ?>

The above code will show the values of the multiselect but I am stuck on how to associate the values with an image instead of text.

I anyone can assist I'd be very grateful!


texts:
Braintree suggesting to upgrade the SDK file. Is that necessary for Magento 2.2.x version?

https://developers.braintreepayments.com/reference/general/best-practices/php

Magento not released any patches for this payment SDK update. Is that necessary to do this update?


texts: magento 2 getDestCity() method returns nothing in collectRates() method

texts:
I try to getDestCity() in checkout page in magento 2.1.2 .

I check Magento\Quote\Model\Quote\Address\RateRequest $request method to get

$request->getDestCity();

it's return null for every shipping method i check magento default Tablerate shipping method.


texts:
Whenever some http request to any of magento page, i would like to trigger to check if there is a param exist in the url. in which file should the code be located in line of best practice?

eg: http://mymagentosite.com/page/xx?p=123

if (param p exist) execute function


texts:
I am trying to change the html of my navigation bar  ( like adding some div tags etc )  but not getting it how to do this so far i did this.

I know template for top menu is topmenu.phtml and it is using the file app/code/core/Mage/Catalog/Block/Navigation.php. So as we should not change the core files i copied this file to the directory app/code/local/Mage/Catalog/Block/Navigation.php.

Now the change i am doing here is not reflecting in the frontend i have tried refreshing the cache already.

It woul be great if anybody can tell me about the various actions here and which action to edit for changing the html of topmenu navigation bar i have 3 level categories i.e level-0,level-1 and level-2.

Thanks in advance


texts: Magento2: Why isn't static content generated properly?

texts:
I have seen so many answers related to this question but nothing resolved my issue:

I have cleared:

cache
pub/static
generated
var/cache,
var/view_preprocessed

Ran

setup:upgrade
di:compile
cache:flush
indexer

Almost run all commands. CSS minfication and JS minfication and merge is also set to 0, means disabled symlink in di.xml file is also set from symlink to copy.

I have tried reverting it to symlink also but no luck. Any other way to sort this out?

In the frontend there are so many console issues like that in the screenshot. Locale is en_US so static-content command is also correct and from the frontend console errors are like this image:


texts:
I have defined a constant in a custom helper in module A. I want to call it an admin method from a custom controller from a custom module B.

This is my custom helper class from module A:

Mymodule_Mynamespace_Helper_MyClass

Getting my constant value from this class in another module (B) , in a block or model, like Mymodule_Mynamespace_Helper_MyClass::TEST_CONSTANT, it works .
Doing the same thing in a controller method:

public function myMethodAction(){
     echo Mymodule_Mynamespace_Helper_MyClass::TEST_CONSTANT
}

I am getting this error message: Error: Undefined class constant
Any clue why ? Thank you in advance


texts:
I'm trying to create a new page that lists a custom selection of products (basically a list of SKUs returned from an external service) that uses the default magento layered navigation.

I've been using this as a guideline:
http://www.techytalk.info/adding-layered-navigation-custom-controller-action-magento/

But I've hitten a little snag when I'm trying to filter the products, in my:

app/code/local/xyzname/abcname/Model/Catalog/Layer.php

public function prepareProductCollection($collection) {
    parent::prepareProductCollection($collection);

    $collection
        ->addAttributeToFilter( 'sku', array( 'in' => $this->skus ) );

    //echo $collection->getSelectSql(true);die;

    return $this;
}

I'm getting this error:

... Column not found: 1054 Unknown column 'e.sku' in 'where clause', query was: ...

I've read that I could use ->getSelect()->join... to compensate for that missing sku, but
databases/sql is something I'm very, very noob about.

Right now the $skus is just an static array.


texts: On trying to change the password on logging into Magento admin, I see the error message as the title of this post. I'm resetting the password in the browser so I wonder why I get this message. Please log in with your web browser and then try again. Learn more at https://support.google.com/mail/?p=WebLoginRequired a22sm5958249oib.52 - gsmtp How can I fix this?


texts: Order Status - PayPal - Payment review auto-change to completed

texts:
I am facing a issue about an order using PayPal as the payment method.

This order was instantly set to "completed" after placed the order, which should become "payment review" only.

Below is the message about the order. Is there any setting I can change?

  Jun 10, 2016 5:30:27 PM|Complete
  Customer Notified
  Jun 10, 2016 5:30:27 PM|Payment Review
  Customer Notification Not Applicable
  Capturing amount of $69.89 is pending approval on gateway. Transaction ID:


texts: How to add custom grid as attribute to product in Magento 2

texts:
I want to add tabs on the product page, to let admin to add unlimited tabs.

So fields in my grid will be: id, position, tab label, tab content.

Does anyone know how to do this? Maybe any tutorial exist?


texts: I am looking for some csv examples for bulk product uploads with or without images and i couldn't find any so far. Does anybody has or know any links, please share with me . Thanks in advance


texts:
I have below queries on my pages for each attribute, It become more than 11000 request in my magento2 pages. any body can help me?

SELECT eav_attribute.*
FROM eav_attribute
WHERE (eav_attribute.attribute_id='70')
SELECT eav_entity_type.additional_attribute_table
FROM eav_entity_type
WHERE (entity_type_id = :entity_type_id)
SELECT catalog_eav_attribute.*
FROM catalog_eav_attribute
WHERE (attribute_id = :attribute_id)


texts:
I am new to Magento 2. We are currently in the process of migrating from Magento 1 and I have been tasked with updating our custom pages to work in Magento 2. I have a page (using the page editor in the admin) that uses it's own styles, jquery and javascript. I have added the files to our template folders and am pulling them in using the xml:

<head>
<css src="css/active.min.css" />
<css src="css/apps.min.css" />
<script src="js/active.min.js" />
<script src="js/apps.min.js" />
</head>

The files are showing properly in google inspector and are pulling the code when I check them, the css works however none of the js does.

Our developers suggested building a custom module but no matter how much documentation I read I am just not understanding how the Magento 2 modules work. Is there a way to get this to work with template files? I did this the same way with a category and static block and it worked just fine.

Thanks,
Niki


texts: How to create Account Child... Company, Staff Signup

texts:
How do i create and attach a new set of field to a registered account?

I need a way to create company accounts and add the company's staff under said account. this way the company can see what each staff has purchased from us.

here's how it would work... we would register a company using Magentos account registration. the system we are trying to develop would then allow us to add employees to the registered company and generate an ID number for each. Each employee will receive their ID# and present it when purchasing goods or services. All goods and services purchased by an employee, will show up under his/her ID# in the companies account. This lets the company (employer) know who purchased what, when it was purchased and the total.

Only the company will have access to see this info, btw.

this way we can sum up the total transactions made by the companies employee, for the company to pay at the end of each month.

I believe the way to go about this is to make employees a "child" of the employer (company account)

I am still consider myself an armature at this stuff. but once i put my mind to the test i always achieve whatever im set to develop. I just need some help with finding the best way of achieving this. Please provide me with solution ideas on how to achieve this. The more details you provide the better.

I would appreciate any help in developing this!

Thanks


texts:
On the product lasting pages there is the tab view. Is it possible to create custom tabs on landingpages? A bit like this https://www.decalgirl.com/custom/cases - this is not my page, just like the tabs they have on it.

Will this be a big project for a programmer to make or?


texts: Layered Navigation: Price filter on custom collection

texts:
I have a category which uses a custom product collection and layered navigation. Everthing is working fine except the price filter (Magento 1.9). It displays the correct price ranges, but does not filter the products when clicked.

I am also using the Amasty Improved Navigation plugin, so instead of extending the core directly, I extended the plugin's classes which in turn extend the core. Basically I modified the getLayer() function in

Mage_Catalog_Block_Layer_View
Mage_Catalog_Block_Product_List

to use my custom collection and applyFilterToCollection(), _getItemsData() in addition to adding a custom function to get my custom collection in

Mage_Catalog_Model_Layer
Mage_Catalog_Model_Category
Mage_Catalog_Model_Layer_Filter_Attribute

This gets me a working toolbar, pagination and layered navigation except for the price filter - the filters are working correctly for any other attribute. But using the price filter, it returns a page with the correct URL, but in the Product_List Block I get the same, unfiltered products.

Looking into the core, I found the following function which looked promising at first:

Mage_Catalog_Model_Resource_Layer_Filter_Price

applyPriceRange($filter) {
    ...
    $select = $filter->getLayer()->getProductCollection()->getSelect();
    ...
}

However, "injecting" my custom function/collection did not change anything (I tried extending the plugin's classes as well as the core with the plugin disabled). I also looked into _getSelect($filter) in Mage_Catalog_Model_Resource_Layer_Filter_Price but without success.

Where can I hook into to make the price filtering work with my custom collection? How does the Layered Navigation Price Filter work, does use it use its own method to get the product collection?


texts:
I have just moved to magento, and I have seen magento 2 is out for a while, so it seem obvious that I should start with magento 2. But considering that many customers in the market will not adopt change and migrate to magento 2, is it wise to start from magento 1.9 and then move to magento 2.

I say this because many people who hire magento developer usually want developer for existing system, and chances of starting on new system is quite slim.
And another thing to consider is that structure of both versions are different as well.
And to migrate from previous to new version, we need knowledge of both systems.

So how much beneficial would it be to start from 1.9 and move to 2.


texts: Function used for decreasing product inventory qty from admin

texts: Can anyone help me for Which function is used for subtracting product inventory when order is placed from backend admin side?


texts: How to show the cart items in the Personalized Module, and send by email

texts: How can I get the cart items in a Customized module? I need in my module on a certain page to show all the items that are in the cart, so that I can send them by email.


texts:
How get all orders data in custom page in magento2

$orderDatamodel = $objectManager->get('Magento\Sales\Model\Order')->getCollection();
 foreach($orderDatamodel as $orderDatamodel1){
 print_r($orderDatamodel1->getData());

 }

Nothing displaying. Please help me.


texts: How to get "ALL" associated products images?

texts:
In grouped.phtml, i'd like to show all simple products image (not only thumbnail, small, basic images but also other images)

So my coded looks like

<?php $collection = $this->getProduct()->getMediaGalleryImages();
foreach ($collection as $_image): ?>
<img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile())->resize(300); ?>" width="300" height="300" alt="<?php echo $this->escapeHtml($_image->getLabel()) ?>" />
<?php endforeach;?>

But these images show "group product images" not "associated products images".

Please help me.


texts: What's the best way to find the correct referenceContainer?

texts:
SCENARIO:

I'm trying to hide the quantity field of my products frontend.
So I go to 'app/design/frontend/Magento/luma/Magento_Catalog/layout/catalog_product_view.xml'
And I try to hide it with:

<referenceContainer name="product.add.form">
   <referenceBlock name="field.qty" remove="true"/>
</referenceContainer>

And it doesn't do anything. So I'm trying to figure out what's the right combination of referenceContainer/Block to hide it.

MY QUESTION IS: What's the correct way to search for the container I want to hide? There's some way to figure out what's the correct one? Than you.

EDIT: I've found this but it doesn't seem to work with PHP 7.2.24 and/or magento 2.3.3.


texts: Create coupon code programmatically (in Magento 2.x)

texts:
I'm trying to port over tens of thousands of coupons from a custom e-commerce website into Magento 2.0.8 and I'm having a hard time getting it to work. These are simple coupons either fixed $ or % off of the carts subtotal. I have been unable to get it to save from the command line.

I have a command called coupons:migrate that I'm running this code in. This is what I have so far in my createCoupon method that accepts the current coupons row (looping over a CSV file):

protected function createCoupon($coupon) {
        $shoppingCartPriceRule = $this->objectManager->create('Magento\SalesRule\Model\Rule');

        $shoppingCartPriceRule->setName($coupon['name'])
            ->setDescription($coupon['name'])
            ->setFromDate($coupon['start'])
            ->setToDate($coupon['end'])
            ->setUsesPerCustomer($coupon['max_redemptions'])
            ->setCustomerGroupIds(array('0','1','2','3',))
            ->setIsActive('1')
            ->setSimpleAction($coupon['discount_type'])
            ->setDiscountAmount($coupon['discount_amount'])
            ->setDiscountQty(1)
            ->setApplyToShipping($coupon['flag_is_free_shipping'])
            ->setTimesUsed($coupon['redemptions'])
            ->setWebsiteIds(array('1',))
            ->setCouponType('2')
            ->setCouponCode($coupon['code'])
            ->setUsesPerCoupon(NULL);

    return $shoppingCartPriceRule->save();

}

I'm currently getting this error from my database:

[Zend_Db_Statement_Exception]
  SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: INSERT INTO `magento_reward_salesrule` (`rule_id`,`points_delta`) VALUES (?, ?) ON DUPLICATE KEY UPDATE `points_delta` = VALUES
  (`points_delta`)

  [PDOException]
  SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction

Any help would be greatly appreciated. I'm basically stuck now.


texts: Magento 2 - Is there way to setup taxes world wide automatically?

texts:
The merchant asks me to setup taxes automatically and he wants to sell products in all available countries.

Are there any extensions for this purpose?

How this problem usually solving?


texts: I have amasty layered navigation. Strange thing is when I click the product image on category page, amasty layered navigation ajax loader is invoked but I am directed to the product page and when click browser back button then I am unable to go back to the category page from where I came. I am using Ultimo theme on magento 1.9.2


texts: Filter out Configurable Products in layered navigation who have out of stock filtered option

texts:
Currently my store configured to show out of stock products and I need to keep it that way.

The only exception for hiding products is when:

Using the layered navigation is the category page
The filtered product is of type configurable
The filtered option is out of stock in that product

Thanks a lot.


texts: Redirect install(Downloader) wizard but already installed

texts: My magento site was running good but suddenly i got the problem in project.My site redirect only install wizard page and i am unable to open admin front page.So Please help me out.


texts: Magento site loading stage cart item count shows '0' at few seconds

texts: In my cart having 5 products / item , but when i'm loading/refresh my project again cart item count shows '0' at few seconds after show only the exact count. how to solve this issue!


texts: Checkout Step disappeard [Shipping] - Magento2

texts:
I always had 2 checkout steps..

The first one where you had to fill in Shipping Information and choose a shipping option
and
the second one where you choose payment option.

Now the first step randomly disappeard and I cannot choose a shipping option anymore nor fill in shipping information.. It directly goes to the payment options..

Does someone know what I could do to get it back how it was? I didnt really change anything but it suddenly disappeard..


texts: Magento 2 : Prevent product add to cart on ENTER key press

texts: If I press enter key on product page qty box, the product will add to cart automatically so I want to prevent this on press ENTER key button.


texts: How to Set Order Status to “Processing to Pending” after payment success in magento?

texts: How to Set Order Status to “Processing to Pending” after payment success in magento 1.9.3?


texts: Magento 2 category structure is displayed wrong

texts:
For some reason my category structure on the frontend and admin panel show different results. Check image below:
On the frontend my category "DATORER" have 4 subcategories but in the admin panel I only have 2 active subcategories.
I'm importing the products and category structure from a system called IcePim and
one thing to be noted is that the frontend are displaying the correct category structure I've set up in IcePim while it's being displayed wrong from the Admin panel.
Is there something I have missed to why they show different results?
I have run tried

rm -rf var/di var/generation
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
optimze database

Frontend

Admin panel


texts: How to hide a product but still access it with a link

texts:
I've tried to create a category and set Is Active to no, then creating another subcategory of that category with Is Active set to yes, then adding the product to that category but it doesn't seem to work.
I just want to create a product that can only be accessed with a link. Anyone know how do do this?


texts:
I'm trying to show images from external images  in catalog search results

I created a text attribute containing the full path URL named custom_image for each product

This phtml is responsible to show images (Sm emarket theme)

vendor/magento/module-catalog/view/frontend/templates/product/image_with_borders.phtml

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<?php /** @var $block \Magento\Catalog\Block\Product\Image */ ?>

<span class="product-image-container"
      style="width:<?= /* @escapeNotVerified */ $block->getWidth() ?>px;">
    <span class="product-image-wrapper"
          style="padding-bottom: <?= /* @escapeNotVerified */ ($block->getRatio() * 100) ?>%;">
        <img class="product-image-photo"
            <?= /* @escapeNotVerified */ $block->getCustomAttributes() ?>
            src="<?= /* @escapeNotVerified */ $block->getImageUrl() ?>"
            width="<?= /* @escapeNotVerified */ $block->getResizedImageWidth() ?>"
            height="<?= /* @escapeNotVerified */ $block->getResizedImageHeight() ?>"
            alt="<?= /* @escapeNotVerified */ $block->stripTags($block->getLabel(), null, true) ?>"/>

I'm trying to change reference for images like this

src="<?= /* @escapeNotVerified */ echo $product->getCustomAttributes('custom_image') ?>"

but I'm sure because of my poor coding knowledge I can't achieve the hoping results.
Maybe I have to add product reference or add a field to block variable but I can't find where


texts:
I am attempting to change the background color of the panel header in Luma. I want the entire header area (everything above the navigation bar) to be black. I found this similar question, which helped, but did not fix the entire issue. I included it below for reference.

I still have a huge white area that I want to be black and I can't figure out which element I need to add a style tag for. I inspected the elements and found and changed the page-wrapper, panel wrapper, and panel header to set them black. None of those items seem to be the white area. I can't figure out what the element is called or how to fix it. I'm editing this in the ADMIN > CONTENT > Design > CONFIGURATION area.

Magento 2 page-header background color

A picture of what I'm trying to change (the white and gray parts):

Any advice would be super helpful. I'm a beginner and I'm just trying to get the hang of it. I'm mainly wondering if I am completely missing the element name or if there's something else I need to change.

Here is a link to the store:
http://ec2-52-14-7-55.us-east-2.compute.amazonaws.com/

This is what I currently have in the configuration area:

<style type="text/css">@media (min-width: 768px), print {

.page-header {
   background-color: black
}
.panel-header {
   background-color: black
}
</style>


texts: How to checkout (PayPal) in non USD currency?

texts:
I have a 1.9 store that uses multiple currencies, the problem: standard pp checkout still calculates everything in USD when user is redirected there.

How do I force paypal to checkout in the currency that the user has selected?

Try adding item like this after selecting currency other than USD and you will see https://www.airyhair.com/tape-in-hair-extensions.html

Googled for solutions but all appear to be for 1,7 or older versions of Magento


texts: Magento 2 How to override banktransfer.html file in custom module

texts:
I am trying to add custom text box by custom module throw overriding this file

"vendor/magento/module-offline-payments/view/frontend/web/template/payment/banktransfer.html"

to my custom module. Please share your idea or suggestions to make this code working.


texts:
I need to keep the wishlist items after the customer have added them to the  cart.

Where is the actual removal being done in the code?
I'm trying to track the call, but gets lost in the post being made in Wishlist.php in getAddAllToCartParams() method.


texts: Magento 2 : Get Product Collection based on Attribute

texts:
I want to get product collection based on attribute.
For ex : If "Size" attribute exist in "Bag","Bottom" attribute set then, All Product's of Bag and Bottom return in product collection.
How could i able to achieved that?
Any help would be appreciated.


texts: How do you change the "Size" text on the product page?

texts:
I am really struggling to find where the "size" text is specified on the product page.

I have 3 stores and need to change this to be Size (UK), or Size (US).

Does anyone know where you change this?


texts: Help configure cloudflare for magento 1.9

texts:
I just signed up for cloudflare free plan and changed name servers to ones provided by cloudflare, and added page rules according to their recommendations.

Currently my web settings look like this:

And dns settings in cloudflare like this:

Do i need to change anything?

The reason i ask i because most of cdn set-up guides for magento teach to change skin, media and sometimes js folder to something like cdn.XXXX.cdnhostname.com, like here:

Should this be done with cloudflare too?


texts: invalid Blocktype on Mage_Core_Model_Email_Template_Filter

texts:
I'm running Magento CE 1.9.1.0 with Firegento GermanSetup.
When completing a order, no order confirmations via email are sent instead I get this error stack:

exception 'Mage_Core_Exception' with message 'Ungültiger Blocktyp: Mage_Germansetup_Block_Imprint_Content' in /var/www/my-project-de/app/Mage.php:595
Stack trace:
#0 /var/www/my-project-de/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Ung??ltiger Blo...')
#1 /var/www/my-project-de/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('germansetup/imp...', Array)
#2 /var/www/my-project-de/app/code/core/Mage/Core/Model/Email/Template/Filter.php(169): Mage_Core_Model_Layout->createBlock('germansetup/imp...', NULL, Array)
#3 [internal function]: Mage_Core_Model_Email_Template_Filter->blockDirective(Array)
#4 /var/www/my-project-de/lib/Varien/Filter/Template.php(163): call_user_func(Array, Array)
#5 /var/www/my-project-de/app/code/core/Mage/Core/Model/Email/Template/Filter.php(548): Varien_Filter_Template->filter('????<body style...')
#6 /var/www/my-project-de/app/code/core/Mage/Core/Model/Email/Template.php(311): Mage_Core_Model_Email_Template_Filter->filter('????<body style...')
#7 /var/www/my-project-de/app/code/core/Mage/Core/Model/Email/Template.php(391): Mage_Core_Model_Email_Template->getProcessedTemplate(Array, true)
#8 /var/www/my-project-de/app/code/core/Mage/Core/Model/Email/Template.php(508): Mage_Core_Model_Email_Template->send(Array, Array, Array)
#9 /var/www/my-project-de/app/code/core/Mage/Core/Model/Email/Template/Mailer.php(84): Mage_Core_Model_Email_Template->sendTransactional('11', 'sales', Array, Array, Array, '1')
#10 /var/www/my-project-de/app/code/core/Mage/Sales/Model/Order.php(1354): Mage_Core_Model_Email_Template_Mailer->send()
#11 /var/www/my-project-de/app/code/core/Mage/Checkout/Model/Type/Onepage.php(813): Mage_Sales_Model_Order->queueNewOrderEmail()
#12 /var/www/my-project-de/app/code/core/Mage/Checkout/controllers/OnepageController.php(579): Mage_Checkout_Model_Type_Onepage->saveOrder()
#13 /var/www/my-project-de/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_OnepageController->saveOrderAction()
#14 /var/www/my-project-de/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#15 /var/www/my-project-de/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#16 /var/www/my-project-de/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#17 /var/www/my-project-de/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#18 /var/www/my-project-de/index.php(87): Mage::run('', 'store')
#19 {main}

Why is the Blocktype invalid?


texts: Magento 2 Output Custom Category Attribute

texts:
I created a custom category attribute attribute - Category Heading - That I want to display on Category pages (specifically taking the place of the category H1s in title.phtml). The new attribute shows in the admin and it saves in the database, but I am not sure how to call it on a category page.
Attribute is saved in the catalog_category_entity_varchar table, but doesn't seem to be associated with category data - $category->getData()
I have tried to get the attribute with the below code, but it has not been successful:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');
        $categoryHeading = $category->getData('category_heading');

Here is my Setup/InstallData.php
<?php
namespace WeekendsOnly\CategoryName\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{
 private $eavSetupFactory;

 public function __construct(EavSetupFactory $eavSetupFactory) {
     $this->eavSetupFactory = $eavSetupFactory;
 }
 public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {
    $setup->startSetup();
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

   $eavSetup->addAttribute(\Magento\Catalog\Model\Category::ENTITY, 'category_heading', [
            'type' => 'varchar',
            'label' => 'Category Heading',
            'input' => 'text',
            'source' => '',
            'visible'  => true,
            'sort_order' => 40,
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
            'required' => false,
            'group' => 'General Information',
        ]
    );
     $setup->endSetup();
 }
}

And here is my category_form.xml
<?xml version="1.0" ?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="general">
        <field name="category_heading">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="required" xsi:type="boolean">false</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">false</item>
                    </item>
                    <item name="sortOrder" xsi:type="number">40</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="label" translate="true" xsi:type="string">Category Heading</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>


texts: How to get IP address from order ID in Magento 2? Any solution?


texts: Set Individual Product's Minimum Qty Allowed in Shopping Cart for a particular customer group

texts:
I'm looking to setup a particular product with a minimum order quantity but only for a single customer group ("Wholesale"). Is there a way to do this using the core Magento 2 functionality? Barring that, is there an extension out there available to get this accomplished?

I know that I can edit a particular product and under the Advanced Inventory set the Minimum Qty Allowed in Shopping Cart value, but this then applies to all customer groups, and I need to target just a single one instead.

CLARIFICATION::
I need to be able to set the minimum quantity for just one product and for just one customer group. Here is a screenshot of the Advanced Inventory window where the value is that I need to set based on the customer group:


texts: Magento 2 How to get/group orders by shipping addresses

texts:
Seems like Magento doesn't have a way to get all orders by shipping addresses. This is obviously because of the following:

Magento doesn't store addresses as unique entities, this means every time there is an order, Magento will create a new entity for that address even if already exists and is exactly the same.
Because its a new entity, every time an order is placed it will have its unique entity_id which is then stored against the sales_order table under the shipping_address_id column. This means we will not be able to easily check how many orders have been done under a specific address because they all have different entity_id (unique keys).

So has anyone every come across this before or can you think of a way of achieve this?

EDIT:

Here is some context why I need this.

We basically want a way to flag addresses as trusted if it has x amount of non-refunded orders between z timeframe. When a customer checks out the input address will be lookup on a table with trusted addresses if it is found then it is sent to our fraud system to do extra validations with the address set as trusted.


texts: Magento - Catalog Rule only on special price

texts:
Good morning,

i changed the catalog rule - now i can insert negative discounts (e.g -5%) to increase the price of different products.
The actual problem is, that the price increases only on products that have a special price, but i want to apply the change (e.g -5%) to every product in a category.

How can i archive that?

Thank you
Chris


texts: M2 - TinyMCE4 JavaScript disappear after switch to TinyMCE and back to HTML editor

texts:
I am using the TinyMCE to add content to CMS pages and static blocks.
With TinyMCE editor disabled I add HTML and javascript code.
For example

What Can JavaScript Do?

JavaScript can change HTML content.

<button type="button" onclick='document.getElementById("demo").innerHTML = "Hello JavaScript!"'>Click Me!</button>

Save the page and reopen it. The page opens with a TinyMCE editor showing the content. But when I switch to a simple editor to edit the content, the js code is stripped. This is what I see.

What Can JavaScript Do?

JavaScript can change HTML content.

<button type="button">Click Me!</button>

I have this problem with Magento 2.3 & 2.4
What am I doing wrong?
Thanks


texts:
A company that I'm working for has 20+ stores in the UK and are starting to frequently open more and more. There's a lot of traces of words throughout the CMS in category descriptions, pages and even product descriptions that mention "21 stores" or "25+ stores throughout the UK".

Is there a way I can create a global tag that can be used in my CMS? Something like {{storecount}}? I was going to create a block or widget - but I've noticed Magento doesn't call these in to category descriptions - it just outputs the string {{block...}}.

Cheers,

Liam


texts: Magento2 Admin Grid Product Image Display

texts:
I need to display product image in admin grid view. I tried below code.

class Image extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
{

public function render(\Magento\Framework\DataObject $row) {

        //$this->helper('Magento\Catalog\Helper\Product')->getImageUrl($product);
        //$helper = $this->helper('Magento\Catalog\Helper\Image')->init($product,'cart_page_product_thumbnail') ->constrainOnly(true)->keepAspectRatio(true)->keepFrame(false)->setImageFile($product->getImage())->getUrl();

       $id=$row->getId();
       $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
       $store = $objectManager->get('Magento\Store\Model\StoreManagerInterface')->getStore();
       $product       = $objectManager->get('Magento\Catalog\Model\Product')->load($id);

        $imageHelper  = $objectManager->get('\Magento\Catalog\Helper\Image');
        $image_url = $imageHelper->init($product, 'product_thumbnail_image')->setImageFile($product->getFile())->resize(100, 100)->getUrl();
        $prod_name = $product->getName();
       //$product->getDefaultPlaceholderUrl('small_image');
       if($image_url){
        $html='';
       }
       else{

        $placeholderImageUrl = $imageHelper->getDefaultPlaceholderUrl('thumbnail');
        $html = '';

       }

        return $html;
    }

}

I am rending this image to grid as follows.

 protected function _prepareColumns()
    {
        $this->addColumn(
            'entity_id',
            [
                'header' => __('ID'),
                'type' => 'number',
                'index' => 'entity_id',
                'header_css_class' => 'col-id',
                'column_css_class' => 'col-id'
            ]
        );
        $this->addColumn('image',
           [
                'header' => __('Image'),
                'type' => 'text',
                'align' => 'center',
                'filter' => false,
                'sortable' => false,
                'renderer' => 'My\Module\Block\Adminhtml\mproducts\Renderer\Image',
            ]);
        $this->addColumn(
            'name',
            [
                'header' => __('Name'),
                'index' => 'name',
            ]
        );
}

I am getting same image for all the products. Whats wrong in my code?


texts:
I would like to translate the gender options for a customer. At first I thought that I could simply use a translation file for this, but looking into the template app/design/frontend/base/default/template/customer/widget/gender.phtml I see that the option label is not passed to the translate function.

What is the best process for updating these values for different stores?


texts: Paying by PayPal returns the customer to a manual Place Order page instead of completing order

texts:
I've just completed my first run through purchasing a product on a Magento 1.9.2.4
 CE site I've just been putting together. The payment gateway is PayPal Payment Pro.

When PayPal returns you to the site, after paying, you end up on a page that asks you to Place Order. It also allows you to change shipping methods, which changes the cost, even though the customer has just paid.

How do I change this so that paying completes the order?

Here is the dev site: http://www.gtechniq.high-speed.net.au

I can't think of any other e-commerce site that makes you take extra action to complete the order after you've paid. I suspect my client will have lots of payments in PayPal and no completed ordered in Magento, especially as you have to scroll the page down to find the Place Order button.

Thanks for any help


texts:
I'm looking for clear solution without spikes, without creation any subfolders in pub with index files, without hardcoding cookies etc.

In other words I'd like to achive multistore in magento only using nginx configuration and magento stores/configuration.

I mostly achieved this, however I'm using two stubs, which I want to remove.

I've created some stores in admin area. Then I configured for all of them base_url in stores/configuration (also in admin area).

Let's have a look at nginx configuration. I've put into it one stub:

I added

map $http_host $MAGE_RUN_CODE {
   sub1.domain.com "sub1_magento";
   sub2.domain.com "sub2_magento";
   sub3.domain.com "sub3_magento";
}

Then inside section for php files I've added this:

    fastcgi_param  MAGE_RUN_TYPE website;
    fastcgi_param  MAGE_RUN_CODE $MAGE_RUN_CODE;

In $_SERVER variable MAGE_RUN_TYPE has expected value - 'website', however variable $MAGE_RUN_CODE doesn't have correct value.

For now I removed 'map' section and hardcoded value for it.
If somebody knows how to solve this nginx issue - please tell me how.

Let's move to the main issue:

As I understand the main actions with store detection are happening inside

  Magento\Store\Model\StoreResolver

If you put breakpoint inside constructor you may notice that $runMode and $scopeCode have expected values (from nginx config, as described above MAGE_RUN_CODE for me is hardcoded).

Then let's have a look at function:

/**
 * {@inheritdoc}
 */
public function getCurrentStoreId()
{
    list($stores, $defaultStoreId) = $this->getStoresData();

    $storeCode = $this->request->getParam(self::PARAM_NAME, $this->storeCookieManager->getStoreCodeFromCookie());

    if (is_array($storeCode)) {
        if (!isset($storeCode['_data']['code'])) {
            throw new \InvalidArgumentException(__('Invalid store parameter.'));
        }
        $storeCode = $storeCode['_data']['code'];
    }
    if ($storeCode) {
        try {
            $store = $this->getRequestedStoreByCode($storeCode);
        } catch (NoSuchEntityException $e) {
            $store = $this->getDefaultStoreById($defaultStoreId);
        }

        if (!in_array($store->getId(), $stores)) {
            $store = $this->getDefaultStoreById($defaultStoreId);
        }
    } else {
        $store = $this->getDefaultStoreById($defaultStoreId);
    }
    return $store->getId();
}

Store code is taking from one of two places: request or cookie.

In my opinion in case with request is when we type url like this: http://sub1.domain.com/?__store=blablabla. So it's not our case.

The second case (cookie) works only with store selector. (also not our case)

I hardcoded there necessary store name and I received expected result.

Did I miss anything? Is there any third case? How should magento detect which store/website to use?


texts: 'No shipping information available' in Sales Order admin

texts:
For few orders, shipping description in admin order grid shows

  'No shipping information available'.

I am using the magestore onestep checkout. All I've found is that some orders have an empty shipping_description column in sales_flat_quote_address and 'sales_flat_order' table, where as shipping_method column is always correct. I tried to reproduce the same problem,but till now I haven't found any pattern yet.

I'd appreciate any help.


texts: Best practices for running and updating multiple separate stores

texts:
3 years ago I was a part of a company that ran magento webshops for many independent customers. What we experienced at the end was that if we wanted to do a change that affects all the shops (bug fix) or an upgrade of magento, we had to do it on a case by case basis.

I would like to get your input on if there is a way to set up a structure that will allow for upgrade all the shops at once and fix common issues for all in a simple way.

Every shop will have the same core, but modules etc might vary. As they each are individual stores.


texts: Magento 2 - Change positions of the navigation submenu

texts:
I made some modifications on the top navigation menu in Blank theme.
I need to change the position of the submenu. I try to find some JavaScript but no luck, then I see this in the Magento_Theme/templates/html/topmenu.phtml

How I can change the position, I need to move submenu a little bit at top maybe 10px.

Priming

Materials


texts: How to get ratings in a group count of 5 star, 4 star, 3 star, 2 star and 1 star. [Magento 2]

texts: How to get ratings in a group count of 5 star, 4 star, 3 star, 2 star and 1 star in Magento 2.0 in form.phtml of Magento_Review template.


texts:
Sometimes when i visit my website's admin panel I get these spooky Warnings in my system.log:

ERR (3): Warning: SimpleXMLElement::__construct(): Entity: line 8: parser error : Premature end of data in tag html line 1  in /Users/PLAE_01/Documents/Projects/website-live/app/code/local/Mgt/Base/Model/Feed.php on line 79
ERR (3): Warning: SimpleXMLElement::__construct():   in /Users/PLAE_01/Documents/Projects/website-live/app/code/local/Mgt/Base/Model/Feed.php on line 79
ERR (3): Warning: SimpleXMLElement::__construct(): ^  in /Users/PLAE_01/Documents/Projects/website-live/app/code/local/Mgt/Base/Model/Feed.php on line 79

I am running Magento 1.7 but am planning on a 1.9 upgrade soon. Does anybody know how I can go about solving these errors?


texts:
I am developing one widget in which I want current customer details. But I am not able to get these details on the homepage, catalog page, product page and other CMS pages.

I have found for this issue and it's because of Full Page Cache. I don't want to disable cache for the full page since it's a widget that customer can add it on any page and disable cache will affect website performance.

I just want to know if there is any solution through which I can keep the page cache untouched and get the customer details in my widget.

If there is any solution please let me know.


texts: Magento 2 filter customer collection by website id wise in admin grid

texts:
Actually I have requirement to create a Dealer module. I have create it but when dealer login in to admin section. At that time only those customer should display who is created from that specific dealer website. I have manage dealer as different-different website.

Please help me if any one has overwrite admin customer grid.

Thanks in advance.


texts: Fixed Shipping Cost Within UK, Another Fixed Cost For Worldwide

texts:
I would like to charge a fixed £x to ship any number of items of any value to within the United Kingdom.

I would also like to charge a fixed £y to ship any number of items of any value to all other countries.

How do I set this up?


texts:
Magento 1.8:

I use the function Group Price to set a special price to a wholesaler group, but since prices are changed from time to time, and I have hundreds of products, price updates are very time consuming.

However, the wholesaler group prices are calculated as the manufacturer's prices (my price) plus a percent value (X). In short: [My Price] + X% = Wholesale price.

I just want to add the manufacturer's price once, and then be able to update all wholesale prices by changing the percent value (X). Is this possible in Magento?


texts: How to redirect user to specific page after register in Magento 2

texts:
I'm having a hard time with my custom module, I used the event customer_register_success.

Here's the part of my observer code. It will just give me an error 500. Just correct me if I'm wrong. Thanks

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;

/**
 * This is the extension to redirect into thank you page of account creation
 *
 */
class Register implements ObserverInterface
{
    protected $_responseFactory;
    protected $_redirect;
    protected $_url;

    public function __constrtuct(
        \Magento\Framework\App\ResponseFactory $responseFactory,
        \Magento\Framework\UrlInterface $url,
        \Magento\Framework\App\Response\Http $redirect,
    ) {
        $this->_responseFactory = $responseFactory;
        $this->_url = $url;
        $this->_redirect = $redirect;
    }

     public function execute(\Magento\Framework\Event\Observer $observer)
     {
        $event = $observer->getEvent();
        $CustomRedirectionUrl = $this->_url->getUrl('thank-you-account-creation');
        $this->_redirect->setRedirect($CustomRedirectionUrl);

    }
}


texts: WYSIWYG editor doesn't allow more than two lines to be added

texts:
I have a text field in my admin form with WYSIWYG enabled and I am able to add limited content in it.
here is my uiComponent form field:

<field name="description">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">wysiwyg</item>
                    <item name="source" xsi:type="string">job</item>
                    <item name="label" xsi:type="string">Job Description</item>

                    <item name="template" xsi:type="string">ui/form/field</item>
                    <item name="wysiwyg" xsi:type="boolean">true</item>
                    <item name="dataScope" xsi:type="string">description</item>
                    <item name="sortOrder" xsi:type="number">130</item>
                    <item name="rows" xsi:type="number">8</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>


texts: Magento2: Getting Random Javascript errors in console

texts:
I am getting error on live website. Everytime i encounter with new error in console.Few of them shown below:

Let me know how to solve it.


texts:
I am having a problem with crontab I installed Magento on DigitalOcean using one-click approach and it's working fine but I want to upgrade Magento to the last version 2.1.5 and Check Readiness gives me a problem with crontab inside my crontab is:

sudo crontab -e

and the content is:

# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command

* * * * * /usr/bin/php /var/www/html/magento/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/html/magento/var/log/mage$
* * * * * /usr/bin/php /var/www/html/magento/update/cron.php >> /var/www/html/magento/var/log/update.cron.log
* * * * * /usr/bin/php /var/www/html/magento/bin/magento setup:cron:run >> /var/www/html/magento/var/log/setup.cron.log

Magento path:

/var/www/html/magento

the problem that I'm having is:


texts: How magento2 extension available in composer

texts:
We have planning to submit a magento2 extension into Magento marketplace. Currently extension hosted in GitHub private repository.

After successful approval from "Magento marketplace" (Marketing and technical review), how that available via composer?

or "Magento marketplace" automatically synchronize extension into packagist.org ?

In order install extension available in composer, what are the steps need to do ?


texts: How to connect my custom block to the layout

texts:
So there's one piece of the custom block puzzle I'm not really getting.

What I'm trying to do:

I want to use $this->getChildHtml('customBlock') inside my header.phtml file and have it just print 'Hello World'

What I have thusfar:

An xml file called app/etc/modules/ Jiri_CustomBlock.xml with the following contents:

 <?xml version="1.0"?>
 <config>
     <modules>
        <Jiri_CustomBlock>
            <active>true</active>
            <codePool>local</codePool>
        </Jiri_CustomBlock>
     </modules>
 </config>

Then a file called app/code/local/Jiri/CustomBlock/etc/ config.xml

 <?xml version="1.0"?>
 <config>
     <modules>
         <Jiri_CustomBlock>
             <version>0.0.1</version>
         </Jiri_CustomBlock>
     </modules>
 </config>

This works, I can go to System>Configuration>Advanced and see it inside the Disabled Modules Output

Then I have this in app/code/local/Jiri/CustomBlock/Block/ Header.php

 class Jiri_CustomBlock_Block_Header extends Mage_Page_Block_Html_Header{
      public function helloWorld(){
          return 'Hello World';
      }
 }

Lastly I have this in my custom theme folder in app/design/frontend/customtheme/default/template/page/html/ customblock.phtml

 <?php echo $this->helloWorld(); ?>

Now for the million dollar question; how do I make it so this custom local module/block becomes a child block of the header block?

I have this thusfar in my local.xml but I have no idea how to connect the code to this part.

    <reference name="header">
        <block type="(what do I add here?)" template="page/html_header">
        </block>
    </reference> -->

I looked around online and I found out I can add 'company/module' in the 'type' attribute, but then how does it know to load Block/Header.php?


texts: How to create guest order programmatically for Guest User

texts:
I have followed Create order programmatically in Magento 2

But it is saving the customer.

And When I skip customer set data and customer save then It's getting an error report like

"Please enter customer email".

Any thoughts ??


texts: Fatal error: Call to a member function getIdFieldName() on a non-object in abstract.php on line 151

texts:
Magento ver. 1.9.2.0

I have recently setup a clone staging environment of my live site for testing purposes. The backend and front-end home & other pages are loading fine. Except when I browse product pages, I see the following error

  Fatal error: Call to a member function getIdFieldName() on a
  non-object in html/app/code/core/Mage/Core/Model/Abstract.php on line
  151

See image below for reference.

Things that I have tried:
I have re-copied the html/app/etc/config.xml file from live to staging via FTP. Didn't work

Please help.
Thanks!


texts: How to add Magento Default Captcha to all forms

texts:
I want to add the Magento Default Captcha to all forms of my magento 1.9 store. I want to add the default captch on forms like Contact Form, Review Form, Register Form, Onepage Checkout, Customer Login, Newsletter, Admin Login etc. And also in all my custom forms.

How could I integrate the Magento Default Captcha on all the forms of my magento 1.9 store?


texts:
403 Forbidden

Why do not I have a browser access to magento-domain/var/import/* files?
Does anyone have any solution?


texts: How to show configurable price range on product list page & product page?

texts:
I am trying to figure out how I can show a price range on the category list pages & product pages for configurable products.

For example I have a configurable product with three package sizes:

Small = 10$,
 Medium = 15$,
 Large = 20$

On the category page, the price of this product will show as "10$".

I want to show:

The price range: "10$ - 20$".

Thanks!


texts: How can I modify the magento checkout to only accept multiples of 12 as the cart quantity

texts:
I'm trying to add a minimum order quantity of 12 or multiples of 12 to the magento checkout.

The user should be able to buy any product combination but the final allowed quantity in the cart should be 12 or 24 or 36 and so on

How can I achieve this?


texts:
I need to get product collection by product updated date. I am using below API request.

  [http_api]/magento2/rest/V1/products/
       ?searchCriteria[filterGroups][0][filters][0][field]=updated_at
       &searchCriteria[filterGroups][0][filters][0][value]=2017-12-1
       &searchCriteria[filterGroups][0][filters][0][condition_type]=gteq
       &searchCriteria[filterGroups][0][filters][1][field]=updated_at
       &searchCriteria[filterGroups][0][filters][1][value]=2018-03-01
       &searchCriteria[filterGroups][0][filters][1][condition_type]=lteq

but i am getting all products from admin in response.

Please suggest me how to do?


texts: How to make Changes (Edit Core Block) in a Block in Magento 2

texts:
I want to override Magento core block how can I do that
vendor\magento\module-catalog\view\frontend\templates\product\view\options\type\Select.php.

I want to remove -- before and after Please Select text as shown in the image below

So Far I have tried to create a Module to override the block in app/code, app/code/Abcd/Xyz but when i have enabled it it just removed the whole select box as shown in below image

[


texts:
How to apply custom page layout template once the blocks are generated in magento 2x

Below is for magento1x

if ($settings->getPageLayout())
{
   $this->getLayout()->helper('page/layout')->applyTemplate($settings->getPageLayout());
}


texts: PHPUnit Failed asserting that null matches expected true

texts:
Main class
<?php

namespace Custom\Es\Model;

use Magento\CatalogInventory\Api\StockRegistryInterface;

class StockStatus
{

    public function __construct(
        StockRegistryInterface $stockRegistryInterface
    )
    {
        $this->stockRegistryInterface = $stockRegistryInterface;
    }

    public function getProductStockStatus()
    {
        try {
            return $this->stockRegistryInterface->getProductStockStatus(
                $this->product->getId(),
                $this->storeId
            );
        } catch (\Exception $e) {
            return;
        }
    }
}

PHPUnit Class
<?php

namespace Custom\Es\Model\Test\Unit;

use Custom\Es\Model\StockStatus;
use Magento\CatalogInventory\Api\StockRegistryInterface;
use PHPUnit\Framework\TestCase;

class StockStatusTest extends TestCase
{
    private $stockRegistryInterfaceMock;

    private $stockStatusModel;

    public function testGetProductStockStatus()
    {
        $expected = true;
        $storeId= $productId = 10;

        $this->stockRegistryInterfaceMock->expects($this->any())
            ->method('getProductStockStatus')
            ->with($productId, $storeId)
            ->willReturn(true);

        $actual = $this->stockStatusModel->getProductStockStatus();
        $this->assertEquals($expected, $actual);

    }

    protected function setUp(): void
    {
        $this->stockRegistryInterfaceMock = $this->getMockBuilder(StockRegistryInterface::class)
            ->setMethods(['getProductStockStatus'])
            ->getMockForAbstractClass();

        $this->stockStatusModel = new StockStatus(
            $this->stockRegistryInterfaceMock
        );

    }
}

Facing an error

Failed asserting that null matches expected true.
Expected :true
Actual   :null

Does anyone know what could be reason behind this?


texts: How to overriding style for multilingual with RTL in magento2.1?

texts: I have multilingual site in magento 2 and extended blank theme , i want to know where can i overwrite style for RTL(Arabic language) direction: rtl and other common and module wise style as well?


texts: Set up stores with same theme and different css Magento 2

texts:
My multistore is setup as

shop
|-app
|-lib
|-pub
|-var
|-website1
 |-app*
 |-lib*
 |-pub*
 |-var*
 |-index.php
|-website2
 |-app*
 |-lib*
 |-pub*
 |-var*
 |-index.php

Where app*, pub*, ... are symbolic links to the folders in shop and the index.php files are set to run the two different websites.

Both website1 and website2 are configured to use the same theme, but I want them to use different colors and so I need them to use two different .less files (_block1.less and _block2.less) instead of the common one /shop/app/design/frontend/Venustheme/yume/web/css/magento/_block.less they are using now.

Is there a way to do this with the stores set up as they are?


texts: where is cache_tag table used in magento2?

texts:
where is cache_tag table used in Magento2.

IS it save CACHE_TAG constant value in magento2?


texts: How to Customize No shipping method available in Magento 2

texts:
I would like to add a different error message and ask the customer to contact us for a quote If no shipping method is available, how can I customize this option, please check attached image and if anyone can guide how to achieve this.
Thank you


texts: Why is Paypal Standard not visible in Germany?

texts:
If you set your Merchant Country to Germany the payment method Paypal Website Payments Standard is hidden in Magento ce-1.9.

Does anyone know why?

Some people say it's old and should not be used. But it is still advertised on Magento Paypal page. Anyway if it's so old to be used why only Germany?


texts: Which files are currently used by my Magento install?

texts:
I have become the recipient of a Magento code base that is the result of many developers before me who have not had much experience with Magento. Admittedly, I'm new to it myself, but do have an understanding of MVC frameworks and OOP.

In many cases, the files would be duplicated and modified with new code.  For example:

/app/design/frontend/default/newtheme/template/catalog/product/view

list.phtml
list_2013_08_06a.phtml
list_2013_09_12a.phtml
...and so on...

This would be fine, if the xml files were still pointing to list.phtml and the other files were simply used as backup, but if I look into...

/app/design/frontend/default/newtheme/layout

... I find that the xml has code will sometimes point to list.phtml and sometimes point to list_2013_08_06a.phtml ... ALSO, sometimes an xml file in the layout could be catalog.xml or it could be catalog_09_10_13.xml because the previous developers knew nothing of source control. (I have since created a git repository for our company.)

So, my question is, how does one determine what files are actually in use with Magento in those folders? I'm trying to prune as I go along, but this code is so extremely bloated that I was hoping for some way of trimming all of the unneeded files.

Any help you can provide would be greatly appreciated!


texts: Configurable attributes values in catalog_product_index_eav for configurable product triggered by $product->save()

texts:
I'm trying to trigger the inserts in catalog_product_index_eav of configurable attributes values. For a configurable product with 2 associated products, each having a different color, it would add in catalog_product_index_eav 2 additional rows (configurable entity_id, color attribute_id, color value/option_id).
This happens when configurable product is saved in admin or when I reindex in admin indexer with code 'catalog_product_attribute' (Index product attributes for layered navigation building).

I want to trigger this reindex after $product->save() in a script initiated with Mage::app('admin'); I want to do this for each product and not globally with:
Mage::getModel('index/indexer')->getProcessByCode($indexer_code)-> .. ->save();

I've tested on a default Magento 1.8.0.0.
I additionally tried this: Reindex single product and didn't worked.

Why I want to do this ? There are configurable products in a store that will not have these values in catalog_product_index_eav. It works only when product is saved in admin. It doesn't work for reindex 'catalog_product_attribute'. There is something wrong about the data. As a result some categories doesn't have filters (left column, frontend category page).

[Update]

I always had index to save on update.
I reindexed everything because of the dependencies of indexes. Before I reindexd, some of the indexes required a full reindex (in admin).

This works for most configurable products:

   // $product->save(); // Isn't required.
   $product->setForceReindexRequired(true); // just this is needed for the lines bellow.
    Mage::getSingleton('index/indexer')->processEntityAction(
        $product,
        Mage_Catalog_Model_Product::ENTITY,
        Mage_Index_Model_Event::TYPE_SAVE
    );

What works: adding the configurable attributes values in catalog_product_index_eav from associated products for parent entity_id. These values are needed for layered navigation.

What it doesn't work:
For some configurable products, the above snippet code doesn't do it. I noticed that only after I save the product in admin and delete from catalog_product_index_eav the entries for the configurable attributes will be inserted by the above snippet.

Don't know why those products won't have the configurable attributes rows but the other filter attributes values are inserted.


texts:
Suddenly got below error on magento2.1.9 platform. can someone suggest me for the same.

Server requirement are fulfilled. you can review by this URL
http://itsupply.com/info.php

Fatal error: Uncaught InvalidArgumentException: Value for key "xsi:type" is missing in the argument data. in /home/itsupply/public_html/vendor/magento/framework/Data/Argument/Interpreter/Composite.php:54 Stack trace:
#0 /home/itsupply/public_html/vendor/magento/framework/ObjectManager/Config/Mapper/Dom.php(102): Magento\Framework\Data\Argument\Interpreter\Composite->evaluate(Array)
#1 /home/itsupply/public_html/vendor/magento/framework/Config/Reader/Filesystem.php(168): Magento\Framework\ObjectManager\Config\Mapper\Dom->convert(Object(DOMDocument))
#2 /home/itsupply/public_html/vendor/magento/framework/Config/Reader/Filesystem.php(127): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator))
#3 /home/itsupply/public_html/vendor/magento/framework/App/ObjectManagerFactory.php(282): Magento\Framework\Config\Reader\Filesystem->read('primary')
#4 /home/itsupply/public_html/vendor/magento/framework/App/ObjectManagerFactory.php(142): Magento\Framework\App\ObjectManagerFactory->_loadP in /home/itsupply/public_html/vendor/magento/framework/App/ObjectManagerFactory.php on line 284


texts: Magento 2: wrong url causing css problems

texts:
I'm running centos 7, mysql and apache vps. Magento web wizard setup was located at

example.com/magento

The installer asked me where I want to install magento, I said example.com

The installation went smoothly without any errors. However when that was done, it got installed in example.com/magento, I mean if you want to go to the homepage you go there.

Furthermore, the homepage doesn't load correctly, it loads as shown in this question

Why am I asking the question instead of following the highest voted answer there?

The other question doesn't address how to fix the URL issue,magento installed itself in the wrong directory.
The other question say to chmod 777 -R magento/. Are you serious? I just want to double check this 777? Isn't that a bit insecure? Back in my days, this was insanity, but I'm old so what do I know


texts: What is the Meaning of the Icons in Edit Attribute Set Page

texts: In this screen snip we're looking at the Edit Attribute Set for the Default Attribute Set. What do these images/icons mean.


texts: Can't open categories or switch between categories - Magento CE 1.9.1.1

texts:
I've switched hosting and have everything in the admin panel working fine except Catalog > Categories. When I try to open them or switch to /click on any other category within the list - I just get the below error and nothing changes.

http://domain.tld/index.php/adminzone/catalog_category/edit/key/<key>/id/58/?isAjax=true 403 (Forbidden)

Any thoughts? Not even sure where to look for details - I searched the web but mostly found details on Nginx servers or Magento CE 1.7 update. This is a more recent version and it is on Apache.


texts: Magento 2.2.1 : Add Custom Field in Login Form On Checkout Page

texts:
I have added custom field in checkout page using below code:

$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
        ['shippingAddress']['children']['customer-email']['children']['before-login-form']['children']['youngevity_id'] = [
            'component' => 'Magento_Ui/js/form/element/abstract',
            'config' => [
                'customScope' => 'shippingAddress',
                'template' => 'ui/form/field',
                'elementTmpl' => 'ui/form/element/input',
                'options' => [],
                'id' => 'yougevity-id'
            ],
            'dataScope' => 'shippingAddress.youngevity_id',
            'label' => 'Were you referred to?',
            'provider' => 'checkoutProvider',
            'visible' => true,
            'validation' => [
               'required-entry' => true
            ],
            'sortOrder' => 1,
            'value' => $this->helper->getReferralCustomerId(),
            'id' => 'yougevity-id'
        ];

But it's add field out side login form. So I need it within login form but above Email address field.

Any help is appreciate.


texts: Magento 2: Change Paypal Method Action for Some Products

texts:
I have requirement that for X product. Payment will be Authorized & Capture later.
For other products it should be captured immediately.

So when user checkout with Paypal then i have to do this changes.

magento\vendor\magento\module-paypal\Model\Api\AbstractApi.php

public function getPaymentAction()
{
    return $this->_getDataOrConfig('payment_action');
}

My only concern is which function should I override on basis of my condition?


texts: How to display product attribute set in product list page via custom module in magento 2.3.3?

texts:
I am trying show product Attribute set in product listing page.I want to achieve via custom module.

can someone help to achieve this solution?

Thanks in advance.


texts:
Alright guys, I need some help to make sure this is the best way to do this.  We have a client selling furniture.  Let's say we have the following example data set:

sofa
love seat

Then we have 3 fabrics

red
blue
Gold

The sofa is $100 in any color, but gold.  Gold is +$10

The love seat is $90 in any color, but gold.  Gold is +$5

How should we setup our products?

Right now we are doing this:

Sofa - a Configurable with below simples:
Sofa BLUE
Sofa RED
Sofa Gold (+10 on the associated tab.)

Love Seat - a Configurable with below simples:
Love Seat BLUE
Love Seat RED
Love Seat Gold (+5 on the associated tab.)

What is happening is I fear we will eventually run into some scalability issues.  Because while I gave 2 products and 3 fabric examples here - the real test case is slightly over 1,000 products and 100 fabrics.

Is this the best way considering that fabrics have varying prices based on which configurable they are attached to?  If it's also important to know, we are using magento swatching as well to show the fabric swatch as a tile next to the add to cart button.

Thanks


texts:
I'm completely new to Magento and am trying to work my way through a template that I downloaded.

I've got to the welcome message which I understand is set using the "Welcome text" field in the admin area. What I don't understand is the getAdditionalHtml method call. Where is this information set? I'm guessing it's set as a block in one of the XML files but no matter what I try I can't get anything to output here.

<?php echo $this->getWelcome() ?> <?php echo $this->getAdditionalHtml() ?>


texts:
I got an error in system.log

  main.ERROR: Environment emulation nesting is not allowed. [] []

Why this came and how to fix this?


texts: How to Post data from ajax get by post not working in postman?

texts:
Below is my code when I try to post data  but not working

URL is

  http://localhost/test1/modulename/login/request

my ajax code for javascript

var request_data = 'id='+id+'&name='+name+'&email='+email+'&social_type='+social_type;

var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
     if (this.readyState == 4 && this.status == 200) {
         var data = JSON.parse(this.responseText);
         var url = data.redirect;
         if(url!=''){
            window.location.href = data.redirect;
        }
     }
 };
xhttp.open("POST", window.request_url, true);
xhttp.setRequestHeader("Content-type", "application/json");
xhttp.send(request_data);

Below is my controller code,

<?php
namespace Lucent\SocialLogin\Controller\Login;

use Magento\Framework\App\RequestInterface;

class Test extends \Magento\Framework\App\Action\Action
{

protected $_customer;
protected $_customerSession;

public function __construct(
\Magento\Framework\App\Action\Context $context,
\Magento\Customer\Model\Customer $customer,
\Magento\Customer\Model\Session $customerSession
)
{
    parent::__construct($context);
    $this->data = $_REQUEST;
    print_r($this->data);
    $this->_customer = $customer;
    $this->_customerSession = $customerSession;
}

public function execute()
{
    print_r($this->data);
    echo '1';
    $post = $this->getRequest()->getPostValue();
    print_r($post);
    die();

}

}

So please help me. thanks

I updated by exact controller code so hope not it will help you to solve it.


texts: Magento 2 How to correctly change style in less

texts:
I creat my theme, same as luma, parent Blank.

I try change style for search (add background-color and change opticaly.
I see in less file: app\design\frontend\Vendor\default\Magento_CatalogSearch\web\css\source\_module.less only this code (need make changes here):

.action.search {
    display: inline-block;
    .lib-button-icon(
    @_icon-font-content: @icon-search,
    @_icon-font-size: 24px,
    @_icon-font-text-hide: true,
    @_icon-font-color: @header-icons-color,
    @_icon-font-color-hover: @header-icons-color-hover,
    @_icon-font-line-height: 24px
    );
    .lib-button-reset();
    position: absolute;
    right: @indent__s;
    top: 0;
    z-index: 1;

I found .lib-button-reset(); on magento\lib\web\css\source\lib\_buttons.less

.lib-button-reset() {
    background-image: none; // Reset unusual Firefox-on-Android default style
    background: none; // >>> Need change <<<
    -moz-box-sizing: content-box; // Hack: fix Firefox button line-height problem
    border: 0;
    box-shadow: none;
    line-height: inherit;
    margin: 0;
    padding: 0;
    text-decoration: none;
    text-shadow: none;
    .lib-css(font-weight, @font-weight__regular);

    &:focus,
    &:active {
        background: none;
        border: none;
    }

    &:hover {
        background: none;
        border: none;
    }

    &.disabled,
    &[disabled],
    fieldset[disabled] & {
        cursor: not-allowed;
        pointer-events: none; // Disabling of clicks
        .lib-css(opacity, @button__disabled__opacity); // >>> Need change <<<
        // >>> Need add z-index: -1; <<<
    }
}

So, to correctly add background, change opticaly and add z-index in app\design\frontend\Vendor\default\Magento_CatalogSearch\web\css\source\_module.less?


texts: how to add menu companies on role resources?

texts: i add menu companies in role resources, but when that companies role resources checked, when try to company registration from frontend appear error like this


texts: backend controller, magento routes to start page when already logged in as admin

texts:
i have a question about magento routeing.
i have created a test module with config.xml file like this:

<admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <foo before="Mage_Adminhtml">MyCompany_MyModule_Adminhtml</foo>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>

and action controller like this: class

MyCompany_MyModule_Adminhtml_CustomController extends
Mage_Adminhtml_Controller_Action{
public function indexAction()
    {
       echo "works";
    }

}

and when i type in url section this link: http://mymagentosite.com/index.php/admin/custom/indexit asks me admin name and password, i type it correctly and it goes to blank page with "works" echoed. But if i am already loged in as administrator it just automaticaly goes to admin start page: http://mymagentosite.com/index.php/admin/dashboard/index/key/dd5f..
why this is happening? why i cant go to this empty page when i am already loged in as admin?


texts:
is it possible to rename "upsell Products"? for example change it to "you might also like.."

Thanks!


texts: Strange behavior with the redirects in Store views, Cms pages, Cookies

texts:
Config :
Front : I have Two store views 1:simple, 2:pro.
Admin : 1Website->1StoreGroup->2Storeviews: simple and pro
Cms Pages : I created different Cms pages, let's taking for example : 2 (A,B) for simple view and 2 (C,D) for pro view (Content->Pages->cmsPage->Website page->set Simple for the first two and Pro for the other two).

Practical case :
In front When I switch to the Simple storeView ?___store=simple I find my two pages (A,B) and also with ?___store=pro I find my two other pages (C,D) Great.
Now When I click on the A page, I get it cool, but when I switch to the other store view pro and I click on C page It redirect to the simple store one with 404 page not found (404 because the page was configured just for the pro one), Im obliged to set for each time the storeView a?___store=simple, c?___store=pro etc... and I don't need that, it's not normal.
Why It redirects to the first one (the default one) ? from the moment I changed the store, this one is saved in a cookie and Magento logically is able to recover the current store view, here is not the case.
I checked the cookies config with an empty value, domaine value, flush the caches, reindex etc... but without success.


texts:
I would like that when a user registers on my site they have to go through a filter in which the administrator of the page must accept or deny the registration.

Is this possible?


texts: Magento 1.9 cron hanging and missing other jobs

texts:
I am using Magento 1.9
Cron is working properly, I can tail the cron and see it is running each minute

[root@ip]# tail -f /var/log/cron
Jan 23 12:31:01 ip-172-30-0-248 CROND[30511]: (root) CMD (/bin/sh /var/www/vhosts/html/cron.sh)
Jan 23 12:32:01 ip-172-30-0-248 CROND[30523]: (root) CMD (/bin/sh /var/www/vhosts/html/cron.sh)
Jan 23 12:33:01 ip-172-30-0-248 CROND[30580]: (root) CMD (/bin/sh /var/www/vhosts/html/cron.sh)

The problem is that we noticed that sometimes our transaction emails where not sending so I installed AOE scheduler and I can see that it is hanging on a feed export module.

At this point I would normally NOT post here because it seems it is a third party module until I had another client with a completely different long running cron that is doing the same thing on a different server and NOT the same module.

Is there way to multi thread cron jobs so it don't just run one at a time?


texts: New Magento1 patch for php 7.2 - how to make it work with Magento 1.13?

texts:
I am dealing with an old website with a lot of custom modules running on Magento 1.13 (obviously, EE). I am very excited to see official support for php7.2 - however, I can see that the patch is applicable only for 1.14 version.

What differences between 1.13 and 1.14 can prevent/make the application of said patch harder? Is there a way, open-source project, or best practice recommendations that would allow me to ensure that at least core Magento wouldn't break when applying it, despite running older version?


texts: Mage::Registry('current_category') working in catalog list but not in catalog - product -view

texts:
in order to retrieve categories path im using the following piece of code in phtml files:

<?php $currentCat = Mage::registry('current_category'); ?>
<?php $exp = explode("/", $currentCat->getPath());?>

I dont understand why,

class Mage_Catalog_Block_Product_List

and its associate catalog/product/list.phtml display the information eg: 1/3/54,

on the other hand,

class Mage_Catalog_Block_Product_List

and its associate catalog/product/view.phtml is not displaying any information. I receive

  Fatal error: Call to a member function getPath() on a non-object in
  \template\page\product.phtml on line 2

I dont know what Im missing, I supposed mage::registry('current_category') was a global variable. and it seems that is not set.


texts: Magento Generate Report for the Orders Created from Admin Dashboard

texts:
I am trying to generate the report for the orders created from the admin, How do I generate the report for the order created from within the admin panel.

The only logic I found was the order created from admin donot have "IP placed From: blank", the frontend placed order do have "IP Placed From: 100.100.100.100" for eg.

Any hints to create a separate  module for this would be great.


texts: I have 7000 products ready to sell, however I'm going to link it up to a POS system so I can sell instore and online. Therefore I need to assign all my internal stock codes a barcode. What's the quickest way to do this?


texts: PayPal Express- Payment transaction failed because checkboxes does not work correct! - Version 1.9.1.0

texts:
i try to solve this problem for a few days now.
My Problem is, that customers could not be complete the order,
because after the PayPal Login they return back to the
Order overview and cannot be click on the "Jetzt bezahlen(Pay now)" Button.
They checked the 2 Checkboxes and the Button is always disabled.
Curiously, the button is activated before clicking a checkbox.
After clicking one Checkbox the Button is disabled and it stay disabled.
That's very strange.
Its only at the Payment Method PayPal since i updated it to 1.9.1.0
I have no idea why. Before i update to 1.9.1.0 i used a 1.7x Version and there was everything right.
Here is a Screenshot of this Problem.


texts: Is there anyway to make Magento zip/post code be upper case in PDF print outs?

texts:
I am using Fooman PDF customiser, although it can do a lot. I cannot seem to format my zip codes to be uppercase. I think I may be close but do not know the syntax.

When I go to Config > Customer Configuration > Address Templates > Pdf

I am given the option to change fields. How can I make the post code upper case. Syntax can be seen below. I have tried wrapping in html and it does not work.

{{/if}}{{if postcode}}  {{var postcode}} {{/if}}|


texts: Magento 2: How to Track Product Price Changes different Admin User Wise?

texts:
I have different Admin Users per Role. Need to track price change by particular User.

So Magento 2 is storing Old Price? Can we track from Initial Price to How many times price changed?

Suppose A User has changed Product A Price 5 times, then B User has changed same Product A's Price 3 Times?

Not sure maybe go for Custom Development. Will also need Product Wise Price Change Report (Admin User Wise)


texts:
Could someone explain me a step by step to upgrade using ssh?

I have update seup wizard in admin panel but I got these errors!


texts: How to alter or log a variable in a plugin?

texts:
Background

I've built a custom shipping method.  It follows almost an identical pattern to the magento shipping method classes.  It works as expected.  Then I added a plugin to check if a coupon code was entered the field would appear.  This works as well.

The Issue

I want to attach the coupon name to the shipping method title.  So instead of saying "Event Pickup FREE" it says "EVENT LOCATION - Event Pickup - FREE".  Making an afterCollectRates function I would assume I would need to alter the $result variable.

I can't seem to figure out how to:

Properly alter $result to override the data.
Debug or log $result to see the structure of the object.  In hopes to alter it.

Shipping Method Function

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

    /** @var \Magento\Shipping\Model\Rate\Result $result */
    $result = $this->_rateResultFactory->create();

    /** @var \Magento\Quote\Model\Quote\Address\RateResult\Method $method */
    $method = $this->_rateMethodFactory->create();

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

    $method->setMethod($this->_code);
    $method->setMethodTitle($this->getConfigData('name'));  //<--This is what the plugin should change

    $method->setPrice('0.00');
    $method->setCost('0.00');

    $result->append($method);

    return $result;
  }

Plugin for Shipping Method

public function afterCollectRates(\Base\Model\Carrier\EventPickup $subject, $result)
{

    if (!$this->checkCouponCode()) {
            return false;
    }

    $couponCode = $this->_coupon->getCouponCode()

    $this->_logger->debug($couponCode); //<--This works and shows up on log

    return $result;
}

I've attempted to use the logger, debug, var_dump, echo, print_r, var_export and any other combinations.  All seem to be no use.  The result is usually the same, the magento loader spins forever
and nothing regarding $result comes to the log.  Thanks for the help!


texts: Magento display sub's sub category in layered navigation

texts:
I have Category hierarchy as,

Root Category
Category 1
    Category 1.1
        Category 1.1.1
        Category 1.1.2
        Category 1.1.3
    Category 1.2
        Category 1.2.1
        Category 1.2.2
        Category 1.2.3
    Category 1.3
Category 2
.       .       .
.       .       .
.       .       .

Question
After Clicking first category (eg. Catergory 1). In left side layered Navigation, it dispays only it's sub category. Not sub's sub category.

Eg. I want this after Clicking Category 1 in layered navigation as,

Category 1.1
    Category 1.1.1
    Category 1.1.2
    Category 1.1.3

Category 1.2
    Category 1.2.1
    Category 1.2.2
    Category 1.2.3

Category 1.3
    Category 1.3.1
    Category 1.3.2
    Category 1.3.3

And after clicking Category 2,

Category 2.1
    Category 2.1.1
    Category 2.1.2
    Category 2.1.3

Category 2.2
    Category 2.2.1
    Category 2.2.2
    Category 2.2.3

Category 2.3
    Category 2.3.1
    Category 2.3.2
    Category 2.3.3

and so on ....

How can i achieve this .. please help .. Thank you..


texts: How can initialize a function mobile only?

texts:
CODE HTML:

              Title 1

Content 1

              Title 2

Content 2

            Title 3

Content 3

              Title 4

Content 4

CODE JS:

require(['jquery','accordion'], function ($) {
        $("#element").accordion({
             "openedState": "active",
            "collapsible": true,
            "active": [0,1,2,3], /** Integrat Dynamic open tab  */
            "multipleCollapsible": true,
        });
    });

I have a function called an accordion and I want it's initialization to be only on the mobile (do not call on the desktop).

How can I do this?


texts: Trouble fetching current product collection for category without limit

texts:
Within my templates category list.phtml I need to pull the full product collection without the page limit. To be clear I do not want to impact the toolbar, pagination, or anything else within category view except for the collection within list.phtml.

I have given this a shot but it impacts pagination as well.


texts: getIsResizeEnabled() is not working on Magento Backend

texts:
On Magento 2.3.2 version isResizeEnabled() is not working properly. It is throwing fetal error in the admin panel while I am going to the slider editing page.

<div id="id_nupIqHg2SWgdt9sX90VPMMTLKEwINXoQ_Uploader" class="uploader" data-mage-init="{
        'Magento_Backend/js/media-uploader' : {
            'maxFileSize';: 33554432,
            'maxWidth': 1920,
            'maxHeight': 1200,
            'isResizeEnabled':

Fatal error:  Uncaught Error: Call to a member function getIsResizeEnabled() on null in /mnt/home/sparkitbd/public_html/demo/outfitbd/vendor/magento/module-backend/view/adminhtml/templates/media/uploader.phtml:18
Stack trace:
#0 /mnt/home/sparkitbd/public_html/demo/outfitbd/vendor/magento/framework/View/TemplateEngine/Php.php(59): include()
#1 /mnt/home/sparkitbd/public_html/demo/outfitbd/vendor/magento/framework/View/Element/Template.php(271): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Backend\Block\Media\Uploader), " mnt="" home="" spark...',="" array)="" #2="" sparkitbd="" public_html="" demo="" outfitbd="" vendor="" magento="" framework="" view="" element="" template.php(301):="" magento\framework\view\element\template-&gt;fetchview('="" spark...')="" #3="" module-backend="" block="" template.php(129):="" magento\framework\view\element\template-&gt;_tohtml()="" #4="" abstractblock.php(1094):="" magento\backend\bl="" in="" /mnt/home/sparkitbd/public_html/demo/outfitbd/vendor/magento/module-backend/view/adminhtml/templates/media/uploader.phtml on line 18

The code for uploader.phtml is below:

<div id="<?= $block->getHtmlId() ?>" class="uploader"
    data-mage-init='{
        "Magento_Backend/js/media-uploader" : {
            "maxFileSize": <?= /* @escapeNotVerified */ $block->getFileSizeService()->getMaxFileSize() ?>,
            "maxWidth": <?= /* @escapeNotVerified */ $block->getImageUploadMaxWidth() ?>,
            "maxHeight": <?= /* @escapeNotVerified */ $block->getImageUploadMaxHeight() ?>,
            "isResizeEnabled": <?= /* @noEscape */ $block->getImageUploadConfigData()->getIsResizeEnabled() ?>
        }
    }'
>


texts: Magento 2 - All products attributes updated after update from collection

texts:
I have got collection in $collecction from Magento\Catalog\Model\ResourceModel\Product\CollectionFactory with some certain conditions

I am updating a custom attribute viewed_count in foreach loop like this:

foreach($collection as $k=>$_product){
    echo $_product->getSku()." ";
    $viewCount = $this->getViewedCount($_product->getId());
    $_product->getResource()->saveAttribute($_product, "viewed_count");
    $_product->setViewedCount($viewCount);
    $_product->save();
}

After this it is successfully updating product viewed count in viewed_count attribute.

But the issue is: After this code is executed, all other attributes got updated and set to some default values. Can anyone tell me what am I doing wrong?


texts: magento 2 downlodable product when upload pdf display pop up "Attention true"

texts:
in Magento 2 i want to upload a book in pdf in Downloadable Type product.
My pdf size are 11.5 MB. When i upload this pdf a pop up are displayed
like -- "Attention true".

and also when upload smaller size pdf its uploaded normally.

Question:- Why this error are display dose Magento 2 have size limit on uploaded file...?


texts: How to direct to another web page when "Buy Now" button is clicked in ecommerce frontend?

texts:
How to direct to another web page when "Buy Now" button is clicked in ecommerce frontend magento? I am doing mobile apps and accessing my website webpages by using android webview. What I want to know is "Is there a way to direct to another custom webpage when Buy Now button is clicked with the condition if the url contains www.example.com?"

For example

if(buynow button is clicked)
{
   if(url == "www.aa.com")
   {
      go to my custom page
   }
   else
   {
      original page
   }
}


texts: how to pass parameter to url and load page php

texts:
I want to get data by current url, please see my code

 if (currenturl = 'https://example.com/delhi.html') {
                       $_GET['location'] = 289;
    }

but is not giving data while if we run like

https://example.com/delhi.html?location=289

then it is getting data. please anyone idea for that


texts: How can I make a column sortable in Mage_Adminhtml_Block_Report_Shopcart_Abandoned_Grid?

texts:
I need to make created_at and updated_at sort-able in Mage_Adminhtml_Block_Report_Shopcart_Abandoned_Grid.

Can anyone help me?


texts: Magento2 Extending Magento\Catalog\Block\Product\AbstractProduct Class

texts:
I wanted to add some extra custom methods to the block classes:

Related
Upsell
Cross-sell

Each of these extends the Magento\Catalog\Block\Product\AbstractProduct

But using di.xml preference I was not able to overwrite the abstract class, maybe because Magento does not allow that.

I wanted to know if there is a way to add the common functionality to each of these blocks, without individually overwrite each of them and repeating the same code.


texts: Unable to get postcode from shipping address in create order page in admin panel

texts:
I am using CE 1.9.2.2 configured for multi website.

I am trying to resolve an error in a shipping module which restricts certain pincodes.

The module works fine on frontend side but unfortunately it fails if order is created from the admin panel or if I try to add comments to an order.

After bit of debugging I found out that the observer fails to get the postcode from shipping address.

Config.xml

<events>
  <sales_order_save_before>
    <observers>
      <sales_order_save_before_handler>
        <type>model</type>
        <class>shippingrestriction/observer</class>
        <method>Shippingzip</method>
        <args></args>
      </sales_order_save_before_handler>
    </observers>
  </sales_order_save_before>
</events>

Observer.php

public function Shippingzip(Varien_Event_Observer $observer)
        {
            $collection = Mage::getModel('shippingrestriction/shippingzip')->getCollection();

            $data = array();
            foreach ($collection as $value)
            {
                $data[] = $value->zipcode;
            }
            $address = Mage::getSingleton('checkout/session')->getQuote()
                                  ->getShippingAddress();

            if (in_array($address->getData('postcode'),$data))
            {
                throw new Mage_Core_Exception(
                Mage::helper('catalog')->__('Shipping is not available for your location.')
                );die;
            }
            else
            {
            }

        }

While debugging I found out that the below function returns empty value in the admin panel create order page and thus the postcode comparison code in the observer file fails in the admin panel.

$address =  Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress();
$address->getData('postcode');


texts: Can we Create Product Attributes Programmatically without using setup Script in magento 2.3?

texts: Can you help to Create Product Attributes Programmatically without using setup Script in magento 2.3 ?


texts:
I am new to Magento front end development while creating my custom theme,

I  have created app\design\frontend\custom\themename and inside that created my theme.xml file.

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
     <title>themename</title> <!-- your theme's name -->
     <parent>Magento/blank</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
     <media>
         <preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
     </media>
 </theme>`

But in Stores->Configuration->Design->Design Theme not showing my theme name in dropdown


texts:
Hello is possible to fix this issue?
I know that are external js.


texts: Can you re merchandise categories through import on CE 2.2?

texts:
We are on Magento 2.2 CE and so have no way of merchandising categories without going into the categories and re merchandising by changing their numbers manually. Is there a way to change the ranking of the products within a category via import?

Many thanks in advance