texts: Magento 2: How to make bundled product disregard catalog price rule for options

texts:
Is there a way to make a bundled product options disregard any catalog price rules that are applied to them?

Let's say I have a product like the following:

Product: Bundled Product 1
Type: Bundle
SKU: Bundle-1

Which has various options:

Option 1

Product A1 - € 10,-
Product A2 - € 15,-

Option 2

Product B1 - € 50,-
Product B2 - € 90,-

All of which are also sold seperately in the store.

If I were to make a catalog price rule for product A1 for let's say a 50% discount. The price for option A1 would drop to €5,-. Which is fine when sold seperately but I do not want this price in the bundled product. Instead, the bundle should have a discount of its own (Let's say 20%) for the whole bundle. Thus ignoring the catalog price rule for A1.

Is this possible at all?

In Magento 1 I found an option called "Subproducts Discount" but this seems to be removed in Magento 2.0.1 and onwards.


texts: Magento 2.2.4 : Cart Subtotal, Shipping, Tax and Order Total not showing on checkout order summary section

texts:
I have the latest version (Magento 2.2.4) for my website.

There is a problem with checkout order summary.

Cart Subtotal, Shipping, Tax, and Order Total not showing on the checkout order summary section.

Any idea what's the error?

I have checked with Luma theme and also applied all basics operations (deploy, reindex, cache clear, etc).

Any help would be appreciated.


texts: Adding Products Attributes Programatically?

texts:
I want to add product attributes programmatically. I did for one attribute and I want to add another attribute. It is not working when I wrote the code like below :

class InstallData implements InstallDataInterface
{
private $eavSetupFactory;

public function __construct(EavSetupFactory $eavSetupFactory)
{
    $this->eavSetupFactory = $eavSetupFactory;
}

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'sample_attribute',
        [
            'type' => 'text','backend' => '','frontend' => '','label' => 'Sample Atrribute',
            'input' => 'text',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'visible' => true,
            'required' => true,
            'user_defined' => false,'default' => '','visible_on_front' => false,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to' => ''
        ]
        );
    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'sample_attribute1',
        [
            'type' => 'text',
            'backend' => '','frontend' => '','label' => 'Sample Atrribute',
            'input' => 'text',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'visible' => true,'required' => true,'user_defined' => false,
            'default' => '',
            'visible_on_front' => false,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to' => ''
        ]
    );
}
}


texts: Magento 2: Extending a controller but adding an additional parameter in the constructor

texts:
I have been struggling with a problem for a while and hope somebody can point me in the right direction.

I am attempting to extend a native controller by adding my own module. This appears to have worked successfully in the most part. I now have a need to call a bespoke model as an additional parameter in my overriding controllers constructor.

When I attempt to add the new parameter, I am met with the following error:

Uncaught ArgumentCountError: Too few arguments to function Companyname\Modulename\Controller\Result\Index::__construct(), 5 passed in

Here is my code for my working controller as an example:

namespace Companyname\Modulename\Controller\Result;

use Magento\Catalog\Model\Layer\Resolver;
use Magento\Catalog\Model\Session;
use Magento\Framework\App\Action\Context;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Search\Model\QueryFactory;

class Index extends \Magento\CatalogSearch\Controller\Result\Index
{
   protected $layerResolver;
   protected $_queryFactory;

    public function __construct(
        Context $context,
        Session $catalogSession,
        StoreManagerInterface $storeManager,
        QueryFactory $queryFactory,
        Resolver $layerResolver,
    ) {
        parent::__construct(
            $context,
            $catalogSession,
            $storeManager,
            $queryFactory,
            $layerResolver,
            $customer
        );

        $this->layerResolver = $layerResolver;
        $this->_queryFactory = $queryFactory;
    }

    public function execute()
    {
        $this->layerResolver->create(Resolver::CATALOG_LAYER_SEARCH);

        $query = $this->_queryFactory->get();

        // more code

    }
}

Maybe I am going about this is completely the wrong way. if somebody could give me a few pointers I'd appreciate it.


texts: Can two modules work in local directory with different name and controller functions

texts: I am creating local module for overriding core controller of magento  ProductController.php. I created two local folders Module1 and Module2 with accessibility of ProductController.php init. My question is if i use two different functions in new controller files of two different modules. Say in first i use "saveAction" and in another file i use "deleteAction". Then can both controllers code work or not?


texts: Login doesn’t work and it redirects again to login page in magento 2 using jmeter

texts:
I am new to JMeter. I tried to record login or sign-up using the JMeter proxy in Magento 2.2.7 and I tried to view the result in the JMeter, but in JMeter. I'm unable to get the response of the login page success.
Please find the screenshot:


texts: Magento 2: How to Apply Coupon Code based on Product Customizable Option

texts:
I want to create coupon code for specific product and custom option

  E.g.

  Sku: Test1

  Custom Option:

  Name: Demo Custom Option

  Option Type: Field

I want to apply the coupon code if customer have enter the name, if not filled customer will not allow to apply the coupon.


texts:
Message is so that I can't customize it.
"Displayed Error Message" in Admin -> system -> Config -> Shipping Methods
The question is : Why shipping error message not change.


texts: How to activate giftcard account after creation in magento 2

texts:
I can create a giftcard account as:

$model = $this->giftCAFactory->create()->setStatus(
            \Magento\GiftCardAccount\Model\Giftcardaccount::STATUS_DISABLED
        )->setWebsiteId(
            $this->_storeManager->getStore()->getId()
        )->setBalance(
            40
        )->setIsRedeemable(
            TRUE
        )->save();

N.B: I am creating with STATUS_DISABLED, if I create with STATUS_ENABLED, I can redeem that gift code as it is already activated in this case.

But I need to activate programmatically giftcard account after creation as we can do from backend:

I tried by loading model and setting status to enabled but it is not working as:

$model = $this->_objectManager->create(\Magento\GiftCardAccount\Model\Giftcardaccount::class);
                $model->load($id);
                $model->setStatus(
                \Magento\GiftCardAccount\Model\Giftcardaccount::STATUS_ENABLED
            );

Any help will be highly appreciated !!


texts: Magento 2 : Is It Allowed to Use Controllers and Blocks in Theme Folder

texts:
I try to create custom block and controller in my frontend theme folder.
But is it allowed to have controllers and blocks in my frontend theme folders?
Like: app\design\frontend\Myvendor\and-my-themename\Block or app\design\frontend\Myvendor\and-my-themename\Controller ?

Or do I have to create a second folder in app\code\Mevendor\Customcontroller\?


texts: Magento Connect extension error. Mage_tar_archive tar.php

texts:
I have a very odd problem here and i have been trying to figure out what's wrong.
When i try to install a extension on my magento im running now on version 1.8.1

I'll get this error output Fatal error: Class 'Mage_Archive_Tar' not found in public_html/downloader/lib/Mage/Archive.php on line 88

What i've noticed when checking further on the problem is that my Tar.php file get's removed, when trying to ftp it back up again in the right directory it just gets removed once again after trying to install a extension once again. Anyone who knows what thous problem could be because of ?

Thanks


texts: Add custom field in system Configuration in magento 2

texts:
I have tried to add new field in System configuration in magento 2. I have used the below code, but I am getting this error:

  Could not create an acl object: Invalid XML in file path/to/file

Suggest me the correct way to do this. Thanks in advance!!

acl.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Magento_Backend::stores">
                    <resource id="Magento_Backend::stores_settings">
                        <resource id="Magento_Config::config">
                            <resource id="NAmespace_Module::config" title="Custom Settings" sortOrder="50" />
                        </resource>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>

system.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="settings" translate="label" sortOrder="1000">
            Settings
        </tab>

            Example config section
            <tab>settings</tab>
            <resource>Namespace_Module::config</resource>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">

                <field id="facebook" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                    Facebook
                </field>

                <field id="textarea_example" translate="label" type="textarea" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
                    Textarea example
                </field>
            </group>

    </system>
</config>


texts: Uncaught TypeError: undefined is not a function when using a jQuery plugin in Magento

texts:
I am working on a Magento Extension.  Magento has a known issue when you try to use jQuery in Magento because Magento uses the Prototype library.

The work around for it is to put your jQuery code in no conflict mode like this...

jQuery.noConflict();

Once I did this, it resolved 90% of my problems i was having with JavaScript errors.  However I still have 3 major problems with JavaScript right now and I believe they are related...

Uncaught TypeError: undefined is not a function

http://www.codedevelopr.com/screenshots/2014/2014-08-23_16-14-37.png

When I view the line numbers that it is reporting these errors from I see this...

Line 1168 jQuery(".acc-wizard").accwizard({ now this accwizard() is a function that is loaded from a jQuery plugin file.  I have verified the file is loaded and it is loaded after my jQuery and after I set the no conflict mode for jQuery.  I am not sure if something in the plugin file needs to be changed as well to work with the no conflict mode or why it is saying it is undefine?

Same situation with simplecolorpicker() on line 1180.

I have uploaded the file that holds the accwizard() jQuery Plugin, it is about 14kb in size and can be found here http://www.codedevelopr.com/screenshots/2014/acc-wizard-bs-3.js I figured it is a little to large to post that code here.

Can anyone help me to get these errors resolved?  It seems any jQuery plugin I try to use results in this undefined error above?

UPDATE

So I have been experimenting with a lot of things with no luck...that is until I tried loading all my JS files inline in my actual template page that my extension uses...once I do that, it all works with none of these errors.

This is frustrating though as I much prefer to have separate JS file for my JS...instead of loading 3 JS files I even tried putting all 3 into 1 file and loading that 1 file but I still get the JS errors...now when I copy that 1 file that had all 3 files combined and put it directly in the template file...everything works perfectly!   This makes no sense to me, please help?


texts: Insert product id into custom table while importing products in Magento from csv

texts:
I have created a custom admin module using module creator with entity type "Flat" and it created  2 table in my database.

Now I need to insert product id in one of table when importing products from csv. Can anybody please help me to achieve this.


texts:
TL;DR: is there a way I can debug the loading of the layout? As I believe one module's layout is conflicting with another.

Related to a previous question I made: How to make a module layout to be shown on all themes

I have successfully loaded my module on my local testing environment (aka my development PC), tested switching between 3 different themes and it is ok. Then I updated the module on the test or "pre-production" environment we have, where there are a lot of different modules, some proprietary other made by us. On this environment, the module does not show what is needed on the product frontpage. After some testings, I finally come to the conclusion that the problem should be on the layout load process.

So, is there a way I can debug the loading of the layout, how different modules replace or add their own blocks? My point is that I believe there is at least one module that should be conflicting with mine. And as we have so many modules I'm looking for an approach different to disabling modules one by one and see which is the problematic one.

My config.xml file is:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Dts_Banners>
            <version>0.1.0</version>
        </Dts_Banners>
    </modules>
    <global>
        <blocks>
            <banners>
                <class>Dts_Banners_Block</class>
            </banners>
        </blocks>
  ....
        <events>
            <controller_action_layout_load_before>
                <observers>
                    <attributesethandle>
                        <class>Dts_Banners_Model_Observer</class>
                        <method>addAttributeSetHandle</method>
                    </attributesethandle>
                </observers>
            </controller_action_layout_load_before>
        </events>
    </global>
  ....
</config>

My Observer file:

<?php
class Dts_Banners_Model_Observer
{
    /**
     * Checks if the search text on the list of active campaigns (dts_banners_admin table) has some of the comma separated text on the product name
     * If text found, add a layout handle PRODUCT_CAMPAIGN_BANNER after PRODUCT_TYPE_<product_type_id> handle
     * This handle is handled on the banners.xml layout file that triggers the use of the Front.php frontend block
     *
     * Event: controller_action_layout_load_before
     *
     * @param Varien_Event_Observer $observer
     */
    public function addAttributeSetHandle(Varien_Event_Observer $observer) {
        $product = Mage::registry('current_product');
        if (!($product instanceof Mage_Catalog_Model_Product)) return;
      ....
      ....
}

This is my layout file:

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <default>
        <reference name="content">
            <block type="banners/front" name="banners.front" as="banners_front" template="banners/product.phtml" before="-"/>
        </reference>
    </default>
</layout>

Previously had a slightly different one where instead of <default></default> I had <Product_Campaign_Banner></Product_Campaign_Banner>. It also worked.

My product.phtml file:

<div class="visual">
    <?php echo $this->showCampaign(); ?>
</div>

The product.phtml file is not loaded and therefore the showCampaign is not executed and there is where all the needed HTML is created.


texts: Problems with overriding order grid block

texts:
I want to override Magento block Order_Grid, but Magento don't recognize my class.

/app/etc/modules/Octo_OrderGrid.xml

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

/app/code/local/Octo/OrderGrid/etc/config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
    <modules>
        <Octo_OrderGrid>
            <version>1.0</version>
        </Octo_OrderGrid>
    </modules>
    <global>
        <blocks>
            <adminhtml>
                <rewrite>
                    <sales_order_grid>Octo_OrderGrid_Adminhtml_Block_Sales_Order_Grid</sales_order_grid>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
</config>

/app/code/local/Octo/OrderGrid/Adminhtml/Block/Sales/Order/Grid.php

class Octo_OrderGrid_Adminhtml_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
    //Some code
}

This are my three files, I followed instructions on some questions I found on this site, step by step, but again I couldn't make it work.

I can override when I put php file in /app/code/local/Mage/... but that is not what I want.

I use Magento 1.7


texts: How to crop (not just resize) images with view.xml

texts:
I have this in my view.xml:

<image id="new_products_content_widget_grid" type="small_image">
    <width>474</width>
    <height>267</height>
    <aspect_ratio>true</aspect_ratio>
    <frame>false</frame>
</image>

And this in my template:

<?php echo $block->getImage($_product, $image)->toHtml();?>

Where $_product comes from $_productCollection = $block->getLoadedProductCollection();

The uploaded images are square, but the design wants them to be output as a rectangle. With XML above, I get squares with vertical letterboxing.

How do I go about having the image enlarged to fill the entire rectangle, by cropping top and bottom off the image?


texts: PayPal - Bill Me Later as standalone option on Magento checkout page. Is it possible?

texts:
My main question is: Can we have PayPal – Bill Me Later as standalone payment option on Magento checkout page?

I spent 2 months playing around with the payment method called “Bill Me Later”.
After Magento released this information: http://www.magentocommerce.com/paypal/billmelater
some Magento shop owners were fooled, that we have “Bill Me Later” as standalone payment option. Of course this is not true, because Mangeto just said to the world, that everybody can put PayPal – Bill Me Later banners on their shops.

To get PayPal – Bill Me Later in Magento we have to activate PayPal  Payments Advanced from Magento admin. Also to apply some settings in  https://manager.paypal.com . After doing all needed actions I ended up with hosted iframe which contains checkout options. This iframe appear after I complete all checkout steps and I press the “place order” button. The checkout options are:

checkout with PayPal
checkout with PayPal – Bill Me Later
Pay with credit or debit card

Do you know if PayPal – Bill Me Later can work in different way and we can have  PayPal – Bill Me Later as standalone payment option / method or even if it's possible to place the PayPal advance iframe in the payment options block before the “place order” button is pressed.

So far I checked how the PayPal  API works and found, that to get the iframe we have to pass the order id to PayPal and some other parameters. That makes me think, that it's impossible to have the iframe before we have an order, but may be somebody from the community faced the same problem and knows, how this can be achieved.


texts:
As per this instruction page (these apparently are the "complete" installation instructions)

http://wiki.magmi.org/index.php?title=Installing_Magmi#Directory_permissions_.2F_Magmi_upgrade

I have uploaded Magmi to my server, now what?

I can't go to any pages within it
it isn't in my magento admin area

how am I supposed to use it


texts: how to change the sku id in search un url not do be come?

texts:
how to change the url key in sku id not be  come?

how to remove product name to add the sku id?

pls help me?


texts: magento-paypal payflow-pro- test credit/debit card works with live mode

texts:
I have configured Paypal Payflow Pro and live mode is set but when i use test card details for any card type then it accept it and successfully checkout with the same.
When i have set Payment Action -Authorization in admin payment settings then it works fine but not working when Payment action will be Sale.

what is exact issue , i am not able to trace it !


texts: Magento 2, Change On click instead of 'hover' for menu

texts: In Magento 2 for the main menu, they dropdown with hover. How to change the dropdown on click instead of 'hover'.


texts: Magento2 porto theme mobile account content missing?

texts:
I have below js replace but not working.
$('.header.content >.star-customer-login-links > .header.links').clone().appendTo('#store\.links');


texts: i want to know how to modify the search box Category Depth? it's too long,i only need Level 1 and 2 Category. thanks so much.


texts: Magento2: Difference between Developer and Default mode?

texts:
What is the main difference between these two modes Default and Development.
And why by-default Magento2 mode is default ?


texts: how add actions a grid of product in Magento 2

texts:
Can I get help with this issue?

How you can add another action in the product grid in Magento 2?

I tried doing an overwrite but does not show expected, overwrites the block \Magento\Catalog\Block\Adminhtml\Product\Grid in the file di.xml:

<preference for="Magento\Catalog\Block\Adminhtml\Product\Grid" type="Vendor\Module\Block\Adminhtml\Producto\RewriteGrid" />


texts: Magento2 upload multi select attribute new options value via CSV & also image

texts:
Magento2 How can I upload multi-select attribute new options value via import CSV & also image.
This image will then be displayed in frontend


texts: How to add label on all lines of street fields in checkout and turn then required?

texts:
Magento has a feature to define between 1 and 4 fields, how much we will want to use in the street field. I've activated 4 lines and would like to add labels line by line. I did this on the user registration and address in my account as you can see in the image below:

I do it just editing phtml and layout (XML) files. And I extend \Magento\Customer\Model\ResourceModel\AddressRepository\AddressRepository to turn required lines 2 and 3.

But on checkout I have it:

How can I add labels and turn lines 2 and 3 required on checkout?


texts: How to bring the attribute value of the simple product associated with bundle or configurable product on product detail page

texts:
We are building a website having bundles product. I want to display the attributes of the simple product associated with bundle product on bundle product detail page. I guess it is possible as if name and price can be retrieved attributes too can be.

I was searching through bundle/catalog/product/view/type/bundle/option but didn't find any solution. I tried using getAttributeName, getAttributeText etc they didn't work.

I know the answer is somewhere around there. Can anyone guide me on this.

Thanks


texts: Custom Adminhtml Grid + ORM Column Issue

texts:
When creating a custom adminhtml grid, I've run into a very strange issue when modifying the column type in the database from for instance Date to varchar:

Initially - works 100% (as type Date in the table):

$this->addColumn('credit_date',
        array(
            'header'=> $this->__('Credit
Date'),
            'index' => 'credit_date',
            'width' => '5%',
            'type' => 'date'
        )
    );

Updated to varchar in the table:

$this->addColumn('credit_date',
        array(
            'header'=> $this->__('Credit
Date'),
            'index' => 'credit_date',
            'width' => '5%'
        )
    );

After a full re-index & cache refresh, refreshing the page now only displays the column titles and no records. I found that if I rename the column name in the table & magento, it then displays 100%.

What is the reasoning behind this strange behvaior?


texts: Show custom message under every shipping option on checkout page in Magento 2

texts:
I have Successfully Created a module for custom message on shipping method but i am not able to retrieve those data under the shipping method on checkout page, please help me.
Thanks in advance.


texts: Magento 2 Add discount on bundle product on add to cart time

texts:
I have to add some discount programmatically on the time of bundle product add to cart.

So far I have developed the catalog product plugin Magento\Catalog\Model\Product function afterGetFinalPrice this plugin is worked on the basis of their child product prices so I have used another bundle price plugin Magento\Bundle\Model\Product\Price function afterGetFinalPrice but it won't return desired output.

As per the Magento default flow, Magento is applying a discount on its child product but I like to apply the discount on bundle product total price.


texts:
I have worked on localhost. It was good in localhost, but not in antoher server.I installed my magento file in the server and setup the database. But when i open the site it show the error message like bellow

There has been an error processing your request

SQLSTATE[28000] [1045] Access denied for user 'tqbasein_collect '@'localhost' (using password: YES)

Trace:
#0 /home1/tqbasein/public_html/c/collectivecraft/WebSite/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home1/tqbasein/public_html/c/collectivecraft/WebSite/lib/Varien/Db/Adapter/Pdo/Mysql.php(313): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /home1/tqbasein/public_html/c/collectivecraft/WebSite/lib/Zend/Db/Adapter/Abstract.php(459): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /home1/tqbasein/public_html/c/collectivecraft/WebSite/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /home1/tqbasein/public_html/c/collectivecraft/WebSite/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/code/core/Mage/Core/Model/Resource/Cache.php(53): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/code/core/Mage/Core/Model/Cache.php(455): Mage_Core_Model_Resource_Cache->getAllOptions()
#12 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/code/core/Mage/Core/Model/Cache.php(497): Mage_Core_Model_Cache->_initOptions()
#13 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/code/core/Mage/Core/Model/App.php(1183): Mage_Core_Model_Cache->canUse('config')
#14 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/code/core/Mage/Core/Model/Config.php(414): Mage_Core_Model_App->useCache('config')
#15 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/code/core/Mage/Core/Model/Config.php(294): Mage_Core_Model_Config->_canUseCacheForInit()
#16 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/code/core/Mage/Core/Model/App.php(413): Mage_Core_Model_Config->loadModulesCache()
#17 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#18 /home1/tqbasein/public_html/c/collectivecraft/WebSite/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#19 /home1/tqbasein/public_html/c/collectivecraft/WebSite/index.php(87): Mage::run('', 'store')
#20 {main}


texts: Update static blocks programatically > throws error

texts:
We're having some problems with our upgrade script updating the store. The error that we get is:

  A block identifier with the same properties already exists in the selected store.

I've post the code in our upgrade script in hopes that someone might be able to point out where the mistake was made:

/**
 * Get all store views associated with our brand
 * @var $stores Mage_Core_Model_Store
 * @return mixed
 * @since 0.1.0
 */
$stores = Mage::getModel('core/store')
    ->getCollection()
    ->addFieldToFilter(
        'code', array(
            'like'=> "brand_%"
        )
    )->getAllIds();

/**
 * Get all Brand About navigation blocks
 *
 * @var $navs Mage_Cms_Model_Block
 * @return mixed
 * @since 0.1.0
 */
$navBlocks = Mage::getModel('cms/block')
    ->load('brand_nav_about')
    ->getCollection()
    ->addFieldToFilter('identifier', array( 'like' => 'brand_nav_about' ) );

// Loop over each store
foreach( $stores as &$store ) {

    // Loop through each navigation block
    foreach( $navBlocks as $navBlock ) {

        $staticBlock = Mage::getModel('cms/block')
            ->setStoreId( $store )
            ->load( $navBlock->getIdentifier(), 'identifier');

        if( $staticBlock->getId() ) {
            $staticBlock
                ->setStores(array($store))
                ->save();
        }
    }
}


texts: Magento 2: URL Rewrite not working through .htaccess

texts:
I want to redirect some old URL's to new URL's I'm doing it in my .htaccess path: /root/.htaccess

<IfModule mod_rewrite.c>

############################################
## Enable rewrites

    Options +FollowSymLinks
    RewriteEngine on

    Redirect 301 https://www.example.com/store/bra_bust_lift.html https://www.example.com/intimates/womens-intimates/bra-converters.html

after that when I hit old URL it redirect me to 404 Page, it should redirect me to new URL.


texts: Region/Country portion of address not displaying in some browsers

texts:
On a mostly fresh installation on Magento 2.1.3, when a user fills out their shipping address in the checkout flow, <!-- ko text: address().region -- does not display a State.
In Chrome 55 the state displays great:

In Safari, both the country (United States) and any applicable state selected are missing from both the shipping and billings addresses that are displayed:

There are no console errors, but just blank values where these would be expected.

Where can I start looking to debug this? One of my users has also been able to repro on Chrome in Windows, which makes it even less clear to me what is going on.
Thank you!


texts: Doesn't apply coupon on the already discount products

texts:
Can I create a coupon that work with normal product but doesn't work with the already discount product?

I have Magento 1.9

I want to do this:

This is may dropdown menù on magento 1.9.2.3 I don't know why


texts: Remove item-options price from checkout cart

texts:
I'm looking for a way to remove the value of an item-option from the checkout cart, just removing the text as highlighted below:

I believe this is located in the file app/design/frontend/base/default/template/checkout/cart/item/default.phtml as "item-option"

<?php if ($_options = $this->getOptionList()):?>

            <?php foreach ($_options as $_option) : ?>
            <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option) ?>

<?php echo $this->htmlEscape($_option['label']) ?>

            <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
                <?php if (isset($_formatedOptionValue['full_view'])): ?>

<?php echo $this->htmlEscape($_option['label']) ?>

<?php echo $_formatedOptionValue['full_view'] ?>

                <?php endif; ?>

            <?php endforeach; ?>

        <?php endif;?>


texts: How to filter an order collection by cancelled items?

texts:
Is it possible to filter an Mage_Sales_Model_Order collection by item ids?

I need a collection but there are some items inside that I don't want.

I tried it with:

$canceledItemIds = array(101,102,103);
    $orderModel = Mage::getModel('sales/order')->load($order->getId());
    $orderModel->getCollection()
               ->join(array('item' => 'sales/order_item'), 'main_table.entity_id = item.order_id')
               ->addFieldToFilter('item_id', $canceledItemIds);

But that had no effect.


texts:
I want to customize category_form.xml in such a way so that, I can add custom block to the form element [say: Category Name].

Is there a way to add custom block to the Element?


texts: Add Products Manually Configuration Button Issue

texts:
Add Products Manually Button in configuration is not working properly.

I already create simple products in my admin catalog, but in during configurable product when i configure simple product then i'm facing trouble. Add Products Manually Button is not showing. when i create new simple product from configure > attribute and then select attribute and after finish this long process complete then (Add Products Manually Button) is showing and then i can select my own simple products. Please help me regarding about this issue. i'm wasting too much time due to this long process.

Please check below screenshot.


texts: How to remove special prices of products?

texts:
I am trying to update products prices with in a specific store. But when I do that, it shows me regular and special prices against each product. I want to set just one price against each product by disabling special price. How to do that? Here is my code.

$prod = Mage::getModel('catalog/product')
                    ->setStoreId($storeId)
                    ->load($prodId);
    $prod->setPrice($newPrice)->getResource()->saveAttribute($prod, 'price');
    $prod->setSpecialPrice('')->getResource()->saveAttribute($prod, 'special_price');
    $prod->setSpecialFromDate('')->getResource()->saveAttribute($prod, 'special_from_date');
    $prod->setSpecialToDate('')->getResource()->saveAttribute($prod, 'special_to_date');


texts: Logo not showing up in Magento 2.3 custom theme

texts:
I have specified a custom logo in <custom-theme-dir>/Magento_Theme/layout/default.xml as so, and uploaded the logo image file to <custom-theme-dir>/web/images/theme_logo.png, but the logo does not show up on the front end:

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

    <referenceBlock name="logo">
        <arguments>
            <argument name="logo_src" xsi:type="string">images/theme_logo.png</argument>
            <argument name="logo_width" xsi:type="number">210</argument>
            <argument name="logo_height" xsi:type="number">30</argument>
            <argument name="logo_alt" xsi:type="string">My Theme Co.</argument>
        </arguments>
    </referenceBlock>

The other parameters (width, height, alt text, etc. all show up in the image tag, but the source stays exactly as specified in default.xml.

Other sites I've worked with make a replacement in the image source attribute pointing to the static file location, but for some reason, this "conversion" in the src path is not happening.

What I'm seeing in the page source code:

What I expect to see:

<img src="*https://example.com/static/versionXXXXXXXXXXX/frontend/<Vendor>/<custom-theme-dir>/en_US/images/theme_logo.png*" title="My Theme Co." alt="My Theme Co." width="210" height="30">

I've tried blowing away the static content, changing from developer mode to production mode and default mode, etc. and completely re-caching everything, re-indexing, etc. and there is no change. The logo does not show up because it seems that the logo file is not being transferred over to the static content.

Why is this likely not happening?

I've consulted several resources including:

https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/theme-create.html#theme_logo

Replace logo.svg in default.xml not working Magento2

store logo in not loading


texts: Magento 2: How to open admin edit page in modal popup

texts:
To edit or create my data, I use the ui_component form as default.
Now I try to open the admin edit page in a modal window, but unfortuantely I HAVE NO IDEA how to do this :-(
Please help!

Christian


texts: Where to setup product dimensions (width, length, height) for shipping magento 1.9?

texts: Where to setup product dimensions (width, length, height) for shipping magento 1.9 we are trying to setup attribute but unable to fix it, can any one assist


texts: Replacing Core module javascript magento 2

texts:
I am replacing the core search module js by custom module using following code.

var config = {
    map: {
        '*': {
            'quickSearch':'All_Search/form-mini'
        }
    }
};

when i checked the requirejs-config.js file from page source i found
my configuration are inserted into file at the top

(function(require){
(function() {
var config = {
    map: {
        '*': {
            'quickSearch':'All_SearchAutoComplete/form-mini'
        }
    }
};

and core module config is in middle of file which cause to load the core/default file.
If i Changed the my Module name From All to Zall or something alphabetically sort than it works properly.
How to solve this issue.


texts: magento 1.9 remove order specific in anchor tag url

texts:
I want to specific delete order  in frontend

in

  My Account-> Myorders


texts: Translation in arabic store for You added {Product name } to your shopping cart

texts:
I want to translate "You added {Product name } to you shopping cart in arabic.
I tried this,
"You added %1 to your shopping cart.","لقد أضفت    %1 إلى  عربة التسوق .",,,,,,
But the output is https://prnt.sc/vxfex4
Please help


texts: How to send order grand total exclude VAT to on of our affiliates

texts:
we have to send order total to one of affiliate along with other bits like order ID etc.
we have managed everything but the problem is we can not fetch the order total exclude VAT.
we have used code
"

  ?php echo number_format($order->getGrandTotal(),2);"

and

  "php echo $grandTotal;"

and we have tried to remove Grand from above but it does not work.

the affiliate link is something like this

"img src='https://www.afiliatesite.com/xxxxx?ORDERID=input-order-Id!&ORDERAMNT=input-order-amount!"

can some one tell us how we can get the amount exclude VAT or php code to just reduce the total price by 20%. because we only deal inside uk and all orders include 20% VAT so if we can just reduce that, it would give us same result.

all help is appreciated.

Thank you


texts: Magento2 make simple afterSave action plugin of custom module

texts:
I am trying to create afterSave plugin for my admin form save action controller of my custom module. The purpose of this is to save some data into second table once all data completely save in first table.

Here is my di.xml file code :

<type name="Namespace\Module\Controller\Adminhtml\Options\Save">
    <plugin name="save_option_label" type="Namespace\Module\Plugin\OptionlabelSave" sortOrder="1" />
</type>

I have also created OptionlabelSave.php file inside \Plugin\ directory.

Here is the code :

<?php

namespace Namespace\Module\Plugin;

/**
 * Class OptionlabelSave
 * @package Namespace\Module\Plugin
 */
class OptionlabelSave
{
    public function afterSave(Namespace\Module\Controller\Adminhtml\Options\Save $subject, $result) {
        echo 'test save'; exit;

        return $result;
    }
}

However, when I click on save button in admin edit form I am not getting 'test save' printed on my screen. Am I missing anything here?

Please help. That would be highly appreciated.

Thanks,


texts:
I am currently having issues with frontend forms where the form keys are somehow being overwritten and displaying incorrect form keys. I am currently debugging this issue on the customer login form.

This is snapshot of the code at login.phtml, that i setup to see what the formkey value is.

  <?php
      $retrievedKey =  $block->getBlockHtml('formkey');
      echo $retrievedKey ;
      // i made a breakpoint and inspected $retrievedKey, it returned a html output <input> ... </input> with a form key value of, let's name it 'keyA'.
  ?>

ok so now after i continued the code execution, it renders the page successfully.

And now i go to inspect the form key hidden input on my chrome browser, however, it prints out a totally different form key from 'KeyA'. Let's name this new form key 'KeyB'.

Now i try and do a login, and submit the form. I inspected the request that is sent over, and it indeed passes a form key variable of value that reflects 'KeyB'.

I have placed some breakpoints at 'validate' function of

  Magento\Framework\Data\Form\FormKey\Validator

This is my comparison checker. By right, $formKey and $a should match. However, it does not.

 $formKey = $request->getParam('form_key', null); // outputs 'KeyB'
 $a = $this->_formKey->getFormKey(); // outputs 'KeyA'

Thus, the validation fails, and it redirects me back to the login page with no error message what so ever.

Things to note:

This behavior only arises in chrome and Microsoft EDGE.
Firefox works fine, no overwriting is happening
The form key that is printed out seems to be changing on each refresh. $retrievedKey doesn't refresh each time though

Things i have tried:

setup:upgrade and setup:static-content:deploy
cleared var/cache and var/generation
cleared browser cache and incognito mode

  I just can't my head around why the form-key is being overwritten?

Any help or hints on why this is happening would be great. Thanks for reading

  Update - I've done some debugging and i figured that page-cache.js is causing the issue by setting the form key again. This is due to the fact that, it is checking my cookies if a 'form_key' cookie is set, if not, create a new form key and save to cookies. The problem is, it is not able to save the cookie, that is why it keeps creating new form keys.

  Update - I have solved the issue. This is due to cookie domain issues. Thanks


texts: Magento2.2.6 : How to maintain different quantities for different websites in multi website?

texts:
I am working on Magento-2.2.6.

I created two websites for our two stores under single Magento installation. That means, i am working on Multple websites under same Magento installation

In this, i can able to maintain the price and availability individually for each website.

But, we are maintaining two different quantity suppliers for each website.

I have modified price scope from Global to website in scope under

admin > stores > configuration > catalog > catalog > price > website in scope

As of now, Qty field's scope is as Global, But as per my requirement, Qty field's scope must be as website.

So, How to manage the different quantity for each website's products?

I have searched a lot for this but didn't get any proper solution for this qty to change from global to website in scope. But, not yet get the response. And that is global field in admin. we can't modify that, Need some customization.


texts:
I am confused about magento table name defenation.

Here in magento 1 we was define in entity tag in which table name and entity was defined.

But in magento2 nothing like that .

So my question is where does it goes to find it like

$installer->getTable('helloworld')


texts: Overriding Magento\Catalog\Model\Layer\FilterList in Magento 2

texts:
In my custom module, I'm trying to override Magento\Catalog\Model\Layer\FilterList class (more precisely: I want to override function getFilters).

In the module's etc\di.xml there are:

One plugin statement
One preference statement

The plugin is working perfect, while preference is completely ignored.

    <preference for="Magento\Catalog\Model\Layer\FilterList" type="\vendor\module\Model\Layer\FilterList"/>

<type name="Magento\Catalog\Model\Product">
    <plugin name="logProductName" type="\vendor\module\Plugin\ProductName" />
</type>

I double checked all class references - all's good. Please let me know what I'm missing.

Thank you very much!


texts: Catalog Rule Round rule_price of catalogrule_product_price

texts:
How i can round rule_price from table catalogrule_product_price ?

i try to change calcPriceRule from Mage_CatalogRule_Helper_Data, no results!

have you an idea of what function save rule_price in catalogrule_product_price ?

Thanx


texts: Magento 2 How to change password length validation?

texts:
I want to change the minimum length of password checking to 8. I tried changing validation.js rules.js but seems not work.

How can I change from 6 to 8?


texts: Magento: Display custom product attribute in admin Items ordered block

texts:
I am trying to display my custom attribute value on admin order - Items Ordered block. It will show points earned for each product just like as it shows SKU and other information. The attribute value is saved in sales_flat_quote_item and sales_flat_order_item tables.

Namespace/Modulename/Block/Adminhtml/Sales/Order/View/Items/Renderer/Default.phtml

<?php

class Namespace_Modulename_Block_Adminhtml_Sales_Order_View_Items_Renderer_Default extends Mage_Adminhtml_Block_Sales_Order_View_Items_Renderer_Default
{

}

?>

app/design/adminhtml/design/design/layout/namespace/modulename.xml

<adminhtml_sales_order_view>
        <reference name="order_items">
            <action method="addItemRender"><type>default</type>
                <block>sales/order_item_renderer_default</block>
                <template>namespace/modulename/sales/order/items/renderer/default.phtml</template>
            </action>
        </reference>
</adminhtml_sales_order_view>

app/design/adminhtml/default/default/template/namespace/modulename/sales/order/view/items/rederer/default.phtml

    <?php $finalPointsEarned = ($_item->getCustomerProductPoints() * $_item->getQtyOrdered()); ?>

        <?php echo $this->__('Points Earned:'); ?>
            <?php echo $finalPointsEarned ?>

Executing above code gives below exception

Invalid method Mage_Sales_Block_Order_Item_Renderer_Default::addColumnRender(Array
(
    [0] => qty
    [1] => adminhtml/sales_items_column_qty
    [2] => sales/items/column/qty.phtml
)
)

Changing <adminhtml_sales_order_view> to <sales_order_view> does not give any output and custom prod attribute is not displayed.

Attempt Two:

<adminhtml_sales_order_view>
        <reference name="order_items">
            <action method="addColumnRender">
                <column>NORTH FACE</column>
                <block>adminhtml/sales_items_column_name</block>
                <template>modulename/sales/items/column/name.phtml</template>
            </action>
        </reference>
</adminhtml_sales_order_view>

added my custom code in name.phtml, still no output.

How do I display the value of custom product attribute on Items
ordered block ?
How do I display the same value of admin Invoice order details page ?
Is above, the best practice/method to display custom attribute on admin order/invoice/refund pages just like it displays SKU, Size and other values ?


texts:
I have a custom theme which was working fine on 2.1.9.

Just upgraded to 2.2 and noticed some blocks I used to remove are now in place.

  app/design/frontend/MyThemes/custom1/Magento_Theme/layout/default.xml

<referenceBlock name="form.subscribe" remove="true" />
<referenceBlock name="footer_links" remove="true" />

I have already removed var & pub/static contents, also deployed static content through

setup:static-content:deploy -f

Any idea?

thanks


texts: Is it possible to truncate this table by cron? It seems to be necessary because in few days the table's weight increases to about 10GB.


texts: Flush static files cache on production mode

texts:
There is something about Magento2 that troubles me so much.

When I have a website on production mode and I need to make a simple image change how I can do it?

I thought changing the image via FTP will work (with the same filename), but seems it doesn't. The image doesn't change on frontend.

Reading this question: Why static files are not generated or cached in Default or Production mode in Magento 2?

I understand on production mode the statics files are not generated until you run the command...

But then I did some tests on local that confuses me more, I set the magento on production mode, and it works fine! I change and image and when I refresh the browser the image changes. I use this VM: https://bitnami.com/stack/magento/virtual-machine

So what is happening? I understand the production mode does not generate static files, but I only replacing the images... so maybe it doesn't need to regenerate.

So the only way to make this change that I know is deleting pub/static/* and running the static-content:deploy command. Then it works, all is deleted and regenerated, but this is really annoying when you have a website that is on live. Really we have to stop the website for changing a SIMPLE image?

And another thing is, this tasks about changing images, usually, will do it a person who doesn't know about programming, so he never touched a terminal and probably never will do it.

The fun fact is that on developer mode it has this button: Flush Static Files Cache.
Really? why a developer needs this? Who really needs this is a person who doesn't have access on terminal and knows nothing about computers.


texts: Create Coupon/Price rule for first 10 Customers .(Magento 2)

texts:
I want to create a price rule in magento 2, and want that to be active only for the first 10 Customers . Is it possible to achieve that ?
Thank You !


texts: Magento\Framework\Exception\LocalizedException: The XML in file "/" is invalid: Element 'event': Missing child element(s)

texts:
i am getting below error for magento 2.4 and it is working fine in magento 2.3

Magento\Framework\Exception\LocalizedException: The XML in file
"/var/www/html/magento240/app/code/PPPL/PhonePe/etc/frontend/events.xml"
is invalid: Element 'event': Missing child element(s). Expected is (
observer ). Line: 4 Verify the XML and try again. in
/var/www/html/magento240/vendor/magento/framework/Config/Reader/Filesystem.php:156
Stack trace: #0
/var/www/html/magento240/vendor/magento/framework/Config/Reader/Filesystem.php(132)

Please find the code for /var/www/html/magento240/app/code/PPPL/PhonePe/etc/frontend/events.xml
<?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"><event name="checkout_onepage_controller_success_action">
        <!-- Do nothing -->
    </event>
</config>


texts: How to display fancybox popup when page load in magento2

texts:
I want to display popup using fancybox when page load in magento2 . How is it possible ?

Please help me....

    <!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
require([ 'jquery', 'jquery/ui','fancybox'],  function( $ ) {

     $(document).ready(function() {
        $.fancybox("#hidden");
        //alert("a");
    });

});
</script>
</head>
<body>
<div id="hidden" style="display:none;">
    Hi this is hidden
</div>

</body>
</html>


texts:
I have a problem in my store, the search returns only 1 product shows, I already did the re-index and cleared the cache.

The products also have stock and visibility for catalog and search.

http://lambegato.com.br/

Test Product: Banqueta


texts: Magento 1.9.2.2 use SQL expression in addFieldToFilter

texts:
I'm using Shop by Brand extension by Magestore guys and it stopped working when I upgraded to 1.9.2.2. I investigated the issue and found out the problem was with new security patch. So I've investigated more and figured out that in APPSEC-1063, addressing possible SQL injection Magento guys explained that the following code:

$collection->addFieldToFilter('(field1-field2)', array('eq'=>3));

Should be changed to:

$expression = '(field1-field2)';
$condition = $this->_getConditionSql($expression, array('eq'=>3));
$this->_select->where(condition);

So we can't use SQL expressions as a direct parameter of addFieldToFilter anymore.

In the extension, there's this piece of code:

// Magestore_Shopbybrand_Model_Mysql4_Brand_Collection:153
return parent::addFieldToFilter("IF(brand_$field.value IS NULL, main_table.$field, brand_$field.value)", $condition);

So the problem is right here because when I changed the code to following it works:

return parent::addFieldToFilter("main_table.$field", $condition);

Yeah, I know I should open a ticket about this (and I will) but I was curious how can I fix something like this?


texts: What is the best way to override text string in Magento module's Save.php?

texts:
I just need to change one string which is hardcoded (this was surprise for me) in

vendor/magento/module-catalog/Controller/Adminhtml/Product/Attribute/Save.php ,

in execute() method:

 $this->messageManager->addSuccess(__('You saved the product attribute.'));

I must change 'You saved the product attribute.' to another text with plugins/rewrites. As far as I know, the plugin can change only arguments' values or return value. If I will use extending the class, I can just overwrite the method, but then I have to copy-paste all the method's code.

Is there a better way to change this one string?


texts: How can manage partial payment of orders in magento 2 admin using api

texts:
I want to save due balance of payment in magento. Customer purchase order $100 paid $60 $40 are due. Any options we can mention due payment details in magento 2.
How to manage partial payment using rest api.


texts: Unable to send the cookie. Maximum number of cookies would be exceeded Magento 2.1.5

texts:
Every time I open var/Repots in magento 2 website, I found hundreds and thousands of error files all having the same message:

a:4:{i:0;s:71:"Unable to send the cookie. Maximum number of cookies would be exceeded.";
i:1;s:12555:"#0 /home/domain/public_html/vendor/magento/framework/Stdlib/Cookie/PhpCookieManager.php(116): Magento\Framework\Stdlib\Cookie\PhpCookieManager->checkAbilityToSendCookie('form_key', '........')...

I searched a lot, but I did not find a solution. The maximum number of cookies is set to 50 by default.

The problem is not happening on my browser. It mostly happens with customers using android mobile phone's browser Android Version 4.0.2 to 4.4.0.

Clearing cache or using private browsing solves the issue on the client side. However I need a server side solution. (I asked a customer to clear the cache and the problem is solved on his mobile).


texts:
I am trying to get rid of as much inline javascript as i can in my theme.  Looking at the Mage cookies js that is included in the head template, I cant see where this is used.

Can anyone explain if this is absolutely required, or if it is present for some other legacy/bc reason and can be removed?


texts: How to give a host name to magento 2 project

texts:
I need to do what is asked here https://stackoverflow.com/questions/9682262/how-do-i-connect-to-this-localhost-from-another-computer-on-the-same-network
on my magento 2 project, but when I apply the first 2 steps and use the hostname I configured the result is as in the picture below .. and the page title is 404 not found

that's what I've added to vhost file in c:\xampp\apache\conf\extra :

<VirtualHost *:80>
   DocumentRoot "/xampp/htdocs/yourParts"
   ServerName yourparts.local
</VirtualHost>

and that's in host file c:\Windows\system32\drivers\etc :

##
# Host Database
# localhost is used to configure the loopback interface
##
#...
127.0.0.1 yourparts.local


texts: Got Error While Re-index Using CLI in magento How To resolve it

texts:
I have run the command to re-index all the data using CLI but i got this Error:

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'abs', ( - i.price), IF( = 'fixed', , ROUND(i.price * ( / 100), 4)))), 0) AS `' at line 1' in /chroot/home/quickpro/quickpromos.com/html/lib/Zend/Db/Statement/Pdo.php:234

How To resolve it, i have tried by deleting all the files in Var/locks But still no luck
Please Help


texts: How to save newsletter subscription status?

texts:
I use this code to set the subscription status:

const STATUS_SUBSCRIBED     = 1;
const STATUS_NOT_ACTIVE     = 2;
const STATUS_UNSUBSCRIBED   = 3;
const STATUS_UNCONFIRMED    = 4;

...

$customer = Mage::getSingleton('customer/session')->getCustomer();
$customerID = $customer->getId();

$customerModel = Mage::getModel('customer/customer')
        ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
        ->load($customerID);

Mage::getModel('newsletter/subscriber')
        ->setCustomerId($customerModel->getId())
        ->setStatus(self::STATUS_SUBSCRIBED)
        ->setEmail("myemail@foo.com")
        ->save();

But the state is not saved and the checkbox* is not getting set in the backend. What am I doing wrong?

*the checkbox I talk about is at: Customers -> manage customers -> 'enter a customer account' -> Newsletter


texts: How can I create Gift Card for Magento Community Edition?

texts: How to create gift card for magento community edition 1.8 or 1.9? Or does anyone know a FREE Gift Card Extension?


texts: Magento 2: How to renew the category URL rewrites?

texts:
I cannot get Magento 2 to renew URL rewrites for categories. I was forced to clear url_rewrites table after some weird problems happened after importing categories and products.

Now I get something like catalog/category/view/s/regntoj/id/304/.

I have tried the following

Save the category manually (doesn't work)
Change URL key and/or "content" and save the category manually (doesn't work)
"Marketing" > "URL rewrites" and add a rewrite rule (works)

I have more than 200 categories so going to Marketing > URL rewrites and manually setup each category will take a long time.


texts:
Need to change the styles of a category without using the CSS sheet.

Could you help me?


texts: redirect to controller from script file with param in Magento2

texts:
I have created a script file in root folder of the magento as like below

<?php
error_reporting(E_ALL);
use \Magento\Framework\App\Bootstrap;
require __DIR__ . '../../app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$obj = $bootstrap->getObjectManager();
$state = $obj->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

$resource = $obj->get('Magento\Framework\App\ResourceConnection');
$connection = $resource->getConnection();
$response = $_REQUEST;
/* echo '<pre>';
print_r($response);die;*/

$unique_code= $response['unique_code'];
$this->_redirect("custom/services/custompage", ['unique_code' =>
$unique_code]);

In above code I am trying to redirect to my custom controller, with parameter,

but the above code is not working. Can anyone tell me how can we redirect to controller with parameter.

Thanks!!


texts: product image is overlayed on the product description

texts:
Just look here: http://fitzon.store.magecloud.net/hydro-whey-zero-92-biotechusa.html?___store=ita&___from_store=french

it seems that the images does not stay in the right position, is out of the div.image and for this reason is overlayed the short description.

Someone knows how to fix?
Thank you guys!


texts:
I'm trying to get the Add to cart button to appear on products that are Out of stock. I've already set the System->Configuration->Catalog->Inventory->Backorders=Allow Qty Below 0

My store previously did not allow back orders. If I add the following code:

<?php echo $this->getChildHtml('addtocart') ?>

The Add to cart appears on products that are In Stock but does not appear on products that are Out of stock.

Troubleshooting:

Inventory > Stock Options > Display Out of Stock Products is set to YES
Cleared all cache var/cache, var/session, restarted httpd
Re-indexed all indexes
Tried using default theme with same result

Still no success and as pointed out by Simon this is not a new problem. What I am having trouble understanding is why there would be the option(s) to Allow back orders and Allow stock level quantities to go bellow 0 and not have the Add to cart button.

UPDATE II

I downloaded and installed the latest version of Magento, did a fresh installation, added 2 products, one with inventory (In stock) the other without (Out of stock) have set Allow Qty Bellow 0, Show products out of stock and the same problem.

Would appreciate an explanation and a solution to this problem.


texts:
I have started reindexing process of products  using this command

php shell/indexer.php --reindexall

and it is still stuck on this step

Product Attributes index was rebuilt successfully
Product Prices index was rebuilt successfully

If I interrupt the process and repeat the reindexing process It doesn't affect the project (It is a high scale project)
Thanks in advance


texts: Magento2: Configurable product attribute issue

texts:
I have created a configurable product using Size attribute(Text swatch type).

When I create a configurable product some size also assigned to the parent configurable product automatically So even I am not using that size in child products, it also showing in filter result of that attribute.

Size attribute also used in layered navigation, so when user filter the products using size, configurable product showing in filter result.

click here for More information


texts: Where can I get all observers(events) of current page?

texts: Where in the code magento2 trigger one by one all events of observers. I want to debug it by xdebug and find all events that can be on that page.


texts: Magento 1.9 - Sanitization of Fields Required

texts: I have to find PCI vulnerabilities in the Sanitization of fields. I have one form to submit data. In this, input fields of form should be sanitized.how to add a script for sanitization in magento1.9 for input text fields.


texts: When deleting a customer group, I get the error "Associate to Website" is a required value

texts:
While deleting a customer group, I get the error ""Associate to Website" is a required value."
How to solve it?


texts: How to add flat rate shipping for order over X value?

texts:
I would like add a Shopping Cart Price rule that will offer a flat shipping fee if the cart value is over a certain amount.

I've looked at a few tutorials but most seem to offer "Free" shipping and not a flat rate if the cart total equals X amount.

The problem is the flat fee should only apply to items that are added in addition to the main item.For example, if product A is in the cart then B and C will get free shipping but the cost of shipping A will still apply


texts: 404 not found after manual installation of marketplace

texts:
I installed multivendor marketplace manually in my magento site. Everything seems to be working fine in frontend such as user is able to register as seller, add products, edit products etc.

But, while clicking on any of the sub menus under Marketplace tab in the admin panel then it redirects to 404 Not Found page except configuration which is working fine.

If someone has faced issue like this then please help me to resolve this.

I am using magento 1.9.0.1.

Thank you in advance.


texts: Is there any possibility of getting “country name” using “currency code” in magento?

texts:
I need to get the country name using currency code which i have.

Is there any possiblity?


texts: Magento modules with only Ajax Controller

texts:
I'd like to create a new module with just AjaxController. Do I need anyway to have a layout ?
I mean here is my file and code :

/var/www/html/dev/app/code/local/NameSpace/Cart/controllers/AjaxController.php

class NameSpace_Cart_AjaxController extends Mage_Core_Controller_Front_Action
{
    public function quickbuyAction()
    {
        return json_encode(array('ok' => true));
    }
}

/var/www/html/dev/app/code/local/NameSpace/Cart/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <NameSpace_Cart>
            <version>0.1.0</version>
        </NameSpace_Cart>
    </modules>
    <global>
    </global>
</config>

When i tried to call my url localhost/cart/ajax/quickbuy, its returned me a 404.
Do I miss something ?

And yes I declared my xml in the app/etc/modules folder.

Thanks for your help.


texts: Update qty on cart page doesn't work because of formkey conflict

texts:
Configuration: Varnish + Pagecache module, Redirect all pages to www. in htaccess

Issue: Whenever someone hits non-www page a PAGECACHE_FORMKEY cookie is stored. Then they get redirected to www. and another PAGECACHE_FORMKEY cookie is stored but with a different value.

My code has the formkey:

<form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
    <?php echo $this->getBlockHtml('formkey'); ?>

Tried with:

    <form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">
<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>"/>

Still doesn't work, as Mage::getSingleton('core/session')->getFormKey() outputs the second formkey. If I delete the first PAGECACHE_FORMKEY then it will work.

How can I bypass formkey verification on checkout/cart/updatePost?

(This has nothing to do with my theme, it happens with the default theme too, so I guess it is an issue with the connection that PageCache module establishes between varnish and the magento application. )


texts:
I want to get certified in Magento. My question is that whether it would be beneficial to get certified now or it would be better to wait for the time when Magento 2 certification will be available.

Please guide me, because I want to get it for a better career path.

If it is better to prepare for Magento 2.x certification, please share some good resources from where I can start preparation.

Note: I know links for Magento 1.x certification.

Thanks for your interest.


texts: I am getting an error when i run setup : Magento 1

texts:
I am getting below error:

  Call to a member function getDefaultStore() on boolean in
  D:\wampstack\apache2\htdocs\juliasvn\app\code\core\Mage\Core\Model\App.php
  on line 562

can anyone have any idea about the error?


texts:
Fatal error: Call to a member function getData() on a non-object

config.xml

    <events>
        <checkout_onepage_controller_success_action>
            <observers>
                <abandonedcart_observer>
                    <type>singleton</type>
                    <class>abandonedcart/observer</class>
                    <method>saveRedemptionInfo</method>
                </abandonedcart_observer>
            </observers>
        </checkout_onepage_controller_success_action>
    </events

Observer.php

public function saveRedemptionInfo(){

    $order_id = $observer->getData('order_ids');
    $order = Mage::getModel('sales/order')->load($order_id);

Same issue happens when I use sales_order_place_after and $order_id = $observer->getEvent()->getOrder()->getId(); . I get error-

  Call to a member function getEvent() on a non-object


texts: account information breadcrumbs in magento 1.9

texts:
I have added below to code to get the breadcrumb for account information section:

<customer_account_edit translate="label">
    <reference name="breadcrumbs">
        <action method="addCrumb">
          <crumbName>Account Information</crumbName>
          <crumbInfo>
               <label>Account Information</label>
               <title>Account Information</title>
          </crumbInfo>
       </action>
    </reference>
</customer_account_edit>

but iam not getting full bread crumb url.

screenshot:

https://prnt.sc/igd4ci

Can any one help me what is the issue.

Thanks


texts: Magento 2.3: Custom Customer Attributes are not getting saved

texts:
We are using Magento 2 Enterprise Edition and created some of the custom customer attributes via admin panel (it's one of the feature in enterprise edition though it's not available in community edition).

I can see all the new custom attributes in frontend. However, when I fill in the data and try to save, it's not getting saving but when I do the same process that is saving the data via the admin panel, it's saving without any issues.

So why am I not able to save the data from the frontend?

Any help will be appreciated!

<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->create('Magento\Customer\Model\Session');
$customergroupid = '';
if ($customerSession->isLoggedIn()) {
     $customergroupid = $customerSession->getCustomer()->getGroupId();
}
?>
<?php if(($customergroupid == x) || ($customergroupid == y)): ?>
<?php if ($block->hasUserDefinedAttributes()): ?>
    <?php if ($block->isShowContainer()): ?>
    <fieldset class="fieldset">
    <?php endif;?>
    <?php foreach ($block->getUserDefinedAttributes() as $attribute):?>
        <?php $attributeContent = $block->getAttributeHtml($attribute);?>
        <?php if ($attributeContent): ?>
            <?= /* @escapeNotVerified */ $attributeContent ?>
        <?php endif;?>
    <?php endforeach;?>
    <?php if ($block->isShowContainer()): ?>
    </fieldset>
    <?php endif;?>
<?php endif; ?>
<?php endif; ?>


texts:
At the moment i have a magento webshop running and i'm optimizing the website and theme so everything runs smooth and we can get a good score on google, GTmetrix, ...

When i do a run on our website (www.goedkoperfietsen.be) through google pagespeed i always get the "resize images" flag as high priority.
The thing is that all images on the website are optmized  with a file-optimizer. But when i track the images that need to be resized according to google it are always the product images genarted in the cache...

I hope the description is clear enough...
Does anyone has the same problem or anny idea how to resolve this?

Thanks in advance!!


texts: How to implement practically Magento 2 as a headless solution?

texts:
i want to know the process for implementation of Magento 2 as a
headless.
Actually in my case-
We have some css, js and html folders and Magento 2 in another folders
now we are trying to integrate Magento 2 Apis with frontend(i.e.
css, js and html) using some ReactJs OR Angular Js.
If you guys have any idea please guide me.


texts: Custom Attribute for quote table is not saving value

texts:
i am trying to add custom_attribute to quote table name as is_requested. this work fine, column is created. here is Upgrade schem
use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;

class UpgradeSchema implements UpgradeSchemaInterface
{

    public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        $setup->getConnection()
            ->addColumn(
                $setup->getTable('quote'),
                'is_requested',
                [
                    'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                    'length' => 255,
                    'nullable' => true,
                    'default' => 0,
                    'comment' => 'Requested Quote'
                ]
            );
        $setup->endSetup();
    }
}

now the problem is when i try to add value by this code
Magento\Quote\Model\QuoteFactory $quote;

$quote = $this->quote->create();
$quote->setCustomAttribute('is_requested', '1')->save();

value is not save in quote table.


texts:
I need to implement multiple cart rules, in particular coupon codes with compatibility rules, and was wondering if exists an extension that already does this.
I'll make you an example, let's say I got 6 types of coupons:
coupon type 1 = CT1
coupon type 2 = CT2
coupon type 3 = CT3
coupon type 4 = CT4
coupon type 5 number1 = CT5-1
coupon type 5 number2 = CT5-2
coupon type 5 number3 = CT5-3
They are all applicable on the entire cart total, but you can't use coupons of type 1 multiple times AND you can't add another coupon of type 2, but you can of other types. A quick scheme:
          CT1     CT2     CT3**   CT4**   CT5-1     CT5-2     CT5-3

CT1        ---     X       O       O        X         X         X

CT2         X     ---      O       O        O         O         O

CT3**       O      X      ---      O        O         O         O

CT4**       O      O       O      ---       O         O         O

CT5-1       X      O       O       O       ---        X         X

CT5-2       X      O       O       O        X        ---        X

CT5-3       X      O       O       O        X         X        ---

X means you can't use with that coupon type
O means you can stack them
The ones with ** you can use multiple of same type
I hope I explained it well.


texts: Magento 2 : Import product with external image URL

texts: I have a CSV file with image field is external image URL, how can I import it, hope anyone help me.


texts: In stock & Out of stock products are displaying randomly

texts:
we are using following extension in our site....

1)Search extension : https://mirasvit.com/magento-extensions/sphinx-search-ultimate.html . From this we can implement feature that if we search for Product all the In-stock products will display first and than out-of-stock products. Everything was fine.

Later we wanted to implement following feature.

2)Displaying out-of-stock products at last in the listing pages. :
https://github.com/r-martins/Magento-OutOfStockLast .

This worked fine. But Problem happened to first feature, Means after using 2nd extension, when we search for product, than in-stock & out-of-stock products are displaying randomly.

this is our search results page : http://videomergerapp.com/catalogsearch/result/?q=hot+wheels

when we debug this page , i can see SQL query and results: http://videomergerapp.com/catalogsearch/result/?q=hot+wheels&debug

i can see all the product ids with all in-stock product ids are displaying first and than out-of-stock products ids are displaying.

but in site [ listing page ] in-stock & out-of-stock products are displaying in random order.

Please help me what i need to do for working both features in one site.


texts: How to make a link to "current category page" on product page in M2

texts:
How can I create a link on "product page" to the "category page" a product is assigned?

Jesper


texts:
I get this error after install when trying to clear var/ generation, and static content deploy via command line.

[Exception] Warning: Invalid argument supplied for foreach() in /vendor/magento/module-store/Model/Config/Processor/Fallback.php on line 125


texts: Configurable not resetting after selecting either size/color

texts:
I have an issue regarding configurables and the best way I can explain it is through an example.

If I'm looking at a product with size and colors, I can first either pick size then colors, or colors then size.  Picking size first will gray out colors that are out of stock for that size. And vice versa, picking colors first will gray out the sizes not in stock for that color.

The problem arises in a situation where I pick size (medium) , then color (red), and realize I want to pick a different size now.  Naturally, I set the color option back to "choose an option" and attempt to change the size.  However, the size is grayed out for large, and only allows me to pick medium again.  Is there a way in the configurable.phtml file, or the js file to reset the choices when clicking on the "choose an option" selection?

Thanks


texts: Magento 2 - How to translate JS form errors?

texts:
In Magento 2, I try to translate Javascript messages "This is a required field."

In create account form :

I selected Spanish language but javascript errors are not translated, they appears in English.

Can you tell me what steps to take to correct this problem ?

EDIT

The message is in the following file: lib/web/mage/validation.js

$.validator.messages = $.extend($.validator.messages, {
    required: $.mage.__('This is a required field.'),
    ...
});


texts:
Is it possible to specify a minimum quantity that needs to be purchased for a grouped product?

When I create simple products, I see the option to set the minimum quantity via the "Minimum Qty Allowed in Shopping Cart" setting under the Inventory tab, but when I go to the inventory tab for a grouped product that option is not shown. I can only see three options Manage Stock, Enable Qty Increments and Stock Availability.

I'm using Magento ver 1.9.0.1 if that makes a difference.

Any help would be greatly appreciated.


texts:
I installed a Apptrian ImageOptimizer plugin for image optimization. After successful install when i go to configuration, below given error is showing.

Problem is falat error: class not found 'package_modeule_Block_Adminhtml_About' in Magento_dir/includes/src/__default.php on line 28651

I checked and found About.php in the path.
I researched and found this may be the case if this class is not declared in /etc/config.xml. How to declare it?


texts: Add filter Options in existing product attribute

texts:
I want to add filter option on product attribute which is a dropdown.

but I am not able to add this functionality on current attribute.

Below are the code which I used for above select with search but it's adding another select box and I don't want to add new select box, I need to change current one(capacity)
<field name="capacity" sortOrder="50" formElement="select">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
                <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
                <item name="filterOptions" xsi:type="boolean">true</item>
                <item name="showCheckbox" xsi:type="boolean">true</item>
                <item name="chipsEnabled" xsi:type="boolean">true</item>
                <item name="multiple" xsi:type="boolean">false</item>
                <item name="disableLabel" xsi:type="boolean">true</item>
            </item>
        </argument>
        <settings>
            <label translate="true">Capacity</label>
            <!--<validation>
                <rule name="required-entry" xsi:type="boolean">true</rule>
            </validation>-->
        </settings>
    </field>

Please let me know where I need to change to apply


texts:
I'm trying to figure out what's the point in the following vars from view.xml in the Luma theme:

    <var name="product_small_image_sidebar_size">100</var>  <!-- Override for small product image -->
    <var name="product_base_image_size">275</var>           <!-- Override for base product image -->
    <var name="product_base_image_icon_size">48</var>       <!-- Base product image icon size -->

    <var name="product_list_image_size">166</var>           <!-- New Product image size used in product list -->
    <var name="product_zoom_image_size">370</var>

I don't see they are being used in the code. Is this just an artifact or I've missed something?


texts: Magento 1.9 Import: “Invalid image file type.”

texts:
Ref:[1]: Magento 1.7 Import: "Invalid image file type."

I am also having the same issue invalid image file type. I am trying to import product images from external url.. while importing the csv file, blank files created inside the media/import folder. And shows error a87ff679a2f3e71d9181a67b7542122c. [extension] => [filename] => a87ff679a2f3e71d9181a67b7542122c ){"savedRows":0,"errors":["Invalid image file type."]}. Please help me to solve the issue


texts:
After running the composer command:
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2

I am receiving the following error:
An error has happened during application run. See exception log for details.
and in the logs:
main.CRITICAL: No key available {"exception":"[object] (RuntimeException(code: 0): No key available at Development/magento2/vendor/magento/framework/Encryption/Encryptor.php:255)"} []

Not sure why I am not getting the setup wizard.
I saw the same issue here.
Can you share your thoughts why I am receiving that error ? Thank you


texts: Newly added category attribute not saving in magento 2 backend

texts:
I followed this tutorial to add an attribute to my category :

  https://www.mageplaza.com/devdocs/magento-2-category-attributes-programmatically/

This is my installdata.php

<?php
namespace XX\XX\Setup;

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

class InstallData implements InstallDataInterface
{

    private $eavSetupFactory;

    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

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

        $eavSetup->addAttribute(
            \Magento\Catalog\Model\Category::ENTITY,
            'categ_front_label',
            [
                'type'         => 'varchar',
                'label'        => 'Label for category',
                'input'        => 'text',
                'sort_order'   => 100,
                'source'       => '',
                'global'       => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
                'visible'      => true,
                'required'     => false,
                'user_defined' => false,
                'default'      => null,
                'group'        => '',
                'backend'      => ''
            ]
        );
    }
}

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="categ_front_label">
            <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">333</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">Label For Category</item>
                </item>
            </argument>
        </field>
    </fieldset>
</form>

The new field is appearing on the back-end when i click a category but when i hit save it goes back to being a blank field, can anyone help?


texts: Magento 2 UI component. Disable field based on values of two other fields

texts:
I need the product field "disabled" attribute to be dependent from two other checkbox fields. For now I have it dependent from one field like this (DataModfier):

protected function customizeFieldSub(array $meta)
{
    $dependentPath = $this->arrayManager->findPath('show_email_for_instant_price', $meta, null, 'children');

    if ($dependentPath) {
        $meta = $this->arrayManager->merge(
            $dependentPath . static::META_CONFIG_PATH,
            $meta,
            [
                'dataScope' => 'dependent_field',
                'validation' => [
                    'required-entry' => true,
                    'validate-zero-or-greater' => true
                ],
                'formElement' => 'input',
                'additionalClasses' => 'admin__field-small',
                'imports' => [
                    'disabled' =>
                        '!ns = ${ $.ns }, index = field1:checked'
                ]
            ]
        );
    }
    return $meta;
}

I need something like this:

               'imports' => [
                    'disabled' =>
                        '(!ns = ${ $.ns }, index = field1:checked) && (!ns = ${ $.ns }, index = field2:checked)'
                ]

But it doesn't work this way. And also it doesn't allow to use functions there. How can I achieve what I want? I need the field to be disabled until you enable two checkboxes


texts: Magento 2 - ' I can't upload images on my store' gives error "wysiwyg is not under storage root path"

texts:
I need to know what may be causing the issue (wysiwyg is not under storage root path.) of not being able to upload image. Any idea would help alot.

Here is a screenshot of the error message with red highlight


texts:
In my custom news-module I got this:

<rewrite>
<fancy_url>
<from><![CDATA[/news\/(.+)/]]></from>
<to><![CDATA[news/index/view/title/$1/]]></to>
<complete>1</complete>
</fancy_url>
</rewrite>

under the <global> section atm.

How can I set this rewrite, to only rewrite frontend?

Edit (Answer 1):
I already use this:

<admin>
    <routers>
                <news>
                    <use>admin</use>
                    <args>
                        <module>Centano_News</module>
                        <frontName>news</frontName>
                    </args>
                </news>
    </routers>
</admin>
<adminhtml>
    <menu>
        <news module="news">
            <title>News</title>
            <sort_order>71</sort_order>
            <children>
                <items module="news">
                    <title>Manage News</title>
                    <sort_order>0</sort_order>
                    <action>news/adminhtml_news</action>
                </items>
            </children>
        </news>
    </menu>

And when I change it like you said, it redirects me always to the dashboard when I click "Manage News". May I miss something here :-/

Edit (Answer 2): I thought I could avoid own router. I will try it!


texts: The directory 'var/di' doesn't exist - skipping cleanup

texts: I ran the 'php bin/magento setup:upgrade' command and received this error. Can you tell why the command line shows this error? I am new to Magento 2 and had previous experience with Magento 1.


texts: "Cannot instantiate interface" but preference tag exists in di.xml

texts:
I'm getting this error when trying to load a page:

Fatal error: Uncaught Error: Cannot instantiate interface
Codazon\ThemeOptions\Framework\App\Config\Scope\ReaderPoolInterface
in /magento2/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:73

but there is

<preference
  for="Codazon\ThemeOptions\Framework\App\Config\Scope\ReaderPoolInterface"
  type="Codazon\ThemeOptions\Model\Config\Reader\ReaderPool"/>

in /magento2/app/code/Codazon/ThemeOptions/etc/di.xml. The type file exists and looks good. This is a module for new theme.

I've already tried:

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:flush
rm -rf var/generation/* var/cache/* var/di/*

Magento version is 2.1.10. How can I fix/debug this?


texts: Importance of PHP update, if Magento is patched?

texts:
Could someone reconfirm, if magento 1.8 is running  php 5.3 but has all the latest SUPEE patches installed. Is it CRUCIAL to install  php 5.6 or even php 7.0 ?

I am afraid the maximum php version magento 1.8 can handle is 5.4 (with patch). 5.5-5.6 may cause extension to break.

Is it a high risk leaving at 5.3 or possibly update to 5.4 but always keeping store patched with latest SUPEE? I realized almost 25% of the web run 5.3 at 2017.
To my knowledge SUPEE patches prevent magento form being hacked, but outdated PHP framework vulnerabilities usually compose of DoS attacks.


texts: magento 2.3 update product keep websiteIds intact

texts:
Have following code:

/** @var \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory */
$productCollection = $productCollectionFactory->create();
/** @var \Magento\Catalog\Model\Product $_product */
foreach($productCollection as $_product) {
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
$product = $productRepository->get($_product->getSku(), true);
// if(in_array(2, $product->getWebsiteIds())):
$metaDescription = "custom string based on websiteId";
$product->setMetaDescription($metaDescription);

try {
    $productRepository->save($product);
    echo "saved product ".$product->getName().PHP_EOL;
} catch (\Exception $e){
    echo "couldn't save product ".$product->getName().PHP_EOL;
}

in console i see only messages that products were saved, but when i lookup product in backend Meta description is empty.

any other way to save product so that websiteIds will be intact ?

since if use objectmanager to load product

$objectManager = $bootstrap->getObjectManager();
$product = $objectManager->get('Magento\Catalog\Model\Product')->load(1234);
print_r($product->getWebsitesIds());

i always get default website 1 meaning that i can't check if product is in another website.


texts: What is the best practice to get rid of CMS blocks getting disappear after patch installation

texts:
When CMS blocks get disappear after patch installation we normally do is:

  System > Permissions > Blocks
  Add New Block
  Block Name: cms/block
  Is Allowed : Yes

I feel it's a tricky quick fix. So, i am wondering if there are any other best practices to solve this issue ?


texts: How to account for shipping cost on free shipping items?

texts: We have some items that are free shipping. Obviously, there is a shipping cost. How do we account for this in Magento or some other solution so that we can keep track of profit/loss per order?


texts:
For some reason, I can't get the getEvent() or getRequest() to work in my observer.

<!--Create an event-->
<events>
    <controller_action_predispatch>
        <observers>
            <example_observer>
                <class>example/observer</class>
                <method>controllerActionPredispatch</method>
            </example_observer>
        </observers>
    </controller_action_predispatch>
</events>

And here is the observer:

class MasteringMagento_Example_Model_Observer
{
    public function controllerActionPredispatch($observer){
        //die("testing"); //this runs fine
        $controllerAction = $observer->getEvent()->getControllerAction();

        Mage::log($controllerAction->getRequest()->getParams());
    }
}

The die("testing") fires fine, but I can't get the rest of the observer code to work.


texts: Shipping from Multiple Origins for Tax Calculation Purpose

texts:
We are shipping products on the same order from different countries, which has tax implications in EU (shipments within the destination country have to pay the local VAT, the others the German VAT).
I was thinking about to make shipping based on shipment origin. But the shipping origin can only be set for the full website.
Would multi stock inventory help here? Or doesn't it help or is complete overkill here (we do not keep stock anyways, because everything is / can be produced on demand)


texts: Programmatically recursively enable all categories

texts: I would like to know how I can loop through recursively the entire category structure and enable every category.


texts: Magento 2: Add quantity 2 when add to cart from product view page

texts:
Add quantity 2 when adding to cart from product view page.

For only one product because it calls 2-time post request for one product.

After clearing cache and checking and some time that works, but again that problem comes in other product.


texts: What's the best practice for Magento dependencies?

texts:
Synopsis

I have a question regarding the best practices with Magento dependencies. Essentially I have a custom module that overrides Mage_Adminhtml_Catalog_ProductController this currently works providing I include the Magento core class prior to extending (generally what you'd expect).

My code looks something along the lines of:

<?php

require_once Mage::getModuleDir('controllers', 'Mage_Adminhtml') . DS . 'Catalog/ProductController.php';

class Vendor_Module_Adminhtml_Catalog_ProductController
    extends Mage_Adminhtml_Catalog_ProductController
{
    // My things go here.
}

My question is simply to understand if theres a nicer method of including core classes for overriding (see example)?

Example

require_once Mage::getModuleDir('controllers', 'Mage_Adminhtml') . DS . 'Catalog/ProductController.php';


texts:
I have a coupon code which is issued when subscribing to our newsletter. I'd like to show on the product page the discounted price with promo code applied:

Get this price for £23.45 by joining our newsletter!

The £23.45 is the price calculated once the promo code has been applied in the checkout.


texts: Magento 2: How to add a meta tag based on layout

texts:
I have 3 main categories in my stores. In order to give them a general color theme, I created 3 layouts file in app/design/Vendor/Theme/Magento_Theme/page_layout, they are named category_white , category_black , category_blue

Here is one of them (all 3 have same content actually)

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="1column"/>

</layout>

This them gives me an additional class on my <body> and I use it in my CSS to give the proper colors.

When it comes to page building, my page configuration files always refer to layout="1column" then my 3 layouts inherit from it.

Now, I want as well to add the tag : <meta name="theme-color" content="#000000" /> (with of course a different content for each of the 3 categories), but I understood that I can not do it directly from the layout files I have to do it from the page configuration files (i.e. not from page_layout folder but from layout folder).

How can I target only one layout, I tried to have my default.xml as below and it does not work.

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


texts:
I'm not having any luck getting Zend_Barcode to work in Magento 2.

Zend_PDF is working, and I notice that it has a class in:

/vendor/zendframework1/library/Zend/

but Zend_Barcode does not.

I've tried:

composer require zendframework/zend-barcode

But that isn't a version that's compatible with Magento's Zend_Pdf.


texts: Why enable first_lifetime for Magento Redis sessions?

texts:
What is the practical purpose of the first_lifetime setting for Magento 2's Redis session storage? The Magento documentation notes:

  Lifetime, in seconds, of session for non-bots on the first write, or use 0 to disable.

Is this intended to just prevent session storage from being eaten up by users who bounce?

The challenge is that this effectively turns into a timeout for checkout, because no matter many pages a user has hit on their way to checkout, every load to the checkout controller counts as a "first write" because the core controller resets the session ID. (This trumps any general session lifetime setting configured for the site.) If the purpose of the setting is just to protect cache storage from being wasted, this potential damage to conversions is too high a price, especially at the default setting of 10 minutes.


texts: Magento 2.3.1 - Deployed version mismatch

texts:
I'm trying to update my Magento 2.3.1 installation with some new files. However, it keeps referring to my OLD signed static file(s).
Inside pub/static/deployed_version.txt the number is updated, however, on the frontend it keeps referring to the old version that USED to be there.
What I've tried:
No result:

bin/magento cache:clean
bin/magento cache:flush
bin/magento index:reindex

No result:

empty directories pub/static, var/view_preprocessed, generated
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy en_US nl_NL
bin/magento cache:clean
bin/magento cache:flush

I've tried to disable Developer > Sign Static and tried it with enable..no result.
If I check the directories, the files are created, but it keeps referring to the OLD version of static files.
This is on a production setting.


texts: Magento : How to Create Recent Orders Block on CMS Page or Static Block

texts: Which code should be used to create Recent Orders Block; like on the customer dashboard; on CMS page or Static Block; I would like to put this on the front page.


texts: Magento2: Lareyed navigation - how to select multi category name

texts:
Currently from filter is possible only select one option from one attribute:
https://prnt.sc/tkjrep
Is any way to display products from example both option from one attribute?
example:
https://prnt.sc/tkjru2
I try combinate in this way:
https://domain.com/women/beauty-women/makeup-women.html?cat=1561`?cat=1551`
add second to url: ?cat=1551  but this solultion no work.
Any other soltuion?