texts:
Magento 2.2.4, php7.

I' ve been having this error when I try to switch to production and when i try to di:compile;

  Source class \Vertex for \Vertex\Mapper generation does not exist.

No errors in logs , any idea please?

Exception trace:

  () at
  /home/website/public_html/vendor/magento/framework/Code/Generator.php:185
  Magento\Framework\Code\Generator->tryToLoadSourceClass() at
  /home/website/public_
  html/vendor/magento/framework/Code/Generator.php:112
  Magento\Framework\Code\Generator->generateClass() at
  /home/website/public_html/ve
  ndor/magento/framework/Code/Generator.php:180
  Magento\Framework\Code\Generator->tryToLoadSourceClass() at
  /home/website/public_
  html/vendor/magento/framework/Code/Generator.php:112
  Magento\Framework\Code\Generator->generateClass() at
  /home/website/public_html/ve
  ndor/magento/framework/Code/Generator/Autoloader.php:35
  Magento\Framework\Code\Generator\Autoloader->load() at n/a:n/a
  spl_autoload_call() at n/a:n/a class_exists() at
  /home/website/public_html/setup/src/Magento/Setup/Module/Di/Cod
  e/Scanner/PhpScanner.php:269


texts: Magento2 - How to add placeholder to knockoutjs field?

texts:
I'm editing app\design\frontend\Vendor\theme\Magento_Checkout\web\template\cart\shipping-estimation.html
which handles the shipping and tax estimation in shopping cart page.
Here is the code:

<form method="post" id="shipping-zip-form" class="shipping-zip-form">
<fieldset class="fieldset estimate">

</fieldset>

from there, I know that it's being generated by knockout.js, so I searched around and found vendor\magento\module-ui\view\frontend\web\templates\form\element\input.html

<input class="input-text" type="text" data-bind="
value: value,
valueUpdate: 'keyup',
hasFocus: focused,
attr: {
    name: inputName,
    placeholder: placeholder,
    'aria-describedby': noticeId,
    id: uid,
    disabled: disabled
}" />

and I also looked at this file

vendor\magento\module-ui\view\frontend\web\templates\form\field.html

which has this code

So from those 2 files, I assume the placeholder must be inserted to the 'element', and then in vendor\magento\module-checkout\view\frontend\layout\checkout_cart_index.xml , I tried this:

<item name="postcode" xsi:type="array">

    <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
    <item name="dataScope" xsi:type="string">shippingAddress.postcode</item>
    <item name="sortOrder" xsi:type="string">114</item>
    <item name="provider" xsi:type="string">checkoutProvider</item>
    <item name="placeholder" xsi:type="string">testPlaceholder</item>
</item>

and I added this in vendor\magento\module-ui\view\frontend\web\templates\form\field.html

provider: --
placeholder: --

which outputs:

provider: -checkoutProvider- placeholder: --

Placeholder doesn't show up in front end.
So, any idea how to add the placeholder there?
Thanks


texts: $this->helper('catalog/image') spoils image colors. Is it a Magento bug, a Zend bug or a PHP bug?

texts:
I just came across with this very strange problem.

The case:
I have these 2 images:

The images are identical.
The only difference is that the 2nd image has a white background.

But when you visit the product's page you can see that the 1st image's colors are blurry while the colors of the 2nd image are correct. (see the Green color)

I did the test with a fresh installation of Magento 1.9.3.1 without any extensions installed. The PHP version is 5.5.9-1ubuntu4.21

I also did the test with an online Magento demo. The results are the same. The green color is blurry.

It has nothing to with the ->setQuality() option.
I did a test with $this->helper('catalog/image')->setQuality(100) and the final result is the same. The image that Magento produces has spoiled colors.

Is it a Magento bug, a Zend bug or a PHP bug?


texts: AJAX IN MAGENTO2.HOW TO ADD information from form IN DATABASE?

texts:
I already have a form and controller action, that send data without using ajax.How to do it with AJAX? I would appreciate your help!

  view/frontend/templates/reviews.phtml

<form action="<?php echo $block->getBaseUrl().'reviews/index/save'; ?>"
 method="post">
                Nickname
                <input name="nickname" id="nickname" title="nickname" value="" class="nickname" type="text">
                Text Review
                <input name="textreview" id="textreview" title="textreview" value="" class="textreview" type="text">

                    <button type="submit" title="Submit" class="actionSubmitPrimary">
                        Submit Review
                    </button>
    </form>

  Controller/Index/Save.php

<?php

namespace Training\Reviews\Controller\Index;
use Magento\Framework\App\Action\Context;
use Training\Reviews\Model\ReviewsFactory;

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

protected $_test;

public function __construct(
   Context $context,
ReviewsFactory $test
 ) {
$this->_test = $test;
parent::__construct($context);
 }
 public function execute()
{

$data = $this->getRequest()->getParams();
$test = $this->_test->create();
$test->setData($data);
if($test->save()){
    $this->messageManager->addSuccessMessage(__('You saved
  review'));
  }else{
    $this->messageManager->addErrorMessage(__('Review was not
saved.'));
}
$resultRedirect = $this->resultRedirectFactory->create();
$resultRedirect->setPath('reviews/index/index');
return $resultRedirect;
}
}

Controller/Index/Index.php

<?php

namespace Training\Reviews\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action
{
public function execute()
{
$this->_view->loadLayout();
$this->_view->getLayout()->initMessages();
$this->_view->renderLayout();
  }
}


texts: Set Is Anchor to 'No' in Category settings have any other side effects other than removing Layered Navigation?

texts:
I've been working with a Magento 1.9 shop that has issues with their speed, and I've noticed turning off the 'Is Anchor' in Category settings speeds up the category view significantly.

I understand this removes the layered navigation on the left, which is why the speed increase happens. I'm just wondering if it does anything else in the background I should know about, or any other 'side effects' that I should know about before turning it off on all categories?

As I noticed when I turn off 'Is Anchor' in a certain category the number of products displayed next to the category name goes from 400 down to 11 which worried me a bit.

Some of their category pages even have custom views where the layered navigation doesn't even show but 'Is Anchor' is still set to 'Yes' so I imagine it's pointless being on especially on those categories?


texts: Magento images are not showing up - case sensitive filename

texts:
I transferred Magento shopping cart one server to another server after that
my site product images are not showing on the new site.

All images /media/catalog/product/A/S/As-1_3.JPG in ftp

but img src call it as /media/catalog/product/a/s/as-1_3.jpg

I am wondering how to solve this issue?


texts: How can I add custom Template for products through custom theme?

texts:
I have my created a Custom theme for products but I am getting old product page I want my custom product page here is my xml..

<?xml version="1.0"?>
<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
        <!-- this is code to add new tab start -->
        <referenceBlock name="product.info.details">
            <block class="Magento\Catalog\Block\Product\View" name="deliveryinfo.tab" as="deliveryinfo" template="product/view/delivery_info.phtml" group="detailed_info" >
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">Delivery Information</argument>
                </arguments>
            </block>
        </referenceBlock>
        <!-- this is code to add new tab end -->
    </body>
</page>

I know I am doing some mistake I don;t know what it is..


texts: Before the control rendering tier price template, how to check whether the product having tier price or not in magento 2

texts:
How the magento control checks whether the product render the tier price template or regular price template ?
How can we do some functionality, before the control reads price template ?


texts: Fooman GA+ double ga.js inclusion (so it seems)

texts:
Whilst investigating site speed I saw that the header contains the google analytics code twice (as in double).

We have googleanalytics.xml (default) and googleanalyticsplus.xml installed

The double code looks like this (Image exact two copies directly under each other)

<script type="text/javascript">//<![CDATA[
(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src='https://stats.g.doubleclick.net/dc.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);})();var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-CODEHERE"]);asyncDistilledFirstTouch(_gaq);_gaq.push(["_trackPageview",""],["_trackPageLoadTime"]);if(Ajax.Responders){Ajax.Responders.register({onComplete:function(response){if(!response.url.include("progress")&&!response.url.include("getAdditional")){if(response.url.include("saveOrder")){_gaq.push(["_trackPageview",""+"/opc-review-placeOrderClicked"]);}else if(accordion.currentSection){_gaq.push(["_trackPageview","/"+accordion.currentSection]);}}}});}
//]]></script>

Generated (I think) by

googleanalytics.xml

<default>
    <!-- Mage_GoogleAnalytics -->
    <reference name="head" before="-">
        <block type="googleanalytics/ga" name="google_analytics" as="google_analytics" template="googleanalytics/ga.phtml" />
    </reference>
</default>

and

googleanalyticsplus.xml

<default>
    <reference name="head">
        <action method="addJs" ifconfig="google/analyticsplus/firstouch"><script>GoogleAnalyticsPlus/distilled.FirstTouch.js</script></action>
        <block type="core/text_list" name="before_head_end" as="before_head_end"/>
    </reference>
    <reference name="before_head_end">
        <block type="googleanalytics/ga" name="google_analytics" as="google_analytics" />
    </reference>
    <reference name="after_body_start">
        <action method="unsetChild"><name>google_analytics</name></action>
    </reference>
    <reference name="before_body_end">
        <action method="unsetChild"><name>google_analytics</name></action>
    </reference>
</default>
<checkout_onepage_success>
    <reference name="before_body_end">
    <block type="googleanalyticsplus/gaConversion" name="googleanalyticsplus_conversion" template="googleanalyticsplus/ga-conversion.phtml" />
    </reference>
</checkout_onepage_success>
<checkout_multishipping_success>
    <reference name="before_body_end">
    <block type="googleanalyticsplus/gaConversion" name="googleanalyticsplus_conversion" template="googleanalyticsplus/ga-conversion.phtml" />
    </reference>
</checkout_multishipping_success>


texts: How to add a checkout button to header but not in the top links

texts:
how do i add in a checkout button into the header, but not within the top links?

I havent tried anything yet because i dont know where to start, hence why i am asking for your help.

All i need is a simple link that goes to checkout or my cart.

Thankyou


texts:
always If I want to install a themplate, I get an error.
Can you help me pleas?
Error log:

a:5:{i:0;s:215:"Error in file: "/usr/www/users/mstqsq/app/code/local/Cmsmart/Blog/sql/cmsmart_blog_setup/mysql4-upgrade-1.0.1-1.0.2.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'cmsmart_blog' already exists";i:1;s:936:"
#0 /usr/www/users/mstqsq/app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /usr/www/users/mstqsq/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.0.0', '1.0.5')
#2 /usr/www/users/mstqsq/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.0.0', '1.0.5')
#3 /usr/www/users/mstqsq/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /usr/www/users/mstqsq/app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /usr/www/users/mstqsq/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#6 /usr/www/users/mstqsq/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /usr/www/users/mstqsq/index.php(87): Mage::run('default')
#8 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

Hope you can help me.


texts: Magento 2 Product Details Column in Sales order Grid

texts: I need to extra column to Sales Order Grid that displays product name or product SKU.


texts:
In M2 they use custom .media-width mixin rules to add to styles-m.css or styles-l.css.

//
//  Common
//  _____________________________________________
& when (@media-common = true) {
   .catalog-product-view {

   }
}

//
//  Mobile
//  _____________________________________________
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {

}

//
//  Desktop
//  _____________________________________________
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {

}

Is there a similar method for adding style rules to print.css?


texts: Magento2 - How to develop for Magento Enterprise Edition

texts:
One of our client asked us to implement an ecommerce solution based on Magento2 Enterprise Edition for which they have a license.

We, as contractors, don't hold the license, and the client don't want to share theirs with our developers (which are many and spread all around the world), which is perfectly understandable.

What is the recommended way to develop a site based on Magento2 EE? Can we just target Magento2 CE for our developments?


texts:
I am often using the following commands one after another:

php bin/magento setup:upgrade
php bin/magento setup:di:compile

Now I am wondering if it is possible to create a batch-command (like in old MS-DOS-systems) to run the commands with one command. Any idea?


texts: Magento2: Fatal error: Allowed memory size of

texts:
I try install module via composer.

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.

I change in php.ini memory_limit to 1024M

Still the same issue.

Any solution?


texts: Composer to move Custom PHP SDKS to lib from folder during Installation

texts: I am working on creating a module and wanted to submit it to the marketplace. My module interacts with various PHP SDKs, so for development, I have added them into the lib folder, not in the Module, and able to setup:di:compile without any issue. So now the main issue, if submit my module to Magento Market place, I am not able to move these file to lib folder [as magento doesn't allow e], and keeping them in the module will fail setup:di:compile causing error like Google_Service_YouTubeAnalytics_BatchReportDefinitions_Resource Missed required argument serviceName in parent::__construct call. Quick search says we need to put the one with the public scripts to github and add it as dependency, but no sample process or steps outlined, Can anyone point to right directions?


texts: Change Product Page Fotorama On Element Click

texts:
I'm trying to change to a specific image in the product gallery when the user clicks a button to customize their item.

So far I have the following code:

    require( ['jquery', 'jquery/ui', 'mage/gallery/gallery'], function($){

    $( "label[for='options_1_text']" ).click(function() {
        var api = $(".fotorama").data('gallery');
        api.first();
    });

    $( "input#options_1_text" ).keyup(function(){
        var customText = $( "input#options_1_text" )
            .val();

        if ($( "#personalised-text-field" ).length > 0) {
            $( "#personalised-text-field" )
                .text(customText);
        } else {
            $( ".fotorama__stage__frame" )
                .first()
                .append("

");
            $( "#personalised-text-field" )
                .text(customText);
        }
    });
});

My intention is that when the label is clicked, the gallery will show the first image which has customisations overlayed.


texts: Magento gallery images shown in backend, but not on frontend?

texts:
I created a product by code and also set the main image and the gallery images with code. When I check the product in the backend, all images are there.

On the frontend, it only shows the main image, the gallery images are not shown. So I checked the catalog_product_entity_media_gallery table for my product and it has ALL the gallery images I want.

So they are imported to the right place, but not shown on frontend. I tried uploading another gallery image manually from the backend, this works, it shows up on frontend. Just the ones being imported by code do not show up.

Any ideas?

Thanks!


texts: I want to close my store on specific dates, like on 15 dec 2015. Is this possible with Magento?


texts:
I created modal in homepage when user logged in.
This is my Phtml. Everything working fine but data updates only when I flush cache. How to clean cache on load page.

<?php

$money = $block->walletMoney();

$om = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $om->create('Magento\Customer\Model\Session');
if($customerSession->isLoggedIn()) {
    $name =  $customerSession->getCustomer()->getName();
    $idd =  $customerSession->getCustomer()->getId();

    if($money>0){

     echo "

 Congragulations, $name

Your Wallet Money of Rs.$money is Credited

    Collect Credits

";

}

}
?>


texts: 2FA preference not saving when multiple 2FA providers selected

texts:
I have recently enabled U2F for admin users. Previously, Authy was the only enabled provider. When U2F was enabled, all admin users were forced to re-configure their Two-Factor Authorization.
If the user has access to a U2F key, there is no problem. If the user does not have one, they are asked prompted to configure their Two-Factor Authorization every time they log in. After re-configuring, they are directed to the admin dashboard as expected. Once they log out and need to log in again, they are once again prompted to configure 2FA.
Has any one else experienced this issue? Some users would prefer to use their U2F keys but not everyone has access to one, so I can't expect them to re-configure every time they need to login.
This is on Magento 2.4.2


texts: How to show price in simple product on product view page?

texts:
I remove price from product view page using below line of code

  <referenceBlock name="product.info.price" remove="true" />

This is working perfectly.but i need to show price in only simple product on product view page and did not show in configurable,bundle,grouped,virtual product.

can someone help to achieve this solution?


texts: Magento 2 - Change customer password programmatically

texts:
I have build a plugin on the authenticate() method in Magento\Customer\Model\AccountManagement with beforeAuthenticate().

It is working and I can change the firstname of something else of the customer.

I'm trying to find the password in an other system, and set that password to the customer on the moment of login. Everything works, and I get the information.

The only problem is saving the password to Magento2.

I tried:

    $customer = $this->customerRepository->getById($customerId);
    $customerSecure = $this->customerRegistry->retrieveSecureData($customer->getId());
    $customerSecure->setPasswordHash($this->encryptor->getHash($password, true));
    $this->customerRepository->save($customer);

and:

    $customer =  $this->customerFactory->create();
    $customer->load($_customer->getId());
    $customer->setPassword($password);
    $customer->save();

None of them seems to resetting / setting my password.

And ideas how to fix it ?


texts: How to implement jQuery click event in magento knockout JS function

texts:
how to implement below jQuery code into knockout js, Actually I'm trying to call this function on a button click event using knockout js, but it's not working
HTML code:

        <button id="buttonid">click</button>
        Item 1

        <button id="buttonid">click</button>
        Item 2

jQuery COde:
$('#buttonid').on("click",".list-group-item",function(e){
console.log($(this).text());
console.log(e.target.id);
});

In this code .list-group-item is the class of ul tag. Here I wanna try to get title text of li items.
please guide me to implement above jQuery function in knockout js!


texts:
How can I debug or show the error trace of errors occur in calling Model->save()?

At the moment, I'm using logger to debug the execution.

$transaction = App::getModel('mygateway/transaction');
$transaction->setOrderId($order_id);
$transaction->setTransactionId($transaction_id);

Mage::log('saving', null, 'mygateway.log', true);
$transaction->save();
Mage::log('saved', null, 'mygateway.log', true);

Is there something like: $transaction->getLastError()?

Update (2nd Question)

How to debug $transaction->save() when it is executed without error, and yet the data is not stored in the database?


texts: Get session variables between template files

texts:
I have set the array in magento session in one of the template file using following code

 Mage::getSingleton('core/session')->setData('filterarray',$filtercatarray);

I'm getting correct value in same template file but when i'm calling same session using following code in another template file i'm getting old session values.

$session = Mage::getSingleton("core/session",  array("name"=>"frontend"));
$catarray = $session->getData('filterarray');

When i'm refreshing the page i'm getting update session value. why i'm not getting update value in first call in another template file?


texts: Show "Add to Cart" and "Add to Wishlist" buttons in Recently Viewed Products block

texts:
I want to display "Add to cart" and "Add to wishlist" buttons under products displaying in Recently Viewed section.

product_viewed.phtml:

<?php if ($_products = $this->getRecentlyViewedProducts()): ?>

        <?php echo $this->__('Recently Viewed Products') ?>

        <?php foreach ($_products as $_item): ?>

                <a href="<?php echo $this->getProductUrl($_item) ?>">
                    <img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" />

                        <a href="<?php echo $this->getProductUrl($_item) ?>">
                            <?php echo $this->helper('catalog/output')->productAttribute($_item, $_item->getName() , 'name') ?>

        <?php endforeach; ?>

<?php endif; ?>


texts:
I have a question, magento uses a cron own or uses the cron of the same operating system?

And how could I configure it to make a cron of a specific module? In my case I want to export every "x" time the products of my store to make feeds with the module "Product Feed Export Module"


texts: What is the correct way to properly register & run automated cronjobs in Magento 2?

texts:
I'm trying to define a cronjob for a custom module, but having a hard time going through the proper flow of scheduled cronjobs.

Few things of note:

It seems that third-party cronjobs are only scheduled once, when the cache is flushed. When the scheduled ./bin/magento cron:run runs every minute, the first time the cache is flushed it picks up all of the third-party module cronjobs, and runs them on the next execution.
After the first run, it doesn't seem as though these third-party modules are scheduled for a second run, ever. Until the cache is flushed again.

Is this perhaps related to cron group? I noticed that items in the default cron group never get rescheduled, but it seems that items in the index cron group do (at least items from core code).
Disabling the cache doesn't help.
Even if cache is disabled, the third-party modules never get registered.
Even if cache is disabled, iff a ./bin/magento cache:flush is run, all of the items in the default group do get scheduled. This leads me to believe that either that cache is not getting properly disabled, there is a bug in the caching system, and/or there is some sort of intricacy with how the cache actually works.

What is the purpose of running php update/cron.php if we are already running ./bin/magento cron:run, and what is the difference between the two? I'm pulling info from devdocs http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html#config-cli-cron-bkg


texts:
I am trying to install patch SUPEE-7616 but it's failed. I am getting error:
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

checking file app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php
Hunk #1 FAILED at 544.
Hunk #2 FAILED at 579.
Hunk #3 FAILED at 612.
Hunk #4 FAILED at 624.
Hunk #5 FAILED at 659.
Hunk #6 FAILED at 692.
Hunk #7 FAILED at 742.
Hunk #8 FAILED at 781.
Hunk #9 FAILED at 834.
Hunk #10 FAILED at 857.
Hunk #11 FAILED at 1423.
11 out of 11 hunks FAILED

Usps.php file is original,  without any updates. And SUPEE-7405 was installed successfully. Any ideas what the problem could be?


texts: Database connectivity issue in Magento 2.1

texts:
I am trying to connect to magento database of another system with the following configuration in app/etc/env.php

  array (
    'host' => '192.168.1.172',
    'dbname' => 'datacenter',
    'username' => 'root',
    'password' => 'root',
    'active' => '1',
  ),

But i keep getting the below error, is there anything i can do to fix it? Your inputs are much appreciated.

  2 exception(s):
  Exception #0 (Zend_Db_Adapter_Exception): SQLSTATE[HY000] [2002] Connection refused
  Exception #1 (PDOException): SQLSTATE[HY000] [2002] Connection refused


texts: Magento 2 - bind to .html template load complete event

texts:
I need to do some DOM manipulation within a JS mixin after .html template is loaded.
My mixin is for following component:
module-braintree/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js

Component loads :
module-braintree/view/frontend/web/template/payment/form.html

I've made hack way of watching for DOM element using setInterval() to finx if it is loaded or not:

Here is my mixin code:

define([
    'jquery',
    'uiRegistry'
], function ($, registry) {
    'use strict';
    return function (hostedFields) {
        return hostedFields.extend({
            initialize: function () {
                this._super();
                let intervalId = setInterval(function () {
                    let braintree = $('#braintree');
                    if (braintree.length) {
                        clearInterval(intervalId);
                        braintree.prop("checked", true);
                        braintree.click();
                    }
                }, 100);
                return this;
            }
        });
    };
});

So my question is:
Is there any better way of manipulating DOM elements of module-braintree/view/frontend/web/template/payment/form.html which is being loaded by AJAX?

It has to be done by JS mixin, without altering form.html itself.


texts: How can i view particular user activities

texts: How can i view user updated like add products, deleted products any others changes in magento.


texts: Magento2.2 manually changed order increment id breaks checkout

texts:
I have a magento 2.2.0 based website and I manually changed the incriment id for orders to be a higher number

Now my checkout does not work and i get the below error

 main.CRITICAL: Exception message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4294967295' for key 'PRIMARY', query was: INSERT INTO `sequence_order_1` () VALUES ()
 Trace: #0 /var/www/html/*****.com/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(580): Magento\Framework\DB\Adapter\Pdo\Mysql->_query('INSERT INTO `se...', Array)
#1 /var/www/html/****.com/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(576): Magento\Framework\DB\Adapter\Pdo\Mysql->query('INSERT INTO `se...', Array)
#2 /var/www/html/***.com/vendor/magento/module-sales-sequence/Model/Sequence.php(85): Zend_Db_Adapter_Abstract->insert('sequence_order_...', Array)
#3 /var/www/html/***.com/vendor/magento/module-quote/Model/ResourceModel/Quote.php(172): Magento\SalesSequence\Model\Sequence->getNextValue()
#4 /var/www/html/***.com/vendor/magento/module-quote/Model/Quote.php(2183): Magento\Quote\Model\ResourceModel\Quote->getReservedOrderId(Object(Magento\Quote\Model\Quote))
#5 /var/www/html/***.com/vendor/magento/module-paypal/Model/Express/Checkout.php(495): Magento\Quote\Model\Quote->reserveOrderId()

Now i am getting
General error: 1467 Failed to read auto-increment value from storage engine
in magento exception.log


texts: How can i get image url with proper path?

texts:
<?php foreach ($temp as $product): ?>

<?php
    $id = $product['entity_id'];
    $img = $product['image'];
    $url = $product['url_path'];
    $small_image = $skinUrl.$product['small_image'];
    $small_img_lable = $product['small_image_label'];
    $thumbnail = $product['thumbnail'];
    $name = $product['name'];
    $price = $product['price'];
    $special_price = $product['special_price'];
    $size = $product['size'];
?>

<a class="product-image" href="<?php echo $url; ?>">

    <button class="button button--s button--inverted">Quick View</button>

   <picture class="pimg1">
       <source srcset="<?php echo $small_image; ?>" media="(min-width: 400px)">
       <img srcset="<?php echo $small_image; ?>" alt="<?php echo $small_img_lable;?>">
  </picture>
  <picture class="pimg2">
      <source srcset="<?php echo $thumbnail; ?>" media="(min-width: 400px)">
      <img srcset="<?php echo $thumbnail; ?>" alt="<?php echo $thumbnail;?>">
 </picture>

$temp contain product attributes.And i have all the attibute data in json file, but can't get image url. How can I get this ?

"small_image":"/1/_/1_4_1.jpg","thumbnail":"/1/_/1_4_1.jpg"
this are my small image and thumbnail image values in json.


texts: How can I Get the Related Product Slider on Product Detail Page? I am Using Magento 1.9.2.3 Version.


texts: Magento 2 New Product Collection - Specific Attribute

texts:
I want to create a new widget for products that are "coming soon"

Coming soon is a toggle attribute.
I have found example codes online, but none of the answers contain file paths.

How would I create this collection? (i.e. code correction and specifically in which file)

Code I think will work :

 <?php namespace Vendor\Yourmodule\Block; class ProductCollection extends \Magento\Framework\View\Element\Template {protected $_productCollectionFactory; public function __construct(
    \Magento\Backend\Block\Template\Context $context,
    \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
    array $data = []
)
{
    $this->_productCollectionFactory = $productCollectionFactory;
    parent::__construct($context, $data);
}

public function getProductCollection()
{
    $collection = $this->_productCollectionFactory->create();
     $collection->addAttributeToFilter('coming_soon', array('eq' => 'coming_soon'));

    return $collection;
}

}


texts: Moneris On site Processing for Magento 2

texts: Someone has any recommendation for an extension to integrate with Moneris on site processing?


texts: Magento 2 API - change returning JSON key

texts:
I have created custom API with Magento that will be consumed by 3rd party system, which expect fix formate of API response. I have created API data interface and I could able to get formate what they need, but facing problem with JSON associated that API returns,

Magento by default changing getter method name into SnakeCase, i.e I have

public function getInvoiceUrl();

this will return

{
  "invoice_url": "string"
}

But my expected output is UpperCamelCase like

{
  "InvoiceUrl": "string"
}

how can I achieve this with API data interface??

As returning API data with array will return response like,

[{
    "InvoiceUrl": "string"
}]


texts: How to add language dropdown in admin form like cms page

texts: I am new to magento 2, I created an admin module. In this module the text what we entered in admin content. It reflects on the frontend. But the problem is if we change the language to other than english. The text is still displaying to english only. In CMS Pages it has a dropdown to select the language. I want to have over. here.


texts: How to send data to observer class or plugin class when click on check box in magento 2?

texts: i am trying to send the data to observer or plugin through check on checkbox but its not firing.can anyone help me how to send data to observer class or plugin by clicking on check box.


texts:
I followed @Marius answer here

it worked fine in one site, in another site below error once i go to

System > configuration > Sales > checkout ,

Fatal error: Class 'StackExchange_Checkout_Helper_Data' not found in /var/www/html/sitename/app/Mage.php on line 547

compilation

Compiler Status : Enabled
Compilation State : Compiled

config.xml - app/code/local/StackExchange/Checkout/etc

<?xml version="1.0"?>
<config>
    <modules>
        <StackExchange_Checkout>
            <version>0.0.1</version>
        </StackExchange_Checkout>
    </modules>
    <global>
        <blocks>
            <checkout>
                <rewrite>
                    <onepage>StackExchange_Checkout_Block_Onepage</onepage><!-- rewrite the onepage chackout block -->
                </rewrite>
            </checkout>
        </blocks>
        <helpers>
            <stackexchange_checkout>
                <class>StackExchange_Checkout_Helper</class>
            </stackexchange_checkout>
        </helpers>
        <models>
            <stackexchange_checkout>
                <class>StackExchange_Checkout_Model</class>
            </stackexchange_checkout>
        </models>
    </global>
    <default>
        <checkout>
            <options>
                <hide_shipping>1</hide_shipping>
                <default_shipping>tablerate_bestway</default_shipping><!-- set the default shipping method code -->
            </options>
        </checkout>
    </default>
    <frontend>
        <routers>
            <checkout>
                <args>
                    <modules>
                        <StackExchange_Checkout before="Mage_Checkout">StackExchange_Checkout</StackExchange_Checkout>
                    </modules>
                </args>
            </checkout>
        </routers>
        <translate>
            <modules>
                <StackExchange_Checkout>
                    <files>
                        <default>StackExchange_Checkout.csv</default>
                    </files>
                </StackExchange_Checkout>
            </modules>
        </translate>
    </frontend>
</config>


texts: Filter Out Of Stock Products on dropdown

texts:
I'm new on Magento and I'm getting troubles with something I thought could be very easy.
In my revision form for an order I want to filter out the out of stock products as well as the ones that are disabled (Status in the product grid).
According to what I've seen, there are some methods involved, the isSalable() method that calls the isAvailable() method.
The isAvailable() method is always true for out of stock products, shouldn't be false for out of stock products?, which other criteria determine whether a product is available or salable?
digging into it, I find this method but don't understand very well what's that doing:
public function isSalable($product)
{
    $salable = $product->getStatus() == \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED;
    if ($salable && $product->hasData('is_salable')) {
        $salable = $product->getData('is_salable');
    }

    return (bool)(int)$salable;
}

Any insights on how to proceed here would be very appreciated
Thanks!


texts: how can add span in breadcrumbs in magento?

texts:
I want to change in breadcrumbs in result page. i am change in result page breadcumb.

at time my breadcrumbs html this

                            Home

                            Search &gt; ring

i want span at
  Search &gt; ring

between search and ring

  Search  ring

result.php my breadcrumbs code

$breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
        if ($breadcrumbs) {
            $title = $this->__("Search > %s",$this->helper('catalogsearch')->getQueryText());

            $breadcrumbs->addCrumb('home', array(
                'label' => $this->__('Home'),
                'title' => $this->__('Go to Home Page'),
                'link'  => Mage::getBaseUrl()
            ))->addCrumb('search', array(
                'label' => $title,
                'title' => $title

            ));
        }

Please tell me what i change


texts:
I need to remove the login and logout buttons and add an icon for this, an account icon, how can I make this change to my theme?
Basically I need to transform this ...

In that..


texts:
Magento 2 EE cost near by $22K / Year

What is features available as support?

Gives server in this cost and any support for custom development ?


texts:
I am creating a new module for the blog and stuck.

Requirement
I have a list of blogs that I am showing at the following url i.e. magento.local/blogs
It is working fine. Now, my requirement is when I click on the "Read More" link to read the blog details then I need to generate the URL i.e. http://magento.local/blogs/how-to-login-to-magento/

Currently, I am doing the following i.e.
href="getUrl('blogs/', array('title' => $news->getTitle())) ?>"> Read More

The above code is generating the following link i.e.
http://magento.local/blogs/index/index/title/how to login to magento

I know that getUrl is required module/controller/action as first parameter but again it is showing the 'title' parameter in the URL as well.

I hope I have provided enough information about my requirement.
Looking for help over here or link to an article link that describes how to achieve the current requirements....


texts: How to add Product image attribute in Magento2.2.5?

texts:
I have created Product image attribute in Backend in Magento2.2.5.

Refer my screenshot

But I am not able to see in Product detail page in Admin side.

Is there any other way to do this or I am missing something.

Any help would be appreciated.


texts:
I'm creating a custom theme inheriting from Magento Blank. I'm overriding LESS variables in my theme.less file. Must are working fine, but there are a few that arn't working. Example; Neither @breadcrumbs__padding nor @actions-toolbar-actions__reverse work.

Does anyone know what's happening here?


texts: Which is better OS for Magento 2 Ubuntu or Linux Mint?

texts:
Currently, I'm using linuxmint 20 for running Magento 2. But when I run any command or run async process ram goes to 95% and start to hang the system
Also, the issue with PHPstrom after opening multiple projects, system hangs.
Please note that I have enough system requirement i5 10th generation with 8GB ram.

Before I was using Linux mint 18 which working nicely without any issue.
Now I'm looking to change the OS. So I need your opinion to use the os for Magento 2 with PHPstrom.
Any comments or answers will be appreciated.


texts: return 501 instead 404 if database down - Magento 1.9

texts:
Magento 1.9.3.6 returns 404 if a database is down and connection could not be established.
How can we return 501 if the database is down?


texts: no possibility to unzip .zip magento on the server

texts:
I put the magento .zip file on the VPS server. then download unzipper.php from github and uplaod on the server. When I try to unzip magento folder then I get error.

Anyone know how to solve it ?


texts: Category setup and fetching CMS block from Custom Design template

texts:
This Magento newbie is trying to create a new page layout and customization for level 3 categories.  What I've done at this point is use the Custom Design tab to change the Page Layout to 1 column and call a template with the Custom Layout Update:

<reference name="series">
    <action method="setTemplate"><template>catalog/category/seriespage.phtml</template></action>
</reference>

In my page.xml files I have the block defined as "core/template".

But what I found is that in my template I could not access the category fields  with $this - calls to $this->getName() and $this-getDescription() returned null.  I finally was able to get them this way:

$category = Mage::getSingleton('category/layer')->getCurrentCategory();
$desc = $category->getDescription();  // The right stuff

However, the category ID is still unknown and not returned from a $category->getCategoryId() call as I think it should be.  I see references to $this->getCategoryId() often.

Now I want to fetch the content of a CMS static block I've created, but this too seems to return null.  Nothing is output from a statement such as:

Mage::app()->getLayout()->createBlock('cms/block')->setBlockId->('my-block')->toHtml();

Using $this instead of Mage::app() didn't work either of course, and I tried other Mage variations.  I thought defining this template in Manage Categories would give it the proper context, but apparently not.  What am I missing to get $this to be set to my category context so the typical function calls work?


texts: Magento 2 New Order Event: get Customer's telephone

texts:
I have an observer for every order status change, and another for every new order. In both observers I need to retrieve the customer's phone number. In order-status-change this happens as follows:

$phone = $order->getBillingAddress()->getTelephone();

However in new-order, none of the below succeed. They all return null. Why does this happen? What could I do?

$order->getCustomerPhone();
$order->getBillingAddress();
$order->getShippingAddress();
$order->getPrimaryBillingAddress();


texts:
I'd like to pass the search query to the product page that is clicked on.

The reasoning is because if someone searches for a product, it may be on a grouped product page, so if they click on that result it just takes them to the top of that product page. I can add the anchor tags in the grouped product table, I just need the query passed so the page scrolls to that product.

For example, if someone searches for "Red Cup" and all of my cups are on a grouped product with 50 cups on, when they click the "Red Cup" on the results page it will take them to the top of the cup page. They've then got to scroll down to find "Red Cup" manually rather than the page scrolling to that product


texts: Moved magento2 site now site missing pub/static in url

texts:
I moved a magento2 website to a new server and changed the url (so I can have a development version of the website.

Now I did the upgrade, recompile and even redeploy'ed the site since its in production mode but when I go to the site all the image/css urls are missing the pub/static part of the url and I dont know why??


texts:
Argument 1 passed to Magento\Framework\App\Action\Action::__construct() must be an instance of Magento\Framework\App\Action\Context, instance of Magento\Framework\ObjectManager\ObjectManager given

Banging my head over this.   I have cleared both
 var/di and var/generation, flushed cache and then recompiled.  Same thing happens.

Same thing with this super basic controller

<?php
namespace MyNamespace\MyModule\Controller\Loginas;

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

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

router

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


texts:
**some column are get missing before it was showing i don't know what happen now it's not showing i am attaching file please check it and help me to fix it

i tried cache clear
i tried index rebuilding but it's not work for me**


texts: Magento 2: How to Restrict Customer Email by Domain?

texts:
In my Magento 2 site, I am looking for a way to restrict signing up a user account with all email domains(eg Gmail,Hotmail) except for 2 email domains.

I found a guide that said to go to

/var/www/html/app/code/Magento/Customer/etc/adminhtml/system.xml

to add in new fields in Customer Configuration(Stores -> Configuration -> Customers -> Customer Configuration) that will allow me to configure email domains that I can block.

However, editing the system.xml file does not change anything in Customer Configuration, I have tested this by deleting the entire "Create New Account Options", and have refreshed the Magento Cache.

I am running Magento 2.1.7.

Please advice on what I have done incorrectly. I appreciate your help.


texts: CMS Page Rules Applied to a Blog Post for Magento 1.9

texts:
We have different CSS settings for a typical CMS page vs. a Blog post.

I would like the format and style from CMS applied to 1 blog post. What do I need to capture to add this inline for the blog post page?


texts:
I'm new to Magento, I'm developing a traveller website in which I need some ideas on how to create an activity by the user selects a particular activity and selects the city or the user can also select from date - to date and select the city. And based on the above selection parameters user should be able to view the list of hotels and select lunch/Dinner at that respective hotel.

How I can achieve this?


texts: How can i retrieve database name into Magento?

texts:
i'm going to clean an hosting where different databases and magento sites exist. My target is to delete everything but the one i need. The problem is that database manager prompts me different database (5), 2 of them are not connected to my magento choosed installation, the others 3 seems to be equals. I tried to explore tables that could help me, like admin_user and core_config_data, but those 3 databases seems to be the same themselves. My question is: how can i retrieve the database currently used by my installation in Magento? Another question is: these 3 dbs could be connected each other?

Thank you


texts:
$customer = $observer->getEvent()->getCustomer();

It returns all the data about the customer with my custom attribute, but how to get this attribute, I tried many options, but give an error

using event adminhtml_customer_save_after


texts: Magento 1.9 category filter not working based on store id

texts:
I am using the following code to filter the category based on store id and custom attribute, but its not working..

$category = Mage::getModel('catalog/category')
                    ->getCollection()

                    ->addAttributeToSelect('*')

                    ->addIsActiveFilter()
                    ->setStoreId(1)
                    ->addAttributeToFilter('custom_attribute', array('notnull' => true))
                    ->addAttributeToFilter('custom_attribute', array('neq' => ''))
                    ->getAllIds();


texts: Magento M1 -> M2 migration, Class eav/entity_attribute_backend_array does not exist error

texts:
After migrating Magento 1 products to Magento 2 I get this error in backend when opening products:

  {"0":"Class eav/entity_attribute_backend_array does not exist","1":"#1 Magento\Framework\Code\Reader\ClassReader->getConstructor() called at [vendor/magento/framework/ObjectManager/Definition/Runtime.php:49]\n#2 Magento\Framework\ObjectManager\Definition\Runtime->getParameters() ... /","script_name":"/index.php"}

Before importing products I have imported categories and attributes.
Magento 1.9.3. -> Magento 2.3.2


texts: Magento2: How can solve two shipping option selections in estimated shipping?

texts:
I have added two shipping options and getting price in estimated shipping section in cart page. but when I select one shipping option then it is selecting both option. I need one selection at a time as default work. please check attech screenshot:

Please find my code where I am calling both shipping options in

  /app/code/Mageplaza/MyModule/Model/Carrier/Carrier.php

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

     $shippingPrice = 0;
     $premiumshipPrice = $shippingPrice+15;

     $shippingPrice=(float)$shippingPrice;
     $result = $this->_rateResultFactory->create();
    $methodship= array( "Standard Shipping", "Premium Shipping");
    foreach($methodship as $mship) {
            if($mship == "Premium Shipping")
            {
            $method = $this->_rateMethodFactory->create();
            $method->setCarrier($this->_code);
            $method->setCarrierTitle($this->getConfigData('title'));
            $method->setMethod($this->_code);
            $method->setMethodTitle($mship);
            $method->setPrice($premiumshipPrice);
            $method->setCost($premiumshipPrice);
            $result->append($method);
            }else{

            $method = $this->_rateMethodFactory->create();
            $method->setCarrier($this->_code);
            $method->setCarrierTitle($this->getConfigData('title'));
            $method->setMethod($this->_code);
            $method->setMethodTitle($mship);
            $method->setPrice($shippingPrice);
            $method->setCost($shippingPrice);
            $result->append($method);
            }
            }
                return $result;
        }

please let me know If I am missing something here, Kindly help me for this.


texts: 404 Errors when trying to access other subdirectories in root with magento serving as primary (Solved)

texts:
I have magento located in a subdirectory in public_html/magento the .htaccess I used to redirect magento to the root is based on installing Magento in subdirectory

Root .htaccess file contains

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com$
RewriteCond %{REQUEST_URI} !^/magento/
RewriteRule ^(.*)$ /magento/$1

The .htaccess in magento only has the change of

you can put here your magento root folder
path relative to web root

RewriteBase /

I would like to be to be able to access other web applications which are located in public_html ie (blog, CMS, forum) without magento throwing a 404 error.

I tried using Serve main domain from subdirectory with .htaccess example but magento still takes over.

RewriteEngine on
# Part 1
RewriteCond %{HTTP_HOST} ^(www.)?topdomain.com$ [NC]
RewriteCond %{REQUEST_URI} !^/topdomain/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /topdomain/$1
# Part 2
RewriteCond %{HTTP_HOST} ^(www.)?topdomain.com$ [NC]
RewriteRule ^(/)?$ topdomain/index.php [L]

what do I need to put in the root .htaccess to make magento play nicely so
that I can have

└── httpd
    ├── blog (topdomain/blog
    ├── cart (topdomain
    ├── forum (topdomain/forum


texts: Checkout issue - undefined method in getConfigurableAttributeCollection

texts:
We have an issue on checkout. Customers are not able to redirect on the payment gateway in some cases. Help is welcome.
We are using the Magento version 2.3.3 and we are getting below error.

Error: Uncaught exception 'Error' with message 'Call to undefined method Magento\Catalog\Model\Product\Type\Simple::getConfigurableAttributeCollection()' in /home/ortlieb/public_html/vendor/magento/module-configurable-product/Helper/Product/Options/Loader.php:52
Error: Uncaught exception 'Error' with message 'Call to undefined method Magento\Catalog\Model\Product\Type\Simple::getConfigurableAttributeCollection()' in /home/ortlieb/public_html/vendor/magento/module-configurable-product/Helper/Product/Options/Loader.php:52
in Magento\ConfigurableProduct\Helper\Product\Options\Loader::load called at /home/ortlieb/public_html/vendor/magento/module-configurable-product/Model/Product/ReadHandler.php (48) in Magento\ConfigurableProduct\Model\Product\ReadHandler::execute called at /home/ortlieb/public_html/vendor/magento/framework/EntityManager/Operation/Read/ReadExtensions.php (48) in Magento\Framework\EntityManager\Operation\Read\ReadExtensions::execute called at /home/ortlieb/public_html/vendor/magento/framework/EntityManager/Operation/Read.php (112) in Magento\Framework\EntityManager\Operation\Read::execute called at /home/ortlieb/public_html/vendor/magento/framework/EntityManager/EntityManager.php (70) in Magento\Framework\EntityManager\EntityManager::load called at /home/ortlieb/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product.php (648) in Magento\Catalog\Model\ResourceModel\Product::load called at /home/ortlieb/public_html/generated/code/Magento/Catalog/Model/ResourceModel/Product/Interceptor.php (258) in Magento\Catalog\Model\ResourceModel\Product\Interceptor::load called at /home/ortlieb/public_html/vendor/magento/framework/Model/AbstractModel.php (540) in Magento\Framework\Model\AbstractModel::load called at /home/ortlieb/public_html/vendor/magento/framework/Interception/Interceptor.php (58) in Magento\Catalog\Model\Product\Interceptor::___callParent called at /home/ortlieb/public_html/vendor/magento/framework/Interception/Interceptor.php (138) in Magento\Catalog\Model\Product\Interceptor::Magento\Framework\Interception{closure} called at /home/ortlieb/public_html/vendor/magento/framework/Interception/Interceptor.php (153) in Magento\Catalog\Model\Product\Interceptor::___callPlugins called at


texts: Failed to load resource: the server responded with a status of 403 (Forbidden) magento 1.9.3

texts:
I have shifted my magento site from one server to another. Everything is working fine except some images are not getting loaded like logo,background image. It is showing 403 error. I have checked folder and file permissions they are 755 and 644. Kindly help me to resolve this error.
Thanks in advance.


texts: Magento : Admin User Save After Event not Working

texts:
I am using this code

     <adminhtml>
         <admin_user_save_after>
                <observers>
                    <my_test_admin_user_save_after_observer>
                        <class>MY_Test_Model_Observer</class>
                        <method>userSaveAfter</method>
                    </my_test_admin_user_save_after_observer>
                </observers>
         </admin_user_save_after>
    </adminhtml>

This not call observer MY_Test_Model_Observer

Any idea how to call admin user save after event.


texts: I want to resize all the images or resize the images box of product images. As some are uneven, the box of the product display inside the category page is being un-uniform.


texts: How to add Custom Field to Billing Customer Address

texts:
I want to add a custom filed on the Billing Customer Address and i want this filed to appears on the registration page too.

Does anyone know what steps i need to follow to do this?
The only thing I found is this link: http://excellencemagentoblog.com/blog/2011/11/29/magento-adding-custom-field-to-customer-address/

but this post is from 2011 and i don't know if it will work, because i use magento 1.9.2.4

Thank you in advance.


texts: Get quantity in stock for items added in cart in JS

texts: I need the quantity available for each product in cart in my custom javascript file. Does anyone know how to do this?


texts: Why my Disabled product collection gives empty array in magento 2?

texts:
I want to get disabled product id's in my system but it gives me an empty array.
Here is screenshot of my products.When i grab disabled product by using this code
$updatedproids = [];
    $productCollection = $this->_productCollectionFactory->create();
    $productCollection->setFlag('has_stock_status_filter', false);
    $productCollection;

    foreach ($productCollection as $product) {
        $updatedproids[] = $product->getId();
    }
print_r($updatedproids);

I think there should be an issue with Magento Saleable Quantity but i'm not sure why i didn't get this.


texts: Magento 2: Add track order link with the order on Order History Page

texts:
Add track order link on Order History Page

  <block class="Magento\Shipping\Block\Tracking\Link" name="tracking-info-link" template="Magento_Shipping::tracking/link.phtml">
      <arguments>
          <argument name="label" xsi:type="string" translate="true">Track your order</argument>
      </arguments>
  </block>


texts: How to put my block in catalog_product_view page

texts:
My XML code is here

<?xml version="1.0"?>
<layout version="0.1.0">
<catalog_product_view>
    <reference name="product.info">
        <block type="demo/demo" before="product.description" name="demo" template="demo/demo.phtml" />
    </reference>
</catalog_product_view>
</layout>

i want to put my block under product.info and above product.description

i dont to change any core file and dont want to use getChildHtml method


texts:
Can anyone let me know how to change UTC time from table column to IST(Indian Standard time) programatically with Datetime format?

I have currently following date time value available in UTC format and i need to convert it into Indian Standard Time in Magento2:

2018-09-18 11:13:07 AM (UTC)

it should convert to IST with following:

2018-09-18 04:43:07 PM (IST)


texts: Magento 2 - custom validator before order placement

texts:
I would like to add a custom validator before oder placement.
The validor will check if the customer has a default shipping and billing address before to validate the order. If the customer hasn't default billing ans shipping address, I would like to put the address of the order to the default addresses of this customer.

I did a DefaultAddress.js in /app/code/Vendor_Name/Module_Name/DefaultAddress/view/frontend/web/js/model

define(
[
    'jquery',
    'mage/validation',
    'uiComponent',
    'Magento_Checkout/js/model/payment/additional-validators',
    'Magento_Checkout/js/model/quote',
    'Magento_Customer/js/model/customer',
    'Magento_Customer/js/model/address-list'
],
function (Component, additionalValidators, quote, customer, addressList) {
    'use strict';

    return {

        /**
         * Validate checkout agreements
         *
         * @returns {Boolean}
         */
        validate: function () {
            var defaultShippingAddress = false;
            var defaultBillingAddress = false;

            if (customer.isLoggedIn()) {
                // CHECK IF CUSTOMER HAS DEFAULT BILLING / SHIPPING ADDRESS
                    // IF NO , ADD QUOTE ADDRESSES ON CUSTOMER ACCOUNT
                        // --> Return true to validate the order

                    // IF YES , RETURN true to validate the order
            }
        }
    };
}

);

Can you help me ?


texts:
I have created a menu in the configuration menu.

  system.xml:

I have an observer and I want to get the values of those two fields.

How can I do that?

Thanks for any help!


texts: Allowing multiple currencies per product in magento 1.9.0.1

texts:
Got an uphill task here. I want to allow multiple currencies per product. I know that magento allows multiple currencies at global, store and website level. Is there any way to hack around for allowing multiple currencies per product? I've attached a screen shot.

First field is assigned to USD, I want to assign other 2 fields to INR and Euro respectively.
I've came across innoexts extension which can do it, but it is a paid extension and my company doesn't want to pay for that.


texts: How can I set Source Priority for Source Selection Algorithm in Magento MSI (Multi Stock Inventory)?

texts:
I have been exploring MSI. I came across the "Source Selection Algorithm" when creating a shipment.
It has two options:

"Distance priority"
"Source priority"

  When I select "source priority" nothing happens.

  Where and how can I set this priority?
  The order of the sources is set when we created the Inventory stock (Stores > Inventory: Stocks)


texts: Override Magento/Checkout/view/frontend/web/js/view/shipping.js in custom theme not working

texts:
I try to override the Magento/Checkout/view/frontend/web/js/view/shipping.js file in my custom theme.

New location of the file:

app/design/frontend/Vendor/theme/Magento_Checkout/web/js/view/shipping.js

Location of my requirejs-config.js file:

app/design/frontend/Vendor/theme/requirejs-config.js

Contents of my requirejs-config.js file:

var config = {
    map: {
        '*': {
            'Magento_Checkout/js/view/shipping': 'js/view/shipping'
        }
    }
};

I refreshed all caches and deployed static content but I keep getting the following 404 error in my console:

GET http://domain.loc/pub/static/frontend/Vendor/theme/nl_NL/js/view/shipping.js

I also tried to move the requirejs-config.js file into my Magento_Checkout folder.


texts: How resource intensive is it to get customer data?

texts:
I have created a data layer for google tag manager purposes. Currently, it is being loaded on every page. I am concerned about it increasing the pages load time.

For example, I'm looping through customer orders:

   $orderCollection = Mage::getResourceModel('sales/order_collection')
        ->addFieldToSelect('*')
        ->addFieldToFilter('customer_id', $customer->getId())
        ->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
        ->setOrder('created_at', 'desc');

        foreach ($orderCollection as $_order){
            $payment_method[] =  $_order->getPayment()->getMethodInstance()->getTitle();
            $shipping_method[] = $_order->getShippingMethod();
        }

Should I be worried about this slowing down my site for customers?


texts:
Below is a section of our URL.

  ...&dir=asc&limit=20&np=1&order=price&product_applications_year=710&product_type=623

I need to search this string for various things like 'limit' or 'product_type' or 'order' and retrieve the conents of that thing after the '='.

How is this possible?


texts: Tier prices are not applied on adding to cart

texts: I have set tier prices on products. while adding to cart the price should be like attached screenshot. Normal price is 30 while for 2 it will become 29.5 but after adding to cart it still shows 30 for each quantity (Tier prices not working). I am using Magento2.2.4`. There is no related log, So I have no idea where is the issue?


texts: How to get rid of the already searched list

texts:
When i go to type in a product code as they all start with the same two letters i get a big long list of already searched for products, How can i get rid of this list as i don't like the way it looks on my site. We have Blast Search Lucene installed so i asked them but they said it was one of the magento core functions that was showing this list.

What file would i have to edit so that this list is made or doesn't appear


texts: NGINX cross control origin header added but font files still blocked by CORS policy

texts:
I have added the following headers to all the locations where my static content is mentioned in the Nginx conf file and it removes the CORS issue for all files except for font files such as woff2 or ttf.

location /static/ {
# Uncomment the following line in production mode
# expires max;
add_header 'Access-Control-Allow-Origin' '*' 'always';

if ($request_method = 'OPTIONS') {
    add_header 'Access-Control-Allow-Origin' '*' 'always';
    add_header 'Access-Control-Allow-Headers' 'x-requested-with' 'always';
    add_header 'Access-Control-Max-Age' 86400 'always';
    add_header 'Content-Length' 0 'always';
    return 204;
}

# Remove signature of the static files that are used to overcome the browser cache
location ~ ^/static/version {
    rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
}

location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|json)$ {
    add_header 'Access-Control-Allow-Origin' '*' 'always';

    if ($request_method = 'OPTIONS') {
        add_header 'Access-Control-Allow-Origin' '*' 'always';
        add_header 'Access-Control-Allow-Headers' 'x-requested-with' 'always';
        add_header 'Access-Control-Max-Age' 86400 'always';
        add_header 'Content-Length' 0 'always';
        return 204;
    }
    add_header Cache-Control "public";
    #add_header X-Frame-Options "SAMEORIGIN";
    expires +1y;

    if (!-f $request_filename) {
        rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
    }
}
location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
    add_header Cache-Control "no-store";
    #add_header X-Frame-Options "SAMEORIGIN";
    expires    off;

    if (!-f $request_filename) {
       rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
    }
}
if (!-f $request_filename) {
    rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
}
#add_header X-Frame-Options "SAMEORIGIN";
}

Here is the error msg:

  Access to the font at
  'https://static.magento-test.mysite.com/adminhtml/Magento/backend/en_US/fonts/opensans/bold/opensans-700.woff2'
  from origin 'https://magento-test.mysite.com' has been
  blocked by CORS policy: No 'Access-Control-Allow-Origin' header is
  present on the requested resource. (index):762 GET
  https://static.magento-test.summerraingroup.com/adminhtml/Magento/backend/en_US/fonts/opensans/bold/opensans-700.woff2
  net::ERR_FAILED

I don't get why I still get the CORS issue. Any idea?


texts: Error when creating downloadable product

texts: When i try to create a downloadable product,i face the below issue when trying to upload the music file(<2mb).I'm new to magento.Someone pls help..


texts: Magento 2.3 : state 400, no error neither in console neither in log but not working

texts:
I have quit "original" problem with Magento (if only if was original with Magento :p).
I browse product (for now everything fine), I put product in basket (everything fine), go to checkout and complete form (still fine) and go to payment and when I click on place-order nothing happen.
Going on console - no problem
Going in network - 400 payment-information (yes 400 neither 500 neither 404 :p)
then checking var/log - no problem (ಠ_ಠ)
(Of course for dear Magento I do after each change when I want to test :
 - sudo rm -rf generated/*
 - sudo rm -rf var/*
 - sudo rm -rf cache/*
 - sudo php bin/magento setup:upgrade
 - sudo php bin/Magento setup:static-content:deploy -f
 - sudo php bin/magento detup:di:compile
 - sudo chmod -R 777 ./)
Someone had similar issue ? if yes then how to know where come from the issue ?
PS: in case of minus please let me a comment so that I can improve the post


texts: Magento 2 PayPal Payment Standard For German Shop

texts:
I have a question about PayPal Payment Standard, it doesn't seems to be available for all countries. My shop is located in Germany, this country only has the option for express checkout. Can anyone tell me if it's allowed to use PayPal Standard for Germany since it's not available by default?

Thanks in advance.


texts:
As of Magento 2.4.0, Elasticsearch 7.6.x is required for all installations. Our shared hosting provider doesn't support Elasticsearch.
What can we do to update to Magento 2.4.0 while keeping the search function working correctly?
We're looking for a free solution.


texts: try to export getting export.php error as follows

texts:
I trying to export db but getting the error

export.php: Missing parameter: what[a@doc/html/faq.ht!ml#faqmissingparameters@documentation]

export.php: Missing parameter: export_type[a@doc/html/faq.html#faqmissingparameters@documentation]

please help!


texts: Want to create REST API Admin access authentication in module ? And get last order json data magento 2

texts:
I have found below code in magento stack exchange. but i dont know where to put this code in custom modules.
$userData = array("username" => "admin", "password" => "admin123");
$ch = curl_init("http://mystore/index.php/rest/V1/integration/admin/token");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($userData));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Content-Lenght: " . strlen(json_encode($userData))));

$token = curl_exec($ch);

$ch = curl_init("http://mystore/index.php/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=category_id&searchCriteria[filter_groups][0][filters][0][value]=10");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . json_decode($token)));

$result = curl_exec($ch);

$result = json_decode($result, 1);
print_r($result);


texts: 500 Internal Server Error After upgrading magento from 2.1.7 to 2.2.2

texts:
I have updated magento through the command line.When i checked the version, it was successfully upgraded to 2.2.2, but while accessing the frontend and backend...Iam getting the 500 Internal Server Error.

And in reindex I am getting the error:

Table "CatelogInventory_Stock_Status_Replica" doesnot exist.

Catalog Rule Index, Catalog Product Rule Index and Stock Indexes are failed.

Do any one have experienced this, please suggest ....

  Iam stuck with the Magento upgrade please help....


texts: Different Facebook pixels for each store/store-view/website

texts:
I have 4 shopify stores that I am hoping to convert into a single one using Magento. Far as I understand, it is possible to configure different prices, shipping methods, payment methods for each store.

What I have not any help with all the Googling is if I could use four different Facebook pixels each for the four stores.

So, any help with how to achieve it would be vastly appreciated.


texts: How to import the CMS content in CSV file

texts: I want to import the CMS content in to .csv file. So can anyone has used any tool to import the CMS content.


texts: Magento 2.2 How to add product sku to order confirmation email?

texts:
I am working on a new site using Magento 2.2. This is my first project using Magento 2. Can anyone guide me how to add the product SKU to the order confirmation email?

When I go to Backend -> Marketing -> Email Templates -> edit the New Order Confirmation Template, I saw this  {{layout handle="sales_email_order_items" order=$order area="frontend"}} which will output the order product details. But I am not sure which file I should edit to add the product SKU, thanks.


texts: How to add manufacturer details in grouprd product?

texts:
i want to show manufacturer details in grouped product.
but i am not getting the manufacturer attribute in product detail page.
For reference please find the attached image.


texts: How to make magento/checkout/cart/ input readonly and disable UPDATE button

texts:
I update the QTY based on case_size of a product. I've made an observer to do that. If the case_size is 144 and a customer buys two cases then QTY will automatically become 288PCS. When the customer clicks the Edit button then the product QTY on the add to cart page goes back to 2 case. Everything is working good, but when a customer edits the QTY see (image) then everything goes wrong of course!!

I want to remove the UPDATE button and make the QTY input readonly but until now no luck.

I've tried app\design\frontend\base\default\template\checkout\cart.phtml but it works on the magento/checkout/cart/configure page not on magento/checkout/cart/ (see image)

Any tips would be highly appreciated.

Thank you all


texts: M2 InstallData add custom customer attribute (dropdown)

texts:
I have a InstallData.php which adds a custom customer attribute and everything works fine. In the backend I have an input field.

Now I would prefer to have a drop down select instead of the input field.

Can anyone tell me how to modify my InstallData?

use Magento\Customer\Api\CustomerMetadataInterface;
use Magento\Eav\Model\Config as EavConfig;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{
    /**
     * InstallData constructor.
     * @param EavSetupFactory $eavSetupFactory
     * @param EavConfig $eavConfig
     */
    public function __construct(EavSetupFactory $eavSetupFactory, EavConfig $eavConfig)
    {
        $this->eavSetupFactory = $eavSetupFactory;
        $this->eavConfig = $eavConfig;
    }

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

        $attributeCode = 'my_code';

        $eavSetup->addAttribute(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, $attributeCode, [
           'label' => 'My Code',
           'required' => 0,
           'user_defined' => 1,
           'system' => 0,
           'position' => 120,
        ]);
        $eavSetup->addAttributeToSet(
          CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER,
          CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER,
          null,
          $attributeCode
        );
        $attribute = $this->eavConfig->getAttribute(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER, $attributeCode);
        $attribute->setData('used_in_forms', [
           'adminhtml_customer',
        ]);
        $attribute->getResource()->save($attribute);
    }
}


texts: How to move country and region dropdown inside street field on checkout in Magento 2

texts:
I want to move country and region dropdown inside this street fieldset. How can I move that?
<fieldset class="field street admin__control-fields required" data-bind="css: additionalClasses"> .. </fieldset>

Any help would be appreciated.
Thanks.


texts: Magento2 - How to add row pattern/dynamic array serialization rows to the custom product page?

texts:
How to add Custom Row and Add Value Dynamic array in serialisation rows?

Here I have attached the screenshot:


texts: Identifying who deleted products from Magento Admin

texts:
I have lost a lot of products from my catalogue seemingly over night (products missing are in sequential order)

I suspect these were deleted from the Magento Admin. (I have the community, not enterprise edition)

How can I see the logs of the computer that I suspect deleted these products?


texts:
we have entered the price already. Now we have received our VAT Tax rate and we need the prices on frontend product pages to show the new OLD RATE + VAT total figure.

But it doesnt happen that way. Im not able to find that settings too.
Am I missing something ?


texts: In Magento 2.2.5, Login link is displaying even customer loggedIn

texts:
In Magento 2.2.5, I am checking the customer is logged in or not in order to display the login link in case if he is not logged in. If he is logged In means I need to display the My Account link.

When I am trying to login, it is logging in correctly and when navigating to other page, In header menu it is showing the Login even after login.

Any solution for this.

Note:
I have disabled page cache in backend.


texts: Show Customer's Birthday Reminder in Popup to Admin

texts:
I have a custom input field where customer is asked to add his/her birth date. That data will be saved along with customer account information.

What I need to develop is, to show admin a popup when he logs in backend. That popup will show list of customer(s) having birthday's. The Birthday list will be based on following criteria

If a customer has birthday today or in next 4 days.

For example if current date is 30th July it will show like:

Birthday(s) Today:
Customr 1, Customer 2

1st July:
Customer 3

2nd July:
Customer 4

I am not able to figure out,

How to list birthdays of customers and show in popup when admin logs
in backend
Do not show the birthday notification popup if admin explicitly
closes it.

This is for boosting the sales of our store. The customers having birthday will be given a special promo code.

Thanks


texts:
We have a lot of products that aren't real products on their own, they are move customised versions of another product.
So in terms of stock values for these SKUs we really want to link them to the main product they're based on.
So I've looked at adding an 'alt_sku' attribute to the product, I was then hoping in the afterGetQty plugin to check if the product has this attribute, if it does load that alt product and get the Qty from that.
But this plugin never retrieves the product Qty value or doesn't fire when I expected, Does anyone know what the best method to extend with a plugin that would catch most areas where Magento tries to find out a products stock Qty? We're not using MSI just basic stock qty.


texts: Magento 1 HTTPS rel -canonical tag and redirect

texts:
When we change the base unsecure URL to https does this also update the rel -canonical tag on pages. My concern is how are these changed to HTTPS as these will also need to be changed to HTTPS for the full site to be indexed correctly.

Secondly does changing the unsecure base url to HTTPS also create an automatic 301 redirect from the old HTTP page to the new HTTPS page or is this done in the htaccess?


texts: magento 2 logout customer after successful registration

texts:
I need to logout the user after successful registration. How can I achieve this,

Is there a admin settings in backend to do this.


texts: How to discount for a particular simple product under a bundle product?

texts:
I have bundle products.
I want to apply discount to only those bundle product in my cart which contains specific simple product (meaning to reflect in grandtotal) else no discounts

Consider bundle product as B and its simple product as S1, S2, S3 with prices 40, 60, 80 respectively
For ex. If any bundle product have S2,then give 50% discount for the amount for that simple product.
Assume my cart got 2 bundle product B1 & B2 in which B1 contains S1,S2,S3 whereas B2 contains S1,S3,
so that cart total after applying discount coupon should be like this:
B1: 150 & B2: 120 thereby totalling 270
**B1 (S1:40, S2:30, S3:80) and B2 (S1:40, S3:80)
Can anyone help me on this?


texts:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'pinnacle_mage476
    .mgw2_store_website' doesn't exist, query was: SELECT mgw2_store_website.
    * FROM mgw2_store_website

I am facing this issue. Anyone help fix this
Thanks


texts: How to add selected items on a page to a separate block in Magento 2?

texts:
Please help with the implementation of this functionality. I have a separate module with a separate route.

There will be elements on the page (picture and checkbox under it) as in the screenshot.

And when you click the checkbox, the picture should be added to another block below.

I have a module and a file that shows the elements on the page.

  app/code/Test/Module/view/frontend/templates/items.phtml

This is the markup of these elements.

elements set

            <img src="<?php echo $this->getViewFileUrl('Test_Module::images/image1.png'); ?>" />

                <input type="checkbox" />

            <img src="<?php echo $this->getViewFileUrl('Test_Module::images/image1.png'); ?>" />

                <input type="checkbox" />

Please help with the implementation of the functionality that will add the selected item to a separate block


texts: Can I made a full-width block before the footer on a 2columns-left page?

texts:
I would like to put a full-width block just before my footer on my search results page (<catalogsearch_result_index>) using my local.xml file, but I can't seem to figure out how to do it.

I have a block I made as a core/template type that is working on other pages. It is a carousel with products in it. When I add it to the search results page, it shows up on the right side, not taking up the full width because it is a 2columns-left page.

I could add the block inside the footer itself at the top (which I have also had trouble accomplishing), but this would not be ideal since the background color for the footer differs from the block.

So, do you know of any way I can accomplish what I am trying to do?

Thank you.


texts: Somehow all products were deleted - Magento

texts:
This one is quite unusual.

A client was bulk deleting products from Magento (latest build) and somehow nearly all products were deleted.

Here is the client's description:

Following a successful routine deletion of a batch of products a second attempt following the same procedure appears to have resulted in every product being deleted including those not selected for deletion.
Steps followed.
From the admin toolbar, “manage products” page was selected, then scrolled to page 34 out of 34. Then clicked select all, then de-selected each product i wanted to keep. Then selected delete from actions dropbox and clicked submit. The result was successful deletion of the products that had been selected for deletion.
The process was repeated for page 33 out of the remaining 33 pages. The command failed to process as indicated by the loading symbol in the browser bar continuing to rotate for about 4minutes before the command was terminated by clicking the loading symbol to halt the process. During this time it is possible that SSL certificates were being installed on the website by another user. When the page was later refreshed lthe majority of products from the site had been deleted from pages 1-33. Without any further commands to delete remaing products, as time passed more of the remaining products were deleted from the catalogue until all products were eventually deleted.

Does anyone have any idea what may have happened here?

Many Thanks
Chris


texts: Email Notification not delivered to customers in Magento

texts: I am new to Magento. As an admin i am getting email notifications on orders. But customer doesn't get any email notification on orders, password reset, etc. Is there any settings to be enabled it for customers?


texts: Magento2: How to redirect minicart on checkout cart page?

texts: How can I redirect on checkout cart page once I click on Minicart instead of toggle.


texts:
We have an issue with Purchase Order payment method. The problem is when you click the Place Order button at the end of the checkout, it briefly shows 'Submitting Order' then the message vanishes. Nothing happens, no order is created and you are not taken to the success page.

This started after installing the latest patch's for Magento and even after removing the installed patch's, the button still fails to work.

We have searched for a fix for this, but alas, none have worked for us yet.


texts: How set default user data for checkout address fields, enter by user on other pages

texts:
Many time user (guest or register) enter email id or pin code or any other detail in various custom modules generally used for promo or validation. I want to use same data to be reflect in checkout billing or shipping user information. Like save data in session then populate same in checkout form fields.
If possible for register user these values reflect rather than previous values.

How to achieve this?


texts: Custom Customer attribute that auto_increments

texts:
I need a custom customer attribute of type int that should start with some 5-digit number and auto-increments each time a new customer is created.

Approach 1:
Or should I make a simple int type attribute and fill it with customer's auto generated ID plus some 5-digit number as follow.

customer_id = 30;
custom_id = 10030;

Approach 2:
Is there a way in magento to create an attribute of input type auto_increment? So I can set the default value to '10000' and it always get increment for new customer? If yes, then how can I make it auto_increment.

$installer->addAttribute('customer', 'cotp_id',  array(
    'type'     => 'int',
    'label'    => 'COTP ID',
    'input'    => 'hidden',
    'source'   => '',
    'visible'  => true,
    'required' => true,
    'default' => '10000',
    'frontend' => '',
    'unique'     => true,
    'note'       => 'Custom Attribute'
));

Approach 3:
Or should I try to achieve this through some observer that call upon every time a new customer created, then get the attribute latest/highest value and increment one in it?


texts: Buy one specific product and get another specific product for free: 1 gift per one chargeable product

texts:
I created rule for  "buy one specific product and get another specific product for free" (which works for me):

Only thing is that when I put chargeable product and two gift products in the shopping cart are both gift products on the website for free. Although, it should be one gift product for one chargeable product, 2 gift products for two chargeable products etc..

What should I do that customer gets for one chargeable product only one gift product for free?


texts: How to call an observer from custom module: Magento 2

texts: I built a custom module which has a custom observer OrderSaveAfter.php. How can I call any function inside the custom observer from another custom code ?


texts: How to make a module that will replace the standard saving bundle

texts:
The task is to specify a fixed price when creating a bundle of products and dynamically change the price of products. For example, put the price 100 and chose 3 products with prices 50 - 50 - 50, while you need to subtract a certain percentage from 50 - 50 - 50 to get exactly 100. Further, these new prices are displayed in the catalog and also when buying in the basket. Help me please)
Direct at least which way to go, otherwise a beginner)


texts:
I am getting the following error while re-indexing the product flat data and i am also unable to import products it throws the 503 error.

  Product Flat Data index process unknown error: exception
  'PDOException' with message 'SQLSTATE[42000]: Syntax error or access
  violation: 1118 Row size too large. The maximum row size for the used
  table type, not counting BLOBs, is 65535. You have to change some
  columns to TEXT or BLOBs'

From the error i can understand that i have too many attributes because which it is exceeding the limit but how should i resolve this ?

Thanks


texts: Magento 2 how to configure Nginx to allow execute other php files in root folder

texts:
How to configure nginx to let magento execute php files.

For example I created phpinfo.php and I'd like to execute it.

Where should I put it? ./ or ./pub/ ?

What do I need to write into the config ?


texts: What format should be used for the news_from_date attributre?

texts:
Adding a date to the news_from_date to a new product using the calendar returns to this format: dd/mm/yyyy

but if I mass import (via magmi) a DB the value in magento has been changed to something like "11/30/00-1" which is obviously wrong.


texts: TypeError: getCartParam is not a function in M2.0.X and TypeError: cart is not a function in M2.1.X

texts:
Working With Magento 2.0.X After successfully overriding vendor/magento/module-checkout/view/frontend/web/template/minicart/content.html in my extension, its giving me error in my browser console

  i.e TypeError: getCartParam is not a function.

And after some RND, I have found solution to replace getCartParam to cart and its working fine.

But when I test my extension in M2.1.X it gives me the error

  i.e TypeError: cart is not a function

And then I revert back cart to getCartParam and it's working.

So, I have to develop two different extensions for M2.0.X or M2.1.X to achieve compatibility?

Is their any code difference between M2.0.X and M2.1.X?

Why this is happening?


texts: jQuery Too much recursion error in Magento Advanced products Options extension

texts:
I am using Advanced Product Options Extension (https://www.mageworx.com/advanced-product-options-magento-extension.html) in my magento store. Problem is when I add a product in cart and try to add different product again then I am facing too much recursion error in console in below code:

// for correct decorating of options

        if (typeof(decorateGeneric)!='undefined') {

            var parentDecorateGeneric = decorateGeneric;

            decorateGeneric = function(elements, decorateParams) {

                parentDecorateGeneric(elements, decorateParams);

                dependentOptions.decorateIsLast();

            };

        }

For instace you can checkout here: https://delissimodeli.com/breakfast-16.html
Try to add one product in cart. After that try to add another product in cart.
Can someone help me out in this?

Thanks


texts: How to change theme for magento multiple store?

texts:
I'm using Magento 1.7.0.2.

I follow this Tutorial for creating the website on my local machine.

Default magento url is: http://localhost/magento

My new site URL is: http://localhost/magento/newsite

Now I have to change the "THEME" for the new site.

I've tried these methods:

Method 1:

system -> configuration
Change the current configuration scope  to my new site.
General -> Design ->theme (give the theme name modern for Templates

Method 2:

system -> Design -> Add design
select my site and theme (modern)

But the theme didn't change it always take the theme which I gave for the default config.

How to set the Different theme for different site form single back-end.

Is there any way to change the theme?

Cheers


texts:
I need to create the role for shipping programmaticaly.

My role:
If if insert into shopping cart code s0001-->quantity > 200 --> discount -10%

this is my code:

    $rule = Mage::getModel('salesrule/rule');
$customer_groups = array(0, 1, 2, 3,4);
$rule->setName($sku)
  ->setDescription('')
  ->setFromDate('')
  ->setCouponType(0)
  ->setCouponCode(0)
  ->setUsesPerCustomer(0)
  ->setCustomerGroupIds($customer_groups) //an array of customer grou pids
  ->setIsActive(1)
  ->setConditionsSerialized('')
  ->setActionsSerialized('')
  ->setStopRulesProcessing(0)
  ->setIsAdvanced(1)
  ->setProductIds('')
  ->setSortOrder(0)
  ->setSimpleAction('by_percent')
  ->setDiscountAmount($discount)
  ->setDiscountQty(99999999999999)
  ->setDiscountStep(1)
  ->setSimpleFreeShipping('0')
  ->setApplyToShipping('0')
  ->setIsRss(0)
  ->setWebsiteIds(array(1));

$conditions = array(
        "1" => array(
                "type"              => "salesrule/rule_condition_product",
                "attribute"     => "sku",
                "operator"          => "==",
                "value"         => "$sku"

        ),
        "1--1" => array(
                "type"              => "salesrule/rule_condition_product",
                "attribute"         => "quote_item_qty",
                'operator'      => ">",
                'value'         => "$qty"
        )
    );

$rule->setData('conditions',$conditions);

The first part imported well.
What error?
Thanks
Ale


texts: Remove currency symbol on prices from some pages - NOT ALL

texts: I would like to remove the currency symbols from prices, but not in the cart and checkout page. It could be done with CSS but is there another way to approach this?


texts: Constr is not a constructor on layout.js line 137 error custom module

texts:
I have gone through this posts and tried to implement the answers and suggestions

Magento2 getting 'Constr is not a constructor' error for custom theme &&  Error in layout.js, cart not loading && No Way to Clear/delete a Selected Image using Media Browser on category edit page

But I am not able to resolve this issue .

Here is what I have done -> I am trying to reuse module-checkout/view/frontend/web/js/view/billing-address.js file in my custom module, Here is what I have done so far

This is my registration.js file

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

This is Rahul/Learning/etc/module.xml file

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

This is Rahul/Learning/view/frontend/requirejs-config.js

var config = {
    config: {
        mixins: {
            'Magento_Checkout/js/view/billing-address': {
                'Rahul_Learning/js/view/billing-address': true
            }
        }
    }
};

and at location Rahul/Learning/view/frontend/web/js/view I have copy pasted  module-checkout/view/frontend/web/js/view/billing-address.js file without any changes but I am getting this error on checkout page

Looking forward for your suggestions not sure what I am doing wrong here.

Thanks


texts: What is max_messages proper value for running message queue using cron job?

texts:
I'm using Magento 2.4.1, and this is my message queue configuration in app/etc/env.php
'queue' => [
    'consumers_wait_for_messages' => 0
],
'cron_consumers_runner' => [
    'cron_run' => true,
    'max_messages' => 2,
    'single_thread' => true,
    'consumers-wait-for-messages' => 0,
    'consumers' => [
        'product_action_attribute.update',
        'product_action_attribute.website.update',
        'exportProcessor'
    ]
]

I set the max_messages to 2 , I don't know if this is enough or gonna cause any trouble later


texts: I found some malicious code in all index.php of magento 1.9.2


texts:
how to multi select the category and filter the result based on selected category.

I need some free extension or some proper guidance to fix this issue.

I am struggling with this issue more than 1 week


texts: Magento2 unit tests doesn't run using vendor/bin/phpunit or vendor/phpunit/phpunit/phpunit

texts:
Env:

PHP 7.0.27-1+ubuntu16.04.1+Clear Magento 2.2.2 with sample data (downloaded in archive)

I have created new test module that very simple with unit test for one class.
When I run

php bin/magento dev:tests:run unit

Everything ok, tests are running (including mine)
But when I try to run only my tests using :

php ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/VendorName/ModuleName/Test/Unit

it returns the following message:

  You need to set up the project dependencies using Composer:

  composer install

  You can learn all about Composer on https://getcomposer.org/.

I run composer install:

  Loading composer repositories with package information

  Installing dependencies (including require-dev) from lock file

  Nothing to install or update

  Package sjparkinson/static-review is abandoned, you should avoid using it. Use phpro/grumphp instead.

  Generating autoload files

If I try to run:

php ./vendor/phpunit/phpunit/phpunit --filter MyTestingClassTest

It returns:

  PHPUnit 6.2.4 by Sebastian Bergmann and contributors.

  Usage: phpunit [options] UnitTest [UnitTest.php]
        phpunit [options]

  Code Coverage Options:

  --coverage-clover     Generate code coverage report in Clover XML format.

  --coverage-crap4j     Generate code coverage report in Crap4J XML format.

  ...

  Logging Options:

  --log-junit           Log test execution in JUnit XML format to file.

  ...

  Test Selection Options:

  --filter           Filter which tests to run.

  --testsuite       Filter which testsuite to run.

  --group ...                 Only runs tests from the specified group(s).

  ...

And so on.

So does anybody faced with this issue?

I'm not new Magento2 but new in unit testing so I can miss something primary.
Thanks in advance.

UPDATE:
PHPUNIT doesn't installed globally, I tried all steps above on another magento instalation v2.2.1 and I have the same issue.


texts: How to change the position of Related Product Block in Magento 1.9.3.6?

texts: I am using magento 1.9.3.6 version, RWD theme. I want to move related product block before displaying upsell products. How can I achieve this?


texts: SQL list all categories and products (SKUs) in category

texts:
guys !
How can i list all categories with related products in them (i need the SKUs). Where is the relation table for catalog_category_entity(or varchar) and catalog_product_entity(or varchar). ?

I can use only SQL.. because i don't know php. Thx !


texts: How to Add a Text/Logo under the search Bar

texts:
How can I add a text/logo under the search bar ?  this text is here presented as the "Target Text" on the picture,

I found some post but the guy describes his way as "terrible", so I wanted to know how to do it properly

Apologies for my terrible picture !

Thanks


texts: Magento 2.0 Get POST data inside Productsaveafter Observer

texts:
I have a quick question, how can we get the POST data inside the execute method of Productsaveafter class?  I added new input fields in the Product form page in admin and would like to save them onto a new table.

class Productsaveafter implements ObserverInterface
{
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $product = $observer->getEvent()->getRequest();
        $productData = $product->getData('params');
        echo "<pre>"; print_r($product); exit;
    }
}


texts:
Right now the Magento team supports 6 different versions of Magento:

1.9.3.0 CE
1.14.3.0 EE
2.0.10 CE
2.0.10 EE
2.1.2 CE
2.1.2 EE

I reckon it's a lot of work to deal with and 2.2 is coming next. So my questions are:

will Magento 2.0 support stop when 2.2 is released ?
if not, when will 2.0 support stop ?


texts: Is Less File in Magento 2.3.X mandatory?

texts:
I have an eCommerce HTML template with simple CSS. I have a few queries before converting HTML into Magento 2.3.3
Question 1: Is a .less file is mandatory? Can we use a simple CSS file in Magento 2?
Question 2: I don't want to @import variable & import Less file in another Less file. So Could someone, please tell me the better approach to use HTML Template/CSS
Question 3: Why Magento 2.x use Less CSS? I have worked in Magento 1.9 there is no concept of Less & it uses simple CSS & that was very easy to change the color scheme of page design.
This is my first question in the Magento stack community, Hope someone will give a pertinent answer. Thanks in advance :)
Updated Question on 13 Oct 2020
How to convert CSS into Less if the project has using CSS?