texts: Change related products from observer, when there are no related products

texts:
I'm writing an extension that dynamically change related products, eg decide which related products to show during page load.

Basically I listen to the catalog_product_collection_load_after event, temper with the collection, and let Magento cerry on. this works great for products that have related products to show and I just override them.

Unfortunately, someone at Magento though it was real smart to NOT emit the "catalog_product_collection_load_after" for whatever reason, so I can't do this with products that have no related products at all.

Also, I don't like this method because it load useless products which I override anyway.

Looking at the related products code (Mage_Catalog_Block_Product_List_Related) it will be quite challenging to edit the collection from outside. Even if I change the collection the block will just overwrite it in _prepareData. So I need to somehow catch it right after the lines:

$this->_itemCollection = $product->getRelatedProductCollection()
            ->addAttributeToSelect('required_options')
            ->setPositionOrder()
            ->addStoreFilter()
        ;

And before its actually rendered.

I also tried to listen to core_layout_block_create_after event and dynamically push a single related product just so the event will be emitted and I can override it, but it didn't work. I tried to push it like this:

$data=array("560"=>array('position'=>1));
$product->setRelatedLinkData($data);

Any tips or ideas how can I manage to push my own related products from extension even when product have no related products?

Note: I don't want to actually edit the DB. It must be pushed dynamically from some observer.

Thanks!


texts: Obtain list of actively used locales - Magento 2 CLI

texts:
I know that with bin/magento setup:static-content:deploy en_US en_GB I can generate the static content for the above two locales.

How can I look up which locales are actively being used by a store (Imagine someone gave you ssh logins to a store you don't know which locales are used)?

So effectively I am looking for command XXX which should produce en_US en_GB (ideally something that is supported on 2.1)


texts: Sync google cloud storage with CDN to products images

texts:
I have a GCS folder with all my products images and now I've configured a CDN (always with Google) linked to this source. I would use these images for my Magento 2 store, specifically, I 'd like to be able to link each product to image into my google storage bucket.

Any suggestion?


texts:
I want to create a php rule inside the /template/tax/checkout/shipping.phtml template, that checks if the subtotal is below a specific value.

I use a shopping cart rule, to apply free shipping above $30.00.

So I want to display the shipping cost or free shipping inside the cart.
So I need to create a php rule that checks if the subtotal is greater than 30, to display the free shipping or shipping cost.

How can I create that line?


texts: Call to a member function getId() on null in /lib/Varien/Data/Tree/Dbp.php

texts:
When I want to switch the store view under Catalog->Manage Categories, from "All store views" to a specific one, I always get this exception:

 Call to a member function getId() on null in
 <magento_path>/lib/Varien/Data/Tree/Dbp.php on line 331.

 328   public function loadEnsuredNodes($category, $rootNode)
 329   {
 330        $pathIds = $category->getPathIds();
 331        $rootNodeId = $rootNode->getId();

$rootNode is null but should be an object. I need to get to know why.
I've been also resetting the categories using this sql script

https://gist.githubusercontent.com/jklance/9664371/raw/ca576984785a1cf476a31f6b93f5353752b3c1ea/magento_removeAllCategories.sql

but the problem still exists.


texts:
I am bugging on this problem for couple of days already. First the pictures were not even moved to catalog/product/X/Y/XYimage.jpg. I solved this and the images are copied and placed in the correct corresponding directory, but now they are not shown up in the admin panel. The product is imported successfully, and when I open it and check its images - there is none.

The function looks like that:

protected function _getImages($product)
    {
        $imageList = array();
        $importImagesDirectory = Mage::getBaseDir().DS.Mage::getStoreConfig('xmlimport/product/import_images_dir');
        $images = $product->xpath('//ns:Darstellung/ns:Info[@Art="Bild"]/@Wert');
        $imgCounter = 0;
        foreach($images as $oneImage)
        {
            $addImage = $this->_getDefaultEmptySettings();
            $addImage['_media_image'] = $importImagesDirectory . (string)$oneImage['Wert'];
            $addImage['_media_attribute_id'] = Mage::getSingleton('catalog/product')->getResource()->getAttribute('media_gallery')->getAttributeId();
            $addImage['_media_is_disabled'] = 0;
            $addImage['_media_position'] = $imgCounter;
            $addImage['_media_lable'] = (string)$oneImage['Wert'];
            $addImage['image'] = (string)$oneImage['Wert'];
            $addImage['small_image'] = (string)$oneImage['Wert'];
            $addImage['thumbnail'] = (string)$oneImage['Wert'];
            $imgCounter += 1;
            $imageList[] = $addImage;
        }
        return $imageList;
    }

then I am calling this function, and I assign the $imageList array to the array, that builds the complete product and imports it.
A single image in the $imageList array looks like that:

Array
(
    [sku] =>
    [_type] =>
    [_attribute_set] =>
    [_media_image] => C:\htdocs\my_repository\media/import/bildname_2.jpg
    [_media_attribute_id] => 88
    [_media_is_disabled] => 0
    [_media_position] => 1
    [_media_lable] => bildname_2.jpg
    [image] => bildname_2.jpg
    [small_image] => bildname_2.jpg
    [thumbnail] => bildname_2.jpg
)

So it is correct. When I debug and I come to the function _saveProducts() in app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php and to the exact following code:

           if (!empty($rowData['_media_image'])) {
                        $mediaGallery[$rowSku][] = array(
                            'attribute_id'      => $rowData['_media_attribute_id'],
                            'label'             => $rowData['_media_lable'],
                            'position'          => $rowData['_media_position'],
                            'disabled'          => $rowData['_media_is_disabled'],
                            'value'             => $rowData['_media_image']
                          );
                    }
//CLUE -> _media_image IS ALWAYS NULL

So I believe, that everything is going smooth until the images are copied and placed in the catalog/product folder, BUT THEY ARE NOT SET in the back-end. But this is going deep and I don't know where to search anymore...

I would appreciate any help!


texts: Minicart - Html text reflecting raw , required formatted text in magento 2

texts:
In mini cart i am trying to put a custom/formatted text but it reflecting raw html over there, required for magento 2.

Using Magento 2.2.4.

I expect html formatted text but the actual output raw text on minicart

Detail Page

Minicart


texts: assign guest customer address to register customer

texts:
Scenario:
A user placed an order as guest, next time when he placing an order he  is registering as customer.

I managed to manually assign his old orders to new registered account based on his email address

Now  my question is:
How can I assign the old addresses to his new account?

If any of you have done that previously, please give any pointers to achieve this. Please, feel free to provide other better alternatives, if my thoughts are wrong somewhere. I'll greatly appreciate any help, thanks in advance.


texts: Swapping Less for Sass / Removing an argument previously added to type via di.xml in Magento2

texts:
So I am investigating Ben Mark's claim that is really easy to switch out the PHP Less pre-processor for a Sass one. https://twitter.com/benmarks/status/590219053437833217 (I don't buy it)

I have implmented a Sass Preprocessor and added in it via di.xml as below:

<type name="Magento\Framework\View\Asset\PreProcessor\AlternativeSource">
    <arguments>
        <argument name="alternatives" xsi:type="array">
            <item name="scss" xsi:type="array">
                <item name="class" xsi:type="string">TheExtensionLab\SassPreProcessor\PreProcessor\Adapter\Sass\Processor</item>
            </item>
        </argument>
    </arguments>
</type>

Which now processes my .sass files into .css files (mabey not use best PHP libary yet but no worries can change that later).

However I no longer want the .less files to be preprocessed. Is it possible to remove an argument via di.xml that has allready been added to a type? In this case less is allready added to AlternativeSource in Magento/Developer/etc/di.xml. I tried adding a empty node with the same item name but that didn't do the trick for me.

I could ofcourse just create a completely empty base theme that doesn't have any .less files in but that sucks because then I would also have no template files/layouts and would have to create those and keep them up to date.

Current progress : https://github.com/TheExtensionLab/Magento2Sass

If we can do this then that also brings up the issue of admin styles that are currently also .less but cross that bridge when we come it it.

Or if there is an alterative way to do this not have the overhead of the .less files but also have my theme and templates from the blank theme I am all ears.


texts:
I have written a helper function that should take any product from a list.phtml, check if it has a parent (config) and if so return the parent's url instead of the simple product's url.

 public function getProductUrl($product)
    {
    if ($product->getTypeId() != \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) {
        return $product->getProductUrl();
    } else {
        $ids = $this->_config->getParentIdsByChild($product->getId());

        if (isset($ids[0])) {
            $configProduct = $this->_productRepository->getById($ids[0], false, $this->_storeManager->getStore()->getId());
            return $configProduct->getUrlModel()->getUrl($configProduct);
        } else {
            return $product->getProductUrl();
        }
    }
}

It basically works but it does not return the SEO url for the config product.
It looks like this: https://www.example.com/catalog/product/view/id/29/s/my-awesome-product/category/4/

For testing I also tried to load the entire product before creating the url, no difference.

What can I do to make it return the SEO url?

Thank you


texts: Magento 2 Setup Upgrade Base table or view not found How To Find Which Module Is Causing It or Which File?

texts:
I'm getting this error on running php bin/magento setup:upgrade -vvv
Schema creation/updates:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'farouni_mage255.mg0f__moulay' doesn't exist, query was: SHOW CREATE TABLE mg0f__moulay
I have no idea which module is causing this, I've searched the source code for "moulay" but not found it so it is some sort of variable being used, any idea how to get Magento 2 to report back where it is getting this table creation code from like which module is causing this error, and even better which file?


texts: Why is Flat Rate shipping not configurable on a store level?

texts:
Wondering if this is a bug or this was a design decision?

How should I go about it if I want to enable flat rate for only one of my store?

a) Try to make the default "Flat Rate" work on a single store & stay disable on all others?

b) Just create a new shipping method which I can configure on a store level and I just enabled it on the store I want?

Thoughts?


texts: Module Swatches. When you select attributes in product list does not change the price

texts:
The problem is detected at the default magento 2.1

Different size different price. The item card when switching attribute price changes.

In the product list price does not change.

Screen - http://joxi.ru/YmE1wlLHZQ4d9m

What could be the problem ?


texts:
I've added two category attributes successfully to magento admin. However when I run an upgrade script to add another, "core_resource" takes note of my module update but doesn't install the new attribute.

Here is my upgrade-1.0.1-1.0.2.php

<?php
$this->startSetup();

$this->addAttribute('catalog_category', 'is_brand', array(
    'group'                     => 'Display Settings',
    'type'                      => 'int',
    'input'                     => 'select',
    'source'                    => '',
    'label'                     => 'Is a brand?',
    'backend'                   => '',
    'visible'                   => 1,
    'required'                  => 0,
    'user_defined'              => 999,
    'default'                   => 0,
    'global'                    => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
));

$this->endSetup();

and as mentioned I updated config.xml to <version>1.0.2</version>

Nothing is added to the admin panel, no errors, no log errors.

Any ideas?


texts: Magento 2 and change CSS styles - in LUMA - as a child theme

texts:
We have created a Luma child theme, and trying to figure out, how to make some CSS-changes?! For instance, change the footer and header background color? The _extend.less doesn't work, and adding a custom css-file to include on all pages, doesn't work either. The first problem, is to find the class  somewhere. Anybody who can shed some light on this, just to get us started, if that simple?

Thanks in advance,


texts: How to Hide Custom Payment Method in the Checkout Page?

texts:
I want to hide custom payment method in the checkout page when we have certain brand for example: "Rolex" in the cart. The Custom payment method code is: "c1v3finance". My code in the methods.phtml is like below.

<?php
    $methods = $this->getMethods();
    $oneMethod = count($methods) <= 1;
?>
<?php if (empty($methods)): ?>

        <?php echo $this->__('No Payment Methods') ?>

<?php else: ?>

<?php
    foreach ($methods as $_method):
        $_code = $_method->getCode();
?>

            <input id="p_method_<?php echo $_code ?>" value="<?php echo $_code ?>" type="radio" name="payment[method]" title="<?php echo $this->escapeHtml($_method->getTitle()) ?>" onclick="payment.switchMethod('<?php echo $_code ?>')"<?php if($this->getSelectedMethodCode()==$_code): ?> checked="checked"<?php endif; ?> class="radio" />
            <label for="p_method_<?php echo $_code ?>"><?php echo $this->escapeHtml($this->getMethodTitle($_method)) ?> <?php echo $this->getMethodLabelAfterHtml($_method) ?>

        <?php if ($html = $this->getPaymentMethodFormHtml($_method)): ?>
        <?php $formArray[] = $html; ?>
        <?php endif; ?>

<?php endforeach;
    endif;
?>

<?php
    foreach ($formArray as $_form):
        echo $_form;
    endforeach;
?>

Please anyone help me on this. Thanks


texts: Disable parent link and only sub categories can click

texts:
How can I make the Parent link show but without anchor and can still hover so the sub categories will show and can click?

And is there a way for me to remove the "View all" link only under a specific parent link?

Thanks!


texts: Magento 2 How to load shopping cart price rule using ID

texts: How to get condition and description of cart price rule using ID programmatically, in Magento 2.


texts:
I split my database on 3 parts.
In my env php is set default, but in one of my model i need to connect to table wich located in different db.
How can i change target db?


texts:
In Firstname i don't want to insert special character and in email only insert valid email id

<table name="feedback" resource="default" engine="innodb" comment="mage2 tv example brand table" charset="utf8" collation="utf8_general_ci">
    <column name="feedback_id" xsi:type="int" padding="11" unsigned="true" identity="true" comment="Feedback Id" nullable="false"/>
    <column name="firstname" xsi:type="varchar" nullable="false" length="100" comment="First Name"/>
    <column name="lastname" xsi:type="varchar" nullable="false" length="100" comment="Last Name"/>

    <column name="description" xsi:type="text" nullable="true" comment="Brand Description"/>
    <column name="is_enabled" xsi:type="boolean" nullable="false" default="0" comment="Is the brand enabled?"/>
    <column name="weighting_factor" xsi:type="decimal" precision="5" scale="4" default="1" unsigned="false" nullable="false" comment="Search weighing factor"/>

    <column name="created_at" xsi:type="timestamp" default="CURRENT_TIMESTAMP"/>
    <column name="updated_at" xsi:type="timestamp" default="CURRENT_TIMESTAMP" on_update="true" nullable="false"/>

    <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
            comment="Website Id"/>

    <constraint xsi:type="foreign" referenceId="MAGE2TV_DEMO_JS_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID" column="website_id" referenceTable="store_website"
                referenceColumn="website_id" onDelete="CASCADE"/>

    <constraint xsi:type="primary" referenceId="PRIMARY">
        <column name="id"/>
    </constraint>

    <constraint xsi:type="unique" referenceId="MAGE2TV_DEMO_JS_NAME">
        <column name="name"/>
    </constraint>

</table>


texts: URLl to custom grid with filtering choose (not ui_component grid)

texts: How can I build URL to custom grid, so when I enter it some filtering is already applied. Magento 2.05. Grid is not ui-component one. I tried some answer for Magento 1.7 but did not work for me.


texts:
I am trying to upload Logo through admin panel.

When i am trying to save configuration, it is showing an error.


texts: failed to open stream: No such file or directory for static-content deploy

texts:
I have recently added a new root source css file for magento storefront by putting it in default_head_blocks.xml throught below statement.

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

Now I ran upgrade command

php bin/magento setup:upgrade

I am having the same custom.less file at below path of my custom theme.

  app/design/frontend/myvendor/mytheme/web/css/custom.less

When I now try to run deploy command Magento is giving me an error

  pub/static/frontend/myvendor/mytheme/en_US/css/custom.css):   failed to open stream: No such file or directory

I don't know if this is a version issue or not but I already tried signing off static files from backend by setting

  store>configuration>advanced>Developer>Static File Setting>Sign Static Files to No

as well as trying to run the command again with admin rights.

Still, the error persists.


texts: Checkout form validation class if passed

texts:
I'd like to add a CSS class to form inputs in checkout when they passed the validation.

Currently an error class appears when validation fails, I just want to add a passed class when validation is OK, or maybe find a way to differenciate not yet filled fields from validated fields.

Any idea ?


texts: Prices tab is gone in my custom product type

texts:
I've created a custom product type but it appeared that it lost "Prices" tab.

On the screenshot, on the left are the tabs for default product, on the right - my new product's tabs. How do I restore the prices tab?

In my config.xml I have

<catalog>
    <product>
        <type>
            <email_marketing translate="label" module="ContactologyProduct_LogProductUpdate">
                <label>Email Marketing</label>
                <model>ContactologyProduct_logproductupdate/product_type</model>
            </email_marketing>
        </type>
    </product>
</catalog>


texts: call phtml file in custom email template in magento2

texts:
I need to pass the phtml file into email template. but I'm getting error like

Error Log :

  Error filtering template: Invalid template file:
  'Vendor_Module::emailproducts.phtml' in module: '' block's name:
  'magento\framework\view\element\template_0'

I used below code in email template.

{{block class="Magento\Framework\View\Element\Template" name="email_template" area='frontend' template="Vendor_Module::emailproducts.phtml"}}

Phtml template file path

app/code/Vendor/Module/view/frontend/templates/emailproducts.phtml

Thanks in advance.


texts:
I am trying to debug this error which happens whenever a logged in customer adds a coupon code during checkout.

a:5:{i:0;s:67:"Item (Mage_SalesRule_Model_Rule) with the same id "5" already exist";i:1;s:1977:"#0 /var/www/vhosts/test.devcom/httpdocs/lib/Varien/Data/Collection/Db.php(576): Varien_Data_Collection->addItem(Object(Mage_SalesRule_Model_Rule))
#1 /var/www/vhosts/test.dev.com/httpdocs/app/code/core/Mage/SalesRule/Model/Validator.php(117): Varien_Data_Collection_Db->load()
#2 /var/www/vhosts/test.dev.com/httpdocs/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php(60): Mage_SalesRule_Model_Validator->init('1', '1', 'INSTA20')
#3 /var/www/vhosts/test.dev.com/httpdocs/app/code/core/Mage/Sales/Model/Quote/Address.php(1013): Mage_SalesRule_Model_Quote_Freeshipping->collect(Object(Mage_Sales_Model_Quote_Address))
#4 /var/www/vhosts/test.dev.com/httpdocs/app/code/core/Mage/Sales/Model/Quote.php(1331): Mage_Sales_Model_Quote_Address->collectTotals()
#5 /var/www/vhosts/test.dev.com/httpdocs/app/code/core/Mage/Checkout/Model/Cart.php(458): Mage_Sales_Model_Quote->collectTotals()
#6 /var/www/vhosts/test.dev.com/httpdocs/app/code/core/Mage/Checkout/controllers/CartController.php(127): Mage_Checkout_Model_Cart->save()
#7 /var/www/vhosts/test.dev.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->indexAction()
#8 /var/www/vhosts/test.dev.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#9 /var/www/vhosts/test.dev.com/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#10 /var/www/vhosts/test.dev.com/httpdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#11 /var/www/vhosts/test.dev.com/httpdocs/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#12 /var/www/vhosts/test.dev.com/httpdocs/index.php(87): Mage::run('', 'store')
#13 {main}";s:3:"url";s:15:"/checkout/cart/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

I'm not sure what is causing the error since the coupon code works when checking out as a guest.

Has anyone had this error before and know what the cause could be? I'd appreciate any assistance please...


texts: Magento2 requirejs-config recursive class map

texts:
Here is a piece of code-sample of a requirejs-config.js file which helps understanding my question:
var config = {
    map: {
        'Magento_Module/js/class1': {
            'Magento_Module/js/class2': {
                 'Magento_Module/js/class3': 'Vendor_Module/js/class4'
             }
        },
    }
};

so basically what i want to do is to...
use class4 instead of class3 in class2 but only if class2 is used inside class1.
Is that somehow possible ?


texts: Magento 2 override block not work properly

texts:
I am overriding the Catalog Search result block but it is only showing title not product listing. Can anyone tell what i missed here?

di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
        <preference for="Magento\CatalogSearch\Block\Result" type="Test\Test\Block\Result" />
</config>

Result.php

namespace Test\Test\Block;

class Result extends \Magento\CatalogSearch\Block\Result
{

    public function getSearchQueryText()
    {
        return __("Search results for: '%1'", $this->catalogSearchData->getEscapedQueryText());
    }

}


texts:
all. I'm using MacOS High Sierra.
I have so many problems with installing magento 2. For example: now I need use command :

bin/magento setup:install --admin-firstname=pavel --admin-lastname=konchych --admin-email=admin@example.com  --admin-user=pavelkonchych --admin-password=xdemonx1234  --db-name=magento2 --db-user=root --db-password=root

But how you can understand - where I have an error :

    Starting Magento installation:
File permissions check...
[Progress: 1 / 513]
Required extensions check...

  [Exception]
  Missing following extensions: 'mcrypt' 'intl'

If you want to sad about extensions in php.ini - I can say, that is not a problem because I have all need extensions without ;

    ; Extensions

MAMP_apc_MAMPextension=apcu.so
MAMP_apc_MAMPextension=apc.so
extension=imap.so
extension=gettext.so
extension=mcrypt.so
extension=pgsql.so
extension=pdo_pgsql.so
extension=intl.so

MAMP_Imagick_MAMPextension=imagick.so
MAMP_Tidy_MAMPextension=tidy.so
MAMP_Oauth_MAMPextension=oauth.so
MAMP_Igbinary_MAMPextension=igbinary.so
MAMP_Memcached_MAMPextension=memcached.so
MAMP_Redis_MAMPextension=redis.so
;extension=uploadprogress.so
;extension=yaml.so

And at the end of a question, I want to add screenshot where we have something strange - if I'm trying to check these PHP extensions in wizard install - we don't have any errors

I want to know, how I can disabling this checking or what I must doing?!?

In php_error.log :

[27-Oct-2018 07:52:23 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php7.0.31/lib/php/extensions/no-debug-non-zts-20151012/intl.so' - dlopen(/Applications/MAMP/bin/php/php7.0.31/lib/php/extensions/no-debug-non-zts-20151012/intl.so, 9): image not found in Unknown on line 0
[27-Oct-2018 07:52:25 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php7.0.31/lib/php/extensions/no-debug-non-zts-20151012/intl.so' - dlopen(/Applications/MAMP/bin/php/php7.0.31/lib/php/extensions/no-debug-non-zts-20151012/intl.so, 9): image not found in Unknown on line 0
[27-Oct-2018 07:52:37 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php7.0.31/lib/php/extensions/no-debug-non-zts-20151012/intl.so' - dlopen(/Applications/MAMP/bin/php/php7.0.31/lib/php/extensions/no-debug-non-zts-20151012/intl.so, 9): image not found in Unknown on line 0
[27-Oct-2018 07:52:38 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php7.0.31/lib/php/extensions/no-debug-non-zts-20151012/intl.so' - dlopen(/Applications/MAMP/bin/php/php7.0.31/lib/php/extensions/no-debug-non-zts-20151012/intl.so, 9): image not found in Unknown on line 0


texts:
It all started when i was not able to install modules on my site due to cron job not running. But due to permission errors and all, and after following some steps shown in devdocs magento. My site and backend crashed. I suspect it is due to changing deploy mode to production. Now im not able to change my mode( not permitted) and my back and frontend look like this

Unable to install Modules Magento 2.2 ( Readiness Check Error)

my follow up post


texts: How to re-initialize requirejs after append HTML content into document?

texts:
I try to added HTML + RequireJS to  DIV tag via ajax loading.

With content contain tags like <script type="text/x-magento-init"> or data-mage-init attribute, It's easy to bind event using $('#selector').trigger('contentUpdated'). In the case, it can be re-initialize on mage/apply/main using function:

    function init(el, config, component) {
      require([component], function (fn) {

        if (typeof fn === 'object') {
            fn = fn[component].bind(fn);
        }

        if (_.isFunction(fn)) {
            fn(config, el);
        } else if ($(el)[component]) {
            $(el)[component](config);
        }
      });
   }

And I know we can be switch <script> require(...)</script> on append HTML to <script type="text/x-magento-init">.

But I want to try another way to re-init requirejs. Any ideas for this issue?


texts: Why does Magento's API allow you to pull credit card information?

texts: I noticed Magento's API allows you to get order credit card information. Why is this an option?


texts:
My problem:

I'm trying to debug a CRON that is only hitting maximum execution time exceeded at a certain time. My theory is that it's running in the same process as some heavy Magento CRON process and that process hitting the maximum execution time is causing the register_shutdown_function() in my CRON to trigger, sending me an annoying email every night.

Example:

<crontab>
    <jobs>
        <kungfoo>
            <schedule><cron_expr>0 10 * * *</cron_expr></schedule>
            <run><model>kungfoo/do::things</model></run>
        </kungfoo>
        <heavy_cron>
            <schedule><cron_expr>0 10 * * *</cron_expr></schedule>
            <run><model>heavy_cron/do::lots_of_things</model></run>
        </heavy_cron>
    </jobs>
</crontab>

Question:

Will Magento run these both in the same PHP process, or does it use a separate PHP process for each one.


texts:
I have Magento v2.0.17. I want to Upgrade Magento 2.0 to 2.3. Is it possible to upgrade direct 2.0 to 2.3?

Please let me know which Magento version stable now.

Which functionality will break in Magento website after the upgrade Magento 2?


texts: Magento2: Validation failed error on deleting store

texts:
I just deleted 3 storeviews for a customer. When attempting the fourth it gives a general 'validation failed' in the (red) magento notification system.
I put a tail on the system.log & the exception.log. But it does not give any indication of the cause of this 'validation failed' error.
Could anyone point me in the right direction as where I can find the cause of this validation error (or solve it ofcourse) or adminhtml validation errors in general?


texts: Magento 2 on C9. PHP memory_limit problem

texts:
I installed Magento 2 on C9.

I installed PHP 7, with all necessary extensions (curl, mbstring, mcrypt and etc).

I set the php memory_limit 4096M.
https://nimbus.everhelper.me/client/notes/share/905628/sxvelb6o5xrt3q0tilem

But when I try to enable any extension
I receive this error.
https://nimbus.everhelper.me/client/notes/share/905618/itnd4qy7g7caitzgrrmv


texts: Magento After Patch 9767 product not added in wishlist

texts:
I am facing issue adding product in wishlist (magento version 1.9.2.4).

Here is scenario,

Step 1 :- Make sure customer not logged in.

Step 2 :- Go to product list page and click "Add to wishlist"

Step 3 :- it will redirected to login page.

Step 4 :- Now you can check product not added in wishlist.

I have traced patch files and found issue

SUPEE-9767-1.9.2.4\app\code\core\Mage\Customer\Model\Session.php

public function setCustomerAsLoggedIn($customer)
{

$this->setCustomer($customer);
$this->renewSession();
// if we comment following line its working fine
//Mage::getSingleton('core/session')->renewFormKey();
Mage::dispatchEvent('customer_login', array('customer'=>$customer));
return $this;
}

But its not correct solution for it.

Please give better solution than above code.

Thanks,


texts: Magento shopping cart rule exclusion logic

texts:
I am trying to create a shopping cart rule which excludes special price products

I have set the condition as below

If ALL  of these conditions are TRUE :
If an item is NOT FOUND  in the cart with ALL  of these conditions true:
Special Price  greater than  0

It works fine when I add a regular price product in the cart, the discount is applied, but if I add a regular priced product and special priced product, the coupon shows up as invalid.

I would like the coupon to be applied to the regular priced product and exclude the special priced product

What is the right condition for this logic?

UPDATE:

I have narrowed the issue to only bundled products, I am not able to apply any rules to bundled products, magento only applies the rule to the individual items in a bundle, how to make magento apply the rule to the bundle instead of the items in the bundle?

Thanks in advance.


texts: INR not convert in to dollar in paypal in magento 1.9.1

texts:
I am not able to convert INR To Dollar in magento 1.9.1, my base currency is INR.It's working on perfectly on ccavenue module but in the case of payPal it is not convert INR in to Dollar in PayPal. I have tried lot but not success. Below are links i.e. which are used by me.

https://stackoverflow.com/questions/28382883/magento-paypal-payment-showing-100-inr-as-100-usd

How to change currency on checkout with paypal

https://stackoverflow.com/questions/28043933/convert-to-usd-payments-made-with-paypal-for-unaccepted-currencies-in-magento


texts: If somebody buy something from my magento website, how can I know this? Is magento sending information e-mail about orders to admin? or we have to check from backend?


texts: Restrict products by override the function isSalable()

texts:
there are some products which could only shipped to specific countires.
I created an attribute to set allowed countries for each product.

In frontend the cart button should be hidden and a info message should be shown.

My try is to override the function isSalable().
This works well but Magento shows the message that the product is out of stock.
But there should be a message like this: "This product is not available in XY".

class Me_Mymodule_Model_Product_Type_Simple extends Mage_Catalog_Model_Product_Type_Simple
{
    public function isSalable($product = null)
    {
        $salable = parent::isSalable($product);
        if($salable && $this->getProduct($product)->hasData('allowed_countries')) {

            $customer = Mage::getSingleton('customer/session')->getCustomer();
            $shippingAddress = Mage::getModel('customer/address')->load($customer->default_shipping);
            $allowedCountries = explode(',', $this->getProduct($product)->getData('allowed_countries'));

            if(is_array($allowedCountries) && !empty($allowedCountries[0])) {
                $salable = in_array($shippingAddress->getCountryId(), $allowedCountries) ? true : false;
            }
        }
        return $salable;
    }
}

Some ideas?

Udate:

addtocart.phtml

<?php $_product = $this->getProduct(); ?>
<?php $buttonTitle = $this->__('Add to Cart'); ?>
<?php if($_product->isSaleable()): ?>

        <?php if(!$_product->isGrouped()): ?>

                <?php echo $this->__('Qty:') ?>
                <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getProductDefaultQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />

        <?php endif; ?>
        <button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><?php echo $buttonTitle ?></button>
        <?php echo $this->getChildHtml('', true, true) ?>

<?php endif; ?>


texts: Add CMS block to bottom of each product list

texts:
I would like to add a CMS block to the bottom of each product list whehter it is on a category page or the search result page. Since I would like to add it on every list I'll try to do this via layout customization within default.xml of my theme.

Unfortunatelly I'm not able to reference on the related container or block.

I'm able to add a block to the content container by using following code:

<referenceContainer name="content">
    <block class="Magento\Cms\Block\Block" name="block_category_below_collection">
        <arguments>
            <argument name="block_id" xsi:type="string">block_category_below_collection</argument>
        </arguments>
    </block>
</referenceContainer>

But this show the cms_block on every page at the top, not only at th bottom of product lists. I tried other reference names like:

<referenceContainer name="category.products.list">
<referenceBlock name="category.products.list">

But I'm not sure which is the correct one and I'm not able to determine it by my self. Enabling template and block hints states that the template file is /var/www/html/px.local/mage22/vendor/magento/module-catalog/view/frontend/templates/category/products.phtml and the related block is "Magento\Catalog\Block\Category\View".

But here I'm stuck.

Can anyone help to determine how to add the CMS block?


texts: Set Product as New from Date - Reverts to random date in past after clicking out of product edit

texts:
We have an issue with using New From Date as filter in product grid

Steps
- on admin go to products > catalog
- in columns make sure you have 'set product as new from date' selected
- in filters apply a date range in new from date
- click into a product and save and close

expected result:
- inputted data in filter fields remains the same

actual result:
- inputted data in date fields changes to one in the past, though the results seem to be correct.

Not sure if this is a M2 bug, has anyone experienced it or try to replicate?

UPDATE

So it seems there is a problem with this function

dateFormat = this.shiftedValue() ? this.outputDateFormat : this.inputDateFormat;

 /**
     * Prepares and sets date/time value that will be displayed
     * in the input field.
     *
     * @param {String} value
     */
    onValueChange: function (value) {
        var dateFormat,
            shiftedValue;

        if (value) {
            if (this.options.showsTime) {
                shiftedValue = moment.tz(value, 'UTC').tz(this.storeTimeZone);
            } else {
                dateFormat = this.shiftedValue() ? this.outputDateFormat : this.inputDateFormat;

                shiftedValue = moment(value, dateFormat);
            }

            shiftedValue = shiftedValue.format(this.pickerDateTimeFormat);
        } else {
            shiftedValue = '';
        }

        if (shiftedValue !== this.shiftedValue()) {
            this.shiftedValue(shiftedValue);
        }
    },

seems it's not able to retrieve the shiftedValue so it uses this.inputDateFormat (YYYY-MM-DD) instead of this.outoutDateFormat (MM/DD/YYYY)

replacing it as

dateFormat = this.shiftedValue() ? this.outputDateFormat : this.outputDateFormat;

works.

Any idea to fix properly the bug?


texts: How to get customer registration form into CMS page

texts:
Is possible to create a CMS page with some content and Magento registration form .The registration form will function same as the default register form,when submitting the registration form the data will be passed to database.

Is it possible?


texts:
Where is the event name located in configuration? For example I'm looking for checkout_onepage_controller_success_action event.
Where is it stored in configuration?

Mage::dispatchEvent(
    'checkout_onepage_controller_success_action',
    array('order_ids' => array($lastOrderId))
);


texts: Magento 2 custom payment method redirect to payment provider website

texts:
I'm trying to build a custom Payment module, but it's very hard to get things to work because there's no real documentation yet.
I need to redirect the customer after clicking place order to the payment provider website to process the payment then if the operation succeed customer got redirected back to store success page


texts: Upgrade to Magento 2.2.6 to Magento 2.3.1 Init vector must be a string of 32 bytes

texts:
I have upgrade magneto 2.2.6 to magento 2.3.1 and found "Unable to unserialize value. Error: Syntax error" error during run the php bin/magneto command in terminal

And browser gets

Thanks in advance.


texts: How can I get values out of html forms on the frontend?

texts:
I added a few fields to the signup form, but I needed some additional functionality, so I did it as a uicomponent. I don't know how to get the values into the backend.
I have a custom field called "interested_in", but when I submit the form, even though when I look in the network tab, I see the interested_in content along with the rest of the form data, I get a message saying "interested in is a required field".
How can I get my custom fields to submit along with the rest of the form?
Thanks
PHTML snippet
...

...

My HTML
...

        Other

            <input type="text" name="interested_in" id="interested_in" title="interested_in"
                   class="sf-other-input">

...


texts: Admin routing compatibility mode for extensions: Enable or Disable?

texts:
I have just updatet my store to the latest Magento CE 1.9.2.2 software version (not the Patch SUPEE-6788, I did the full core update using the Magento Downloader).

After the update I went to

System > Configuration > Advanced > Admin > Security

and found the Admin routing compatibility mode for extensions option to be set to Enable.

However, just below the "Enable/Disable" selector there is a short description which says

  Enabling this setting increases risk of automated attacks against
  admin functionality.

I wasn't sure if I should change this setting or not so I went to the Magento website and there it says

  To protect non-default admin URLs against automated attacks, the patch
  must be enabled by changing the routing compatibility mode in
  configuration. Use "Enable Admin routing compatibility mode" under
  System > Configuration > Admin > Security.

The people over at Byte say

  Finally, to increase security, disable the “compatibility mode”
  here:

System > Config > Admin > Security > Admin routing compatibility mode for extensions

And then they display a screen shot showing the option in Enable mode.

I find all of this very confusing so my question is what mode of this option offers most security?

Should the selector display "Enable" or "Disable" after saving the config?


texts: Menu is not showing up in certain browser

texts:
Hi I am working in magento 1.9.2.2. Menu and its submenu items are created and working fine.when I reduce the browser size in desktop the menus are appearing perfectly according to the media query. But when opened in real devices like ipad and tablet it is not visible according to the media query. What is happening. Kindly someone help me out.

This is my code to enable it after 770px of browser:

@media only screen and (min-width:770px){
 #custommenu{
 display:block !important;
 margin-top:-3px !important;}
 }


texts: Magento 2 graphql integration with Amazon Pay

texts:
I am trying to implement payment for Amazon Pay in Magento 2.4 using graphql. Magento documentation provides steps for Pay Pal (e.g. PayPal Express Checkout: https://devdocs.magento.com/guides/v2.4/graphql/payment-methods/paypal-express-checkout.html). For Pay Pal works. How to implement this for Amazon Pay?
When I try to call
mutation {
  setPaymentMethodOnCart(input: {
cart_id: "EUZwlk3kflddMgPoGe6KVDjcWm5CEgid"
    payment_method: {
      code: "amazon_payment"
    }
  }) {
    cart {
    selected_payment_method {
        code
        title
      }
    }
  }
}

then I get the error:
[2020-10-15 11:31:46] main.ERROR: Call to a member function getAmazonOrderReferenceId() on null {"exception":"[object] (GraphQL\\Error\\Error(code: 0): Call to a member function getAmazonOrderReferenceId() on null at /var/www/magento2/vendor/webonyx/graphql-php/src/Error/Error.php:174, Error(code: 0): Call to a member function getAmazonOrderReferenceId() on null at /var/www/magento2/vendor/amzn/amazon-pay-module/Plugin/ConfirmOrderReference.php:109)"} []


texts: How to add another model collection data to an array. [Magento 1.9]

texts:
I have response collection  $customerData, I have to add referral code of selected customers in the same array,
Model and field of referral code is :
 $referCustomer = Mage::getModel('rewardpointsreferfriends/rewardpointsrefercustomer')->load($TotalCustomerId, 'customer_id');

Here is part of my code
  $TotalCustomerId = array_unique($customerDi);

                $HighPriCollection = Mage::getModel("customer/customer")->getCollection()
                                                                        ->addAttributeToSelect('*')
                                                                        ->addFieldToFilter('entity_id', array('in' =>$TotalCustomerId))
                                                                        ->setPage($page,$size);

               $referCustomer = Mage::getModel('rewardpointsreferfriends/rewardpointsrefercustomer')->load($TotalCustomerId, 'customer_id');   // model of referral code

                $customerData = array();
                foreach ($HighPriCollection as $campusval)
                {
                    $customerData[$i] = array('entity_id'=>$campusval->getId(),
                                           'student_name'=>$campusval->getName(),
                                           'coll_grad_year'=>$campusval->getCollGradYear(),
                                           'student_pic'=> $customer->getCustomertabSelfee(),
                                           'college_name'=>$campusval->getCollegeName()   // Here i want to add referral code of selected students(customers)
                                           );
                              $i++;

                    $college_detail = Mage::getModel("manager/campus")->load($campusval->getGriskCollegeNewId());
                    array_push($CollegeNames, $campusval->getGriskCollegeNewId());

                }
                $HighPriCollection = $HighPriCollection->addNameToSelect()
                                                       ->addAttributeToSelect('customertab_studentpic')
                                                       ->addAttributeToSelect('group_id')
                                                       ->setPage($page, $size);
                $data = array_count_values($CollegeNames);
                if($collegeid!=null)
                {
                        $res['status']  = true;
                        $res['message'] = "High Priority Students";
                        $res['hpstu']   =  $customerData ;
                }else
                {
                    $collegeData = array();
                    $i = 0;
                    foreach ($data as $key => $value)
                    {
                        $college =Mage::getModel("manager/campus")->load($key);
                        $collegeData[$i]['id'] =$college->getId();
                        $collegeData[$i]['college'] = $college->getName();
                        $collegeData[$i]['hpstudents'] = $value;
                        $i++;
                    }
                }

I am getting all data from $customerData, need to add referral code in the same customer collection.


texts: Magento 2: How to show list of users who didn't place any order with date fliter

texts: Want to get a list of users who didn't place an order,What is the best way to get this list from magento 2 ?


texts: The main page doesn´t appear in the pages menu

texts:
I noticed that in the pages menu we have a Home Page but when I click to see the page, It sends me a blank page, and if I click in the logo it shows me the main page that has images.

Can I edit that page? where can I do that? will I need to make the home page all over again from scratch?

Thanks !!

https://i.stack.imgur.com/jONVI.jpg
this is the first page that show´s up when I go to the site


texts:
I'm trying to override the _validateUploadedFile() method from the class Mage_Catalog_Model_Product_Option_Type_File located in app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php

This is my config.xml located in app/code/local/Eps/Customizationurl/etc:

<?xml version="1.0"?>
<config>
    <modules>
        <Eps_Customizationurl>
            <version>0.0.1</version>
        </Eps_Customizationurl>
    </modules>
    <global>
        <models>
            <epscustomizationurl>
                <class>Eps_Customizationurl_Model</class>
            </epscustomizationurl>
            <customfile>
                <rewrite>
                    <product_option_type_file>Eps_Customizationurl_Model_Product_Option_Type_File</product_option_type_file>
                </rewrite>
            </customfile>
        </models>
    </global>
    <frontend>
        <events>
            <!-- Event fired when converting from a quote item (items in cart) to order item, this
             happens when checking out orders -->
            <sales_convert_quote_item_to_order_item>
                <observers>
                    <eps_customizationurl_model_observer>
                        <type>model</type>
                        <class>epscustomizationurl/observer</class>
                        <method>epsURLCreator</method>
                    </eps_customizationurl_model_observer>
                </observers>
            </sales_convert_quote_item_to_order_item>
        </events>
    </frontend>
</config>

And this is the File.php file located in app/code/local/Eps/Customizationurl/Model/Product/Option/Type:

<?php
class Eps_Customizationurl_Model_Product_Option_Type_File extends Mage_Catalog_Model_Product_Option_Type_File {

    protected function _validateUploadedFile() {
        Mage::log('Starting custom _validateUploadedFile()!', null, 'system.log', true);
    }

}
?>

The class Eps_Customizationurl_Model inside an Observer.php is working perfectly but I can't manage to overwrite the method from File.php. It keeps running the default code, not the code I'm overriding it with.


texts: Loading transactional email for different store issue

texts:
I created this file:

app/locale/fr_FR/template/email/html/footer.html

I want to load it for france. So I went to system->t.emails -> selected the Email-Footer template -> select this option value:

<option value="fr_FR">French (France)</option>

from locale and then I pressed the Load Template button , but i got the content from:

app/locale/en_US/template/email/html/footer.html

Any idea why ? I am using enterprise version:1.14.3.0.  Thx


texts:
I have a problem, whenever a user finalizes a purchase he is sent to an order tracker page. When this page is first opened it posts the order to a custom web service.

There is an IF that checks if the order already exists so it wont post it again. The problem is that the first time I open it, the order is posted correctly in the database. But if I refresh the page, it still says that the order does not exist, this happens until I run sudo bin/magento-cli setup:upgrade.

Here's the code that check if the order exists:

public function checkIfExists()
{
    if (empty($_GET['orderId'])) {
        $orderId=$this->_order->getId();
        //validate customer and load order based on Id
    } else {
        $orderId = $_GET['orderId'];
    }

    // $orderId = $this->_order->getId();
    $username = 'sixtogo-admin';
    $password = 'Af/$k!QWx76S72sX';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "https://sixtogo.herokuapp.com/consultaestatus?no_sap=300986724&org_code=169&ticket=" . $orderId);
    curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $response = curl_exec($ch);
    $err = curl_error($ch);
    curl_close($ch);
    $jsonArray = json_decode($response, true);

    if ($err) {
        echo "cURL Error #:" . $err;
    } else {
        // echo 'RESPONSE: ' . $response;
    }
    echo count($jsonArray);
    //By americo ft. Kalev
    if (count($jsonArray)>0) {
       echo "Order exists, wont post";
        return true;
    }
    echo "Order does not exists, will post";
    return false;
}


texts: Magento 1.9: How to configure Bubble Elasticsearch to search products only by title?

texts:
Now on my search results by "red" keyword appear results with title without "red", so it search in product description I think.

How to avoid this behavior?

Thanks!


texts: Magento2: State/Province not shown dropdown option in storefront

texts:
I displayed all the information in store front while creating new account. But dropdown  State/Province does not shown option.

How to uncheck this field: not required
How to delete this option from storefront ?

Can anyone help?


texts: Magento 2.3: Copy base,small,thumbnail image from store view to store view with SQL

texts:
In a particular store view, some products doesn't have set the base, small and thumbnail image. I want to set this base image from one store view to another via SQL.

How to do that?


texts: Showing the most recently added products that are set to display on this website

texts:
Magento 2.1.6
I have a module that populates a specific category with the "latest 200" new items added to my magento database.
However, it has a problem in that it doesn't account for the "Product In Website" attribute against each product. So any items that I do not yet have assigned to the website are still counted among those 200 products I am trying to display. In that case, there will be missing products from the page as they will not be displayed - no problem unless you want to add another 10,000 items to your magento database, but not display them on this website! My 200 most recent items will actually display zero items in this case.

This is the part of the code that puts together the product collection, but I think it needs reworking to take into account the problem outlined above, and to also always contain 200 products in the resulting collection.

if ($catID == 571 && $catID !== "") {
        $request = $objectManager->create('Magento\Framework\App\Request\Http');
        $productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');
        $_productCollectionlastitem = $productCollection->create()->setPageSize(1)->addAttributeToSelect('*')->addAttributeToSort('entity_id', 'desc')
                ->load();
        $lastid = $_productCollectionlastitem->getFirstItem()->getId();
        $startid = $lastid - 200;
        $storeid = 1;
        $_productCollection = $productCollection->create()
                ->setPageSize(36)
                ->setCurPage($request->getParam("p"))
                ->addAttributeToSelect('*')
                ->addStoreFilter($storeid)
                ->addAttributeToFilter('visibility', \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
                ->addAttributeToFilter('status', \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
                ->addAttributeToFilter('image', array("neq"=>'no_selection'))
                ->addAttributeToFilter('entity_id', array(
            'from' => $startid,
            'to' => $lastid
        ));
        if ($request->getParam("product_list_order")) {
            $_productCollection->addAttributeToSort($request->getParam("product_list_order"), "asc");
        } else {
            $_productCollection->addAttributeToSort('entity_id', "desc");
        }
        $_productCollection->addUrlRewrite();
        //
        $_productCollection->load();

        return $_productCollection;
    }

I think the way this collection is assembled is incorrect, starting counting at the most recent ID number of the products, but I am unsure how I might fix this.

Could anyone shine some light on how I might change this code to resolve this issue?


texts:
I have used this file for an extension of mine to add a new table but it doesn't run and gives error. Here is the code for my script.

$installer = $this;

$installer->startSetup();

$installer->run("

-- DROP TABLE IF EXISTS ` magebuzz_testimonial_store`;
CREATE TABLE ` magebuzz_testimonial_store` (
  `testimonial_id` INT(10) UNSIGNED NOT NULL,
    `store_id` VARCHAR(11) NOT NULL,
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Testimonials Store Table';

");

$installer->endSetup();

Can anyone please tell me where am i going wrong with this?
Thanks.


texts:
How to disable redirect to the cart page when adding a product to cart?

What has to be done so that the user remains on the same page when adding a product to the cart?


texts:
Add CSS class to {{block type="cms/block" block_id="my_block1"}}

This now outputs as html here, but I see widget block add a DIV tag around it with a CSS ID.

Question: How can we add a  tag around block type="cms/block" and echo some css class like the BlockId()

html here
 where my_block1 is the block id


texts:
I want to change sort by select box into <ul> <li> type by using
  javascript so I can change style css for it.  How can i do this?


texts:
I need to set a variable session in Magento, do I do just procedural PHP or is there a proper way in Magento 2 ?

Example :

$_SESSION['myKey'] = "00001";

@AnsarHunsain code help me, but I can't get my value into another page. My page and my block are on the same module than the block where I've defined getCheckoutSession.

I have this error with this :

  echo $block->getCheckoutSession()->getCommande();

  Call to a member function getCommande() on null


texts: Magento 2 - Get Custom Options Price in Transactional Email

texts:
I am trying to display on the new order transactional email the custom options for every product(in this case a configurable product), along with the price.

Custom Options are displayed by default, but the prices are not.

This is the method responsible for the custom options:

  File:
  /app/code/vendor/Email/Block/Order/Email/Items/DefaultItems.php

**
     * @return array
     */
    public function getItemOptions()
    {
        $result = [];
        if ($options = $this->getItem()->getOrderItem()->getProductOptions()) {
            if (isset($options['options'])) {
                $result = array_merge($result, $options['options']);
            }
            if (isset($options['additional_options'])) {
                $result = array_merge($result, $options['additional_options']);
            }
            if (isset($options['attributes_info'])) {
                $result = array_merge($result, $options['attributes_info']);
            }
        }

        return $result;
    }

And this is an example of the result:

'options' =>
    array (size=4)
      0 =>
        array (size=7)
          'label' => string 'Metal' (length=5)
          'value' => string '14ct Yellow Gold' (length=16)
          'print_value' => string '14ct Yellow Gold' (length=16)
          'option_id' => string '3027' (length=4)
          'option_type' => string 'radio' (length=5)
          'option_value' => string '18447' (length=5)
          'custom_view' => boolean false

As you can see there is no key for the price of the actual option;

I've tried to load the product model via productFactory injecting Magento\Catalog\Model\ProductFactory into DefaultItems.php with the following method:

public  function getProductModel($id)
    {
        $product = $this->productFactory->create()->load($id);
        return $product;
    }

and then calling the method on the template file

  app/code/vendor/Email/view/frontend/templates/email/items/order/default.phtml

like this:

$_productCustomOption = $block->getProductModel($_item->getProductId())->getProductOptionsCollection()->getItemById('3027');

Where 3027 is the id of the custom options as seen before but, because this custom option has several values with different prices, the price always return null like this:

protected '_data' =>
    array (size=19)
      'option_id' => string '3027' (length=4)
      'product_id' => string '268' (length=3)
      'type' => string 'radio' (length=5)
      'is_require' => string '1' (length=1)
      'sku' => null
      'max_characters' => string '0' (length=1)
      'file_extension' => null
      'image_size_x' => string '0' (length=1)
      'image_size_y' => string '0' (length=1)
      'sort_order' => string '1' (length=1)
      'default_title' => string 'Metal' (length=5)
      'store_title' => null
      'title' => string 'Metal' (length=5)
      'default_price' => null
      'default_price_type' => null
      'store_price' => null
      'store_price_type' => null
      'price' => null
      'price_type' => null

While if I call a custom option with only one value the price it defined.

So how do I get the price for a custom option with several values?


texts: Magento as a product information management (PIM) tool for multiple marketplaces (ebay, amazon, Rakuten, etc)

texts:
We are selling products on over 10 different platforms, each of which has different category sets. Also, we are selling internationally and a product can belong to different categories on different country shops of the same platform. For example, category A on eBay UK and category B on eBay FR. So the case is, considering the country shops we have, at most a product can belong to 36 different categories in the PIM system that we wish to develop a Magento CE into.

A category is corresponding to an attribute set. I think it is possible that we import all attribute sets from those platforms to PIM. However, a product in Magento can only be assgined to one attribute set, which means I need to first combine over 10 attribute sets into one and then assign it to the product. That is too much of work and might overwhelm the system.

Is there a solution to what we want to do with the system? Is it possible to have multiple attribute sets for a single product without actually creating a new big combined attribute set? Or, can we create multiple products in the system for the identical product, each for a store view? (website=platform, store=store view=country shop) so that I can assign each of them a smaller attribute set on platform level. I know Magento was not designed this way, but is it worth trying?

Thank you in advance for any help!


texts:
How to get image label by product id in magento 1?

I want get label image, i tryed this code but it get not all product collection, some missing. Please help me

$storeId = Mage::app()->getStore()->getStoreId();
$product = Mage::getModel('catalog/product')->load($_product->getId());
$customimg = $product->setStoreId($storeId)->getMediaGalleryImages()->getItemByColumnValue('file',$product->getData('image'));


texts: Magento - Product review page layout changes not reflecting

texts:
Totaly new to Magento and working with version 1.9.3.8.

I am trying to change the layout of product review page from 2columns to 1column by editing the review.xml file present in the following path default/layout/review.xml.

This is what my code looks like.

<review_product_view translate="label">
    <label>Catalog Product Review View</label>
    <reference name="root">
        <action method="setTemplate"><template>page/1column.phtml</template></action>
    </reference>
    <reference name="content">
        <block type="review/view" name="review_view"/>
    </reference>
</review_product_view>

The changes are not reflecting. Am I missing something somewhere?

Thanks in advance!


texts: Adding new products to a store with a template, without changing other products in the store

texts:
I have recently taken over a store at work that I did not build, nor do I have enough experience with Magento to be truly confident yet.

I have a .csv product template, to add 195 new products to a new category with 4 subcategories I have already created in the back end, judging by the file, it is based around the SKU.

I am using Magento 1.8.0.

When checking the data before import, it says that there are 15 duplicate rows. Would that be related to the products already in the store?

In the template, it does not appear to be any duplicates in the SKU column. Could another column cause a duplicate problem? If I force the import, with it replace the older SKU, which I assume is one of the older products that is no longer being sold?

I looked into the data flow import, but it appears to replace the entire product catalog, which is definitely not what I would like to do.

I understand that these are quite introductory questions, but I can't afford to do mess up the whole store because of a lack of knowledge
I'm still new at this job and I really like it!


texts: How to generate a due date using date of birth?

texts:
I had created the date of birth field and submit button.When I select the date of birth it has to generate the due date with the increment of 2 weeks,6 weeks

Ex:if the date is 1/1/2015 it has to show the due date as 22/1/2015

How i has to do this.Please suggest me.


texts: getFinalPrice returns 0.00 for some configurable products

texts:
In a Magento 2.2.6 installation we have the following configurable product for example:

The product with ID 3502 has the products with IDs 3503 and 3504 as its configurable options. All products have a price assigned.

However, when I load a product collection via

$products = $this->productCollectionFactory->create()
                 ->addWebsiteFilter($store->getWebsiteId())
                 ->setStore($store)
                 ->addAttributeToSelect('*');

and then iterate over the collection and use

$product->getFinalPrice();

the function always resturns 0.00 for the product with ID 3502 - it should be 261.84 of course.

It does work for other configurable products, but not for some. So far I have no clue why it would not work for this particular product for instance.

I also checked the flat tables and made sure they are properly indexed.

May be someone has any pointers on why Magento could possibly return 0.00 for these products for their "final price".


texts:
I know any label can be changed from i18n/en_US.csv.

But how to change as bellow picture

Could you please help for this issue ?


texts: Confused With New Order Status in Magento 2.0.6 by using with any Payment Gateway

texts:
I am new In Magento 2 platform. Can anyone please tell me with proper clarification what should be the exact order status for the order state New Order while buying through any Payment Gateway

Clarification with code description will be more helpful.


texts: magento 2 how to override select-shipping-method.js

texts:
when trying to override select-shipping-method.js in my custom module then getting this errors

1 - Uncaught Error: Script error for: Xyz_Customcheckout/js/model/quote
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:166)
    at HTMLScriptElement.onScriptError (require.js:1681)

2 - GET http://127.0.0.1/xyz/abc/pub/static/version1556282180/frontend/Xyz/theme/en_US/Xyz_Customcheckout/js/model/quote.js net::ERR_ABORTED 404 (Not Found)

requirejs -

var config = {
    map: {
        '*': {

          'Magento_Checkout/js/action/select-shipping-method': 'Xyz_Customcheckout/js/action/select-shipping-method'

        }
  }
};

select-shipping-method.js

define(
[
    'Magento_Checkout/js/model/quote',
    'Magento_Checkout/js/action/set-shipping-information'
],
function (quote, setShippingAction) {
    "use strict";

    return function (shippingMethod) {
        quote.shippingMethod(shippingMethod);
        // Update totals on summary
        setShippingAction([]);
    };
}
);


texts: Magento 2 Checkout Error Uncaught TypeError: Cannot read property 'getCacheKey' of null

texts:
I have an issue on checkout page and we are getting below error on console. It looks like address object is not loaded correctly on quote object and we are getting different error each time.

This issue comes randomly and mostly when user redirect to live payment method and comes back to the checkout page after cancelling payment.

Uncaught TypeError: Cannot read property 'getCacheKey' of null
    at UiClass.<anonymous> (billing-address.js:95)
    at Function.notifySubscribers (knockout.js:1103)
    at Function.observable.valueHasMutated (knockout.js:1300)
    at Object.observable [as billingAddress] (knockout.js:1285)
    at select-billing-address.js:26
    at UiClass.paramsHandler (billingfields.js:350)
    at UiClass.<anonymous> (ajax.js:169)
    at Function._.each._.forEach (underscore.js:150)
    at UiClass.collectParams (ajax.js:168)
    at UiClass.passPayload (ajax.js:64)


texts: How to create custom option that is common to all products

texts:
There is a dropdown list on product detail page,
That can be select-able by the user,

After the user selects an option from dropdown list and after he adds this product to the cart,

this selected option should be displayed in cart as well as checkout page,
and also displayed on transaction emails.

How can I achieve this ?

As I am new to magento, please a hint will also be helpful to me,...


texts: Pass order success url redirect url to a payment gateway

texts:
I would like to pass to an order payment a variable containing  the success url that a customer should get redirected to when the payment goes fine on the payment gateway page.
So basically I have a variable that I need to pass them.
Is there a way to achive this in magento 1.9?
this simple redirect does not work: https://myurl.com/checkout/onepage/success/


texts:
I need to add an extra, static image in the page header. Right after the logo.

My child theme directory structure in
[magento project root]/app/design/frontend/My_Vendor/My_Theme/

  ├── Magento_Theme
  │   └── templates
  │       └── html
  │           └── header
  │               └── logo.phtml
  │
  ├── media
  │   └── preview.png
  ├── registration.php
  ├── theme.xml
  └── web
      └── images
          ├── logo.png
          └── CUSTOM_TAGLINE.png

The CUSTOM_TAGLINE.png is missing in the static files, the rest works fine.

The symlinks to images are being generated in a static folder [magento project root]/pub/static/frontend/My_Vendor/My_Theme/my_language/images/. My custom logo.png appears there along with loader-1.gif which I assume comes from the parent theme. Unfortunately my custom image CUSTOM_TAGLINE.png is not there.

In my modified Magento_Theme/templates/html/header/logo.phtml I have the line echo $block->getViewFileUrl('images/CUSTOM_TAGLINE.png') that also works as expected, printing the path to the generated static folder.

What do I miss here? Do I need to declare the CUSTOM_TAGLINE.png somehow?


texts: display customized option value in shopping cart view

texts:
In shopping car view i can see only configure option that i selected in product page. i want to display customized option value too.

last option gem color is customized option.

while viewing cart

it display only 2 values. i want color value to display which i am selected.
 Can someone guide me to achiev this.
Thanks in advance


texts: How to add input fields in custom checkout step in Magento 2.1?

texts:
I have created a module to add a custom checkout step by following the answer
mentioned in this link.
    How to add new steps or tab to checkout page in Magento2

Here is the screen shot of this step.

Kindly let me know what to do to add two input fields in this step.
Thanks


texts: How do I determine the class name of a model?

texts:
This may sound like a completely dumb question, however I have been scavenging the web for answers with no success.

If need to access a particular kind of model in Magento 2, such as a product model, how do I determine its class name? I haven't been able to find any resource that lists out the available models in a default Magento 2 installation.

I understand that to access a model you would use a factory, but since the factory class name is derived from the model class name, I have no idea what to inject into my constructors to access model info.

My apologies if this info is already available in a convenient spot, but I'm struggling to find it if it is. Thanks!


texts: why checkout_cart_update_items_before after update custom price show in every currency same price?

texts:
public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $items = $observer->getCart()->getQuote()->getItems();
        $info = $observer->getInfo()->getData();
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $priceHelper = $objectManager->create('Magento\Framework\Pricing\Helper\Data');
        foreach ($items as $item) {
            //$price = $item->getProduct()->getFinalPrice();
            $price = $priceHelper->currency($item->getProduct()->getFinalPrice(), false, false);
            $gross_price = $priceHelper->currency($item->getProduct()->getPrice(), false, false);
            //$gross_price = $item->getProduct()->getPrice();
            if($price != $gross_price){
                $qty = $info[$item->getId()]['qty'];
                if($info[$item->getId()]['qty'] >= 10){
                     $price = (floor($gross_price*.95) + (($price- $gross_price) * .95));
                } elseif($info[$item->getId()]['qty'] >= 5){
                     $price = (floor($gross_price*.97) + (($price- $gross_price) * .97));
                }

                //$gross_price = $priceHelper->currency($gross_price, false, false);
                //$price = $priceHelper->currency($price, false, false);
                $item->setCustomPrice($price);
                $item->setOriginalCustomPrice($price);
                $item->getProduct()->setIsSuperMode(true);
                $item->save();
            }
        }
    }

after currency change show the same price


texts: How to move the Layered Navigation on the Search Results page

texts:
I'm trying to move the layered navigation block from the left sidebar to a div in my /catalog/product/list.phtml

I did this successfully in my product category view, by adding getChildHtml('catalog.leftnav') ?> to /catalog/product/list.phtml. And then in local.xml I added

<catalog_category_layered>
  <!-- remove from left block -->
  <reference name="left">
    <action method="unsetChild">
      <child>catalog.leftnav</child>
    </action>
  </reference>

  <!-- add as child to product list block -->
  <reference name="product_list">
    <action method="insert">
      <child>catalog.leftnav</child>
    </action>
  </reference>
</catalog_category_layered>

So the question is, how do I do this for the search results view? Both pages include /catalog/product/list.phtml. I tried to do this in local.xml:

<catalogsearch_result_index>
  <!-- remove from left block -->
  <reference name="left">
    <action method="unsetChild">
      <child>catalogsearch.leftnav</child>
    </action>
  </reference>

  <!-- add as child to product list block -->
  <reference name="product_list">
    <action method="insert">
      <child>catalogsearch.leftnav</child>
    </action>
  </reference>

</catalogsearch_result_index>

But then the layered navigation block just disappeard from the search results page. I tried a few other combinations of things in the layout.xml file, but I'm just not knowledgable enough in Magento layouts to know what to do here. Can someone please point me in the right direction?

Thanks!


texts:
Magento does not get the information from the default value for several config settings. We recently added a new website and store, maybe it's related somehow.

For example the timezone is not retrieved correctly. We set Europe/Berlin as default value, but our German store does not read from it. It returns null.

Here our configuration for default:

And here for our German website
:

The configurations in our database seem to be correct as well.
The entries for general/locale/timezone in core_config_data:

7435websites12general/locale/timezoneEurope/Berlin
3909websites10general/locale/timezoneAtlantic/Reykjavik
3407websites8general/locale/timezoneEurope/Berlin
7436websites1general/locale/timezoneEurope/Berlin
543default0general/locale/timezoneEurope/Berlin

However when I run the following code to retrieve the data, it returns NULLwhile I expected Europe/Berlin:

var_dump(Mage::getStoreConfig('general/locale/timezone', 3));


texts: Magento 2 : How to add login link on home page

texts: I want to add the login page geturl link when I click on the login link. What is the role of customer_account_login.xml in this and how to load the login page after clicking on the link?


texts: Duplicate Orders when cancelling Paypal checkout

texts:
I noticed a strange activity in my magento site. I checkout using paypal then I was redirected to their gateway payment page. Then from there I decided to go back to the site by pressing the back button of the browser. I was now back in my checkout page then I decided to checkout again using paypal, I was redirected successfully to gateway payment page.

What is strange is that I get two order records in magento backend, instead of updating my previous order. Is this normal or not? Thanks!


texts:
I added the validate-product.js in my custom module. But when I refresh the page it's loading 2 instance of the validate-product.js. The first one is the js file from my custom module the second one is from Magento_Catalog I checked my theme directory but I don't have any content of that. I cleared my cache file and all but it's still loading the file in the Vendor Folder. I thought when I override it in my custom module it should not run the Vendor folder but it seems I'm wrong. Any idea on how to solve this?

Below is the content of my requirejs-config.js

var config = {
    map: {
        "*": {
            addcartjs: 'Custom_Module/js/add_to_cart',
            canvasjs: 'Custom_Module/js/canvas_js_include',
            productValidate: 'Custom_Module/js/validate-product',
        }
    }
};

Is this really how it works? if so how can I load my custom module validate-product.js file last so that the function in there will be the one to be used. But I don't know how to do it


texts: Magento 2 admin panel integration is missing

texts:
does anyone know how to fix a system error. I have asked someone to install Magento 2, but it seems like the system integration section is missing.

Anyone know how to fix this problem?

Thank you!


texts: What's security-only patch release and how to apply it?

texts:
I noticed we have security-only patch releases, what's it and how to use it?

An example of these security-only patch releases, instead of having Magento 2.3.2 my client has installed Magento 2.3.3-p1.


texts: Magento 2 : Update Order Summary Block On Checkout Page

texts:
I already look into this : how to add fee to order totals in magento2

I need to added additional fee based on shipping address, So I used this plugin

<type name="Magento\Checkout\Model\ShippingInformationManagement">
        <plugin name="get_shipping_info" type="Company\Vendor\Plugin\Checkout\Model\ShippingInformationManagement" sortOrder="1" disabled="false"/>
    </type>

It sucessfully work and update value of fee in "quote" table in database.

But it not update fee value in checkout summary block.

How can I update this summary block, So it get updated value from database.
How can I update block on selection of any payment method selection or any other way.


texts: How to retrieve particular table particular value

texts:
how to get single row data. this code is retrieving all data in table.

$connectionresource = Mage::getSingleton('core/resource');
$readconnection = $connectionresource->getConnection('core_read');

$allrecord = $readconnection->select()->from(array('customimgupload'=>'customimgupload'));

$alldata =$readconnection->fetchAll($allrecord);

foreach($alldata as $img)
   {
     echo $img['image_url'];?><br/><?php
   }

?>


texts: magento 2 admin config text fields side by side

texts:
How to add 2 or 3 text fields inline at the admin configuration of Magento 2?
As I checked everywhere, I am able to add text fields one by one.
How Can I do this as my admin config fields look like below


texts: Any link redirect to one same product, only /checkout/cart don't - Magento 2.1

texts:
I was using the site normally and suddenly it started to redirect all categories and products to one same item, if I copy and paste the URI for products that are active it shows 404.

Any idea how I can debug it?

I already clear cache, reindexed and compiled again.


texts:
I want to create cart & quote item in one Api only wright now magento ne api is creating cart then 2nd Api is creating Quote Items. I want in one api.

Can anyone help on this ?


texts:
Store has Magento 2.3.3 with Varnish 6, Redis 5 and Amasty Layered navigation enabled for filtering and pagination ajax calls.
After setting up above configuration, navigation through category pages. Previous and next page clicks via Ajax calls works fine.
Next day or after 24 hours or so, no response after clicking previous and next category pages. Issue disappears after clearing page cache.

Do I need to modify VCL to either exclude Ajax requests or cache ajax requests? While click next page or previous page I see XHR requests with &shopbyAjax=1 appended to paginated URL. Example https://www.example.com/salwar-kameez?p=8&shopbyAjax=1


texts: Configure baseurl in Magento 2 env.php or config.php?

texts:
Is it possible to configure the base-url (secure & unsecure) within the array-based configuration files like env.php or config.php?

I tried with env.php but it didn't give me much:

<?php
return array (
    'web' => [
        'unsecure' => ['base_url' => 'test'],
        'secure' => ['base_url' => 'test'],
    ],
    ...

But it might just be that I'm overlooking something.

It however works nicely when I use the core config table, e.g. setting it with magerun2:

$ n98-magerun2.phar config:set web/secure/base_url https://example.com
web/secure/base_url => https://example.com
$ n98-magerun2.phar config:set web/unsecure/base_url http://example.com
web/unsecure/base_url => http://example.com


texts: Magento Cart-dropdown on product add button

texts:
As title suggests I am trying to get a cart-dropdown when product gets added to the basket. My files are set as below, please advice where could this possibly be going wrong as I can't get this to work. I am using Magento 1.9.4

/etc/config.xml

<?xml version="1.0"?>
<events>
<checkout_cart_product_add_after>
    <observers>
        <Namespace_TriggerName>
            <type>singleton</type>
            <class>Namespace_TriggerName_Model_Observer</class>
            <method>opencartafteradd</method>
        </Namespace_TriggerName>
    </observers>
</checkout_cart_product_add_after>
</events>

/Model/Observer.php

<?php

class Namespace_TriggerName_Model_Observer
{
public function opencartafteradd($observer) {
    $event = $observer->getEvent();
    $product = $event->getProduct();
    Mage::getSingleton('core/session')->setOpenMinicart('ON');
 }
}

/app/design/frontend/theme/default/template/page/html/head.phtml

<script type="text/javascript">
var $v = jQuery.noConflict();
$v(document).ready(function() {
    var screen_width = $v(window).width();
    var openminicart = '<?php echo Mage::getSingleton('core/session')->getOpenMinicart();?>';
    if (screen_width > 780) {
        if (openminicart == 'ON') {
                jQuery("#header-cart").slideToggle('slow');
                jQuery("#header-cart").addClass('skip-active');

                setTimeout(function() {
                    jQuery("#header-cart").slideUp('fast');
                    $k('#header-cart').removeClass('skip-active');
                }, 4000);

        <?php Mage::getSingleton('core/session')->unsOpenMinicart();?>

        }
    }
});
</script>


texts: magento multi store - product URL based on store

texts:
I'm building a magento site with 1 website, 2 stores and 1 store view for each store.
store URLs: domain.com/storea and domain.com/storeb

Everything goes well like cart share, login share, etc except for 1 thing,
when viewing the products in the cart, all products have the same URLs and they follow the current store name.

How to make products use the url to where the store they belong to?


texts: Is it possible to Manage .htacess file from Admin Panel?

texts: Is there any way I can edit and update .htaccess file from admin panel of Magento. I'm using Magento 1.9


texts: Fix admin backup with observer and max_execution_time?

texts:
max_execution_time blocks the backup function in admin from working. So I thought I can use an observer and ini_set to increase the max_execution_time for this purpose only.

Questions is which observer would work best for this?

Or how could I find it on myself?


texts: Magento : How to Display Product in Popup Onclick

texts:
Onclick on "Return book", I want to display magento product. Only those products should be display where selected attribute name Rent should be Yes

Only that product should display in popup.


texts:
I use the Sidebar Navigation Menu Professional for Magento by CODNITIVE and I am trying to make it expanded by default. Particularly I need a solution to make just the first list item expanded by default. Here is the code:

<script type="text/javascript" language="javascript">
//<![CDATA[

Codnitive = {

    expandMenu: function(parent)
    {
        var mode = parent.getElementsByTagName("ul")[0].getAttribute("expanded");
        (mode == 1) ? Codnitive.collapse(parent) : Codnitive.expand(parent);
    },

    expand: function(parent)
    {
        parent.getElementsByTagName("ul")[0].style.display = "block";
        parent.getElementsByTagName("span")[0].style.backgroundPosition = "right center";
        parent.getElementsByTagName("ul")[0].setAttribute("expanded", "1");
    },

    collapse: function(parent)
    {
        parent.getElementsByTagName("ul")[0].style.display = "none";
        parent.getElementsByTagName("span")[0].style.backgroundPosition = "left center";
        parent.getElementsByTagName("ul")[0].setAttribute("expanded", "0");
    }

};

//]]>
</script>

In another forum there was the suggestion to use:

Codnitive.expand(document.getElementById('the-menu-parent-element-id'));

Where exactly should I write this code to make it work? Sorry, but I am not familiar with js.


texts: Magento 2: Passing browser information to payment gateway interface

texts:
I am implementing SCA (3dSecureV2) and part of the request is that I need to pass some variables via PHP to the gateway.

However, what is the best way of getting these front end (browser) settings to the php code in my controller?

Is there an example in M2 already?

    $this->browserData = new BrowserData();
    $this->browserData->colorDepth = ColorDepth::TWENTY_FOUR_BITS;
    $this->browserData->javaEnabled = true;
    $this->browserData->language = 'en';
    $this->browserData->screenHeight = 1080;
    $this->browserData->screenWidth = 1920;
    $this->browserData->challengWindowSize = ChallengeWindowSize::WINDOWED_600X400;
    $this->browserData->timeZone = '0';


texts: How to show price in two places in product details page in magento2

texts:
In product details page, How to show the final price in two places?

I have tried but it shows once.

Thanks for advance!!!


texts: Magento 2, Time is incorrect in Admin Grid

texts:
I use Magento 2.4.1. I have a problem with admin grid.
In my edit form, I set Booking From is: 18:30:00 and Booking To is: 19:30:00 at timezone GMT+7.
When I save, from, to are saved correctly to database, but in my grid, From, To is shown like image below:

I have no idea to solve it, please help me. Thanks a lot and sorry for my English.


texts: I have 2 custom extensions overriding the same page, i want to know,  which extension will execute first and how?


texts: Have post-login redirect url survive creating new account

texts:
I figured this will be a helpful post (especially to me right now!) and I have not seen it after searching.

First of all, we are using Magento 1.4 - so that may determine capabilities in this case.

I can successfully have Magento redirect to a specific page after login by passing:

/referer/{base64_encoded string for the URL}/

in the query string, and it redirects there just fine after I login.

But, what about a new user?  They click on "Create Account", which is a new URL (at least in 1.4), and Magento appears to lose the referer through the navigation process.  I.e., after I submit my new account info, I'm redirected not to the desired URL, but to admin home page.

What is the correct way to do this? And if it can't be done (which I would find troublesome) is there a decent workaround?


texts:
we are using custom payment method. under payment method we can see that payment method.

when i inspect element, i can see following code is reason to  display the payment method.

<input id ="p_method_byte" value = " byte" type = "radio" name = "payment" onclick " payment.switchMethod('byte') class = "radio" autocomplete= "off">

i want to know from which file this code is coming. i tried template path hints, but that did't worked.

i want to know where this code is present in folder in "Block", "controllers", "helper", "model"?


texts: Rewrite block class for specific site only

texts:
I have two sites in a multi-site Magento EE installation. I must rewrite the _getHtml function of the Mage_Page_Block_Html_Topmenu class for just one of the sites. Is it possible to target this rewrite to a single site, or am I going about this wrong?

The config.xml for the overwriting Page module is as follows:

<!-- Foo used as module name for posting purposes -->
<config>
    <modules>
        <Foo_Page>
            <version>1.0.0</version>
            <depends><!-- no dependencies --></depends>
        </Foo_Page>
    </modules>
    <global>
        <blocks>
            <page>
                <rewrite>
                    <html_topmenu>Foo_Page_Block_Html_Topmenu</html_topmenu>
                </rewrite>
            </page>
        </blocks>
    </global>
</config>

Currently this rewrite is affecting both sites' topmenu blocks. I would like to use the default _getHtml function for one site, and use my rewrite for the other. Is this possible in a multi-site setup?


texts: Magento2 custom admin controller always redirects to the admin index page

texts:
I've created custom extension in the admin panel under the menu of products. The problem is that I can't get the controller working. Code as fallows:

in etc/adminhtml/menu.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Vendor_Gift::Gift" title="Gifts" module="Vendor_Gift" parent="Magento_Catalog::inventory" action="gift/gift/" resource="Vendor_Gift::gift"/>
    </menu>
</config>

-etc/adminhtml/routes.xml

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

-in Vendor/Gift/Controller/Adminhtml/Gift/Index.php

<?php
namespace   Vendor\Gift\Controller\Adminhtml\Gift;

class Index extends \Magento\Backend\App\Action
{
    public function execute()
    {
        die('dd');
    }
}

The generated link in the menu Gifts is:
  http://77.81.188.106/admin/gift/gift/index/key/bc29dbd2656f4c8c13599c4c63e1485afd9ffc3440fe4f9d9ceec8171b03d87a/

I just don't get where am I mistaken, is it in the menu link tab .. ?


texts: magento 2 - how to create stores>>configuration CSV file upload field

texts: How to create system configuration file field with allowed formats(csv/xls) validation.


texts: How to make shipping address custom dropdown attribute searchable

texts:
I have followed tutorials like mentioned in below links:

https://www.mageplaza.com/devdocs/add-new-fields-address-form-magento-2.html
https://www.fmeextensions.com/blog/add-custom-field-magento-2-shipping-address/
etc

One thing I need more is to make my custom dropdown attribute as searchable one. I have a long list of options in dropdown, I want to make it searchable like below.
https://www.jqueryscript.net/demo/Searchable-Dropdown-Select-jQuery-Selectstyle/


texts: Promo Shopping Cart Price Rule Buy 3 Get 1 Free

texts:
I'm using magento 1.7 Community Edition (CE)
I want to setup this promo rule
If a customer buys 3 t-shirts from the same category (category 8), he/she will get the third one for free

I set the condition like this:

If ALL  of these conditions are TRUE :
If total quantity  equals or greater than  3  for a subselection of items in cart matching ALL  of these conditions:
Category  is  8
and then The Action:
Apply: percent of product price discount
Discount amount: 100
Max quantity discount is applied to: 1

Apply the rule only to cart items matching the following conditions (leave blank for all items)
If ALL  of these conditions are TRUE :
Category  is 8

The problem is that The Action rule will go though every single row in the cart and discount it for 100% for example if I buy 3 different t-shirts (A, B, C from category 8) and a pants (category 9) it will discount the three t-shirt for 100% so I only pay for the pants.  The rule only work if I buy 3 t-shirt of the same sku, it will discount just one of them, but if I buy 3 t-shirt of the same category it will discount all of it for 100%...

My question is how do I set this shopping cart price rule so that it only discount 1 product per category (category 8) not only per sku.


texts: Mystery VM Javascript duplicating script calls - where does it come from and how do I kill it?

texts:
I have a module which runs properly on my local instance of 1.9.1. On uploading it to a staging server, javascript that I added to the Admin Order page is running twice. After littering the files with comments, output in Chrome Dev tools shows a js file called "VM13876" that, when I click through in dev tools, is a block of js that I wrote inside a file, pulled aside into what looks like external js.

Sample output from dev tools:

RETURN Pressed                          (index):2122
This is productGridAddSelected          sales.js:639
This is beginning of loop               sales.js:646
MADE IT THROUGH LOOP                    sales.js:655
end of productConfigureSubmit           sales.js:853
END OF  productGridAddSelected          sales.js:660
After productGridAddSelected            (index):2140
RETURN Pressed                          VM13876:22
This is productGridAddSelected          sales.js:639
This is beginning of loop               sales.js:646
MADE IT THROUGH LOOP                    sales.js:655
end of productConfigureSubmit           sales.js:853
END OF  productGridAddSelected          sales.js:660
After productGridAddSelected            VM13876:40

Does anyone know what the source of the second, "VM" js?


texts: How can i get rid of m2_cl tables which are created in my Database

texts: We have outsourced a Magento developer to migrate M1 website to M2, this process is going on since few months now, suddenly since few day my Website is loading super slow, I checked all aspects but nothing actually worked. The Ram usage is suddenly increased by a lot, I tried deleting that new website + its database but still no fix. I tried deleting all the m2_cl tables which are newly created because of the data migration tool, then my website worked smooth for some time and crashed, after restoring it back it was working fine for some time and then again back to the issue. If anyone know how can I remove M2_cl tables safely. This might fix the problem.


texts:
As you guys may know, the Magento 1 patch names all start with SUPEE and I was wondering if any of you know what does "SUPEE" stand for ?

Is that an acronym or a real word ? I have to specify I'm not a native english speaker so I may miss something obvious here.


texts: Move breadcrumb position without local.xml

texts:
I want to change position of the breadcrumbs without making changes in local.xml.

I want the breadcrumbs after the category image, on the list page. How can I do this?


texts:
I have this code in checkout/cart/item/default.phtml

$allProductOptions = $_item->getProduct()->getTypeInstance(true)>getOrderOptions($_item->getProduct());
    $productOptions = $allProductOptions['info_buyRequest'];

And in $productOptions I have custom option saved from product page: $productOptions['my_option']. How can I update that option?


texts: How can i scroll up error message after click on place order magento2

texts:
If a user is a small screen device, there are many situations where they will never see an error message.

I referred this link
Usability issues with error/notice/success messages. But do not get any answer

For example,

if they're on the "Shipping" step of the checkout process and an
error message is added, they may not see the error message get added
to the top of the page.
My suggestion would be to either smooth scroll the user up to the
error message, display the error message next to the button.


texts: What's your way of debugging xml related exceptions?

texts:
I'm coding with Magento 2 in gvim and I am new to Magento 2.

There were many times i struggled to debug xml-related errors, well, each time with only luck.
But situations like this makes me really upset: you don't know where is the file that is causing this error, and the debugger doesn't tell neither .

Take the following I get this: an xml file is invalid. actually I've create a module which has module.xml, routes.xml, config.xml, {layout}.xml, di.xml under it's etc or view/layout dirs.
Which file's line 12/89/.. is invalid ? the generated /merged one ? I am lost because I find nothing in var/generated, and the commandline stops working .
What's the debugging way to find what this error is.?

Any help is appreciated.

  Fatal error: Uncaught Magento\Framework\Exception\LocalizedException: Invalid Document Element 'item': The type definition is abstract.
  Line: 12 Element 'item', attribute 'name': The XPath '@name' of a field of key identity-constraint 'itemName' evaluates to a node-set with more than one member.
  Line: 89 Element 'item': Not all fields of key identity-constraint 'itemName' evaluate to a node. Line: 89 Element 'item', attribute 'name': The XPath '@name' of a field of key identity-constraint 'itemName' evaluates to a node-set with more than one member. Line: 90 Element 'item': Not all fields of key identity-constraint 'itemName' evaluate to a node.
  Line: 90 in /var/www/html/lib/internal/Magento/Framework/Config/Reader/Filesystem.php:160
  Stack trace: #0 /var/www/html/lib/internal/Magento/Framework/Config/Reader/Filesystem.php(127): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator))
   #1/var/www/html/lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader.php(69): M in /var/www/html/lib/internal/Magento/Framework/Config/Reader/Filesystem.php on line 160


texts: Capture/Void/Refund not showed in magento admin area

texts:
I have a custom payment plugin that so far has only authorize functionality.
This means that in my model I have only:

protected $_canAuthorize = true;
protected $_canCapture = false;
protected $_canRefund = false;
protected $_canVoid = false;

I can close the payment, but when I create the invoice I don't see any option for refund, void, capture. Is this related to the fact that all the others flags are set to false and that the functions are not implemented?


texts: Magento 2:ERROR: Front controller reached 100 router match iterations

texts:
I got error when trying to do like this extention
http://inchoo.net/magento-2/routing-in-magento-2/
it work ok but when I add a foreach to check the url, I got error

  Front controller reached 100 router match iterations
  #0 [internal function]: Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))


texts: Magento 1.9 RWD remove (html, body height: 100%)

texts:
I discovered my:

html, body {
  /* height: 100%; */

causes problems with my Parallax section. Can i safely remove height: 100%; from the html and body-tag? Where is this style actually for?