texts:
Well, here is getSize() definition inside AbstractDb class
public function getSize()
    {
        if ($this->_totalRecords === null) {
            $sql = $this->getSelectCountSql();
            $this->_totalRecords = $this->_totalRecords ?? $this->getConnection()->fetchOne($sql, $this->_bindParams);

        }

        return (int)$this->_totalRecords;
    }

It's clear that if _totalRecords value is null, so it goes to run getSelectCountSql() query to get count and save it in _totalRecords to reload it again once need.
I logged the query used to get count and it's similar to the query which already get the product collection however the real collection count is just 2 products which is correct after applying filters, but getSize() returns 6 products which is total products I have.
    2021-05-27T20:43:27+00:00 INFO (6): 6---->SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.customer_group_id = '4' AND price_index.website_id = '1'
 INNER JOIN `ul_current_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id AND stock_status_index.sales_entity = '2' WHERE ((stock_status_index.stock_status = 1)) AND (e.created_in <= 1) AND (e.updated_in > 1)

this is the log for the first query ran in the getSize() method. _totalRecords = 6 however when running this query it returns 2
Any clues on what's happening here ?


texts:
Magento235 with PHP 7.4
I am trying to install Magento235 with PHP 7.4, but facing many errors. Is this a good idea?


texts: Magento 2 CE Free extension / Module RMA or product return

texts: Is there any Magento 2 Comunity Edition free extension for RMA ( product return ) ? or do you guys have create some own module to solve this lack in magento 2 Comunity Edition?


texts: How to provide file/image upload option for customers in their MyAccount area?

texts:
I want to give my customers flexibility that they should attach photos of defected product/items they have received before applying for return/refund!

Presently I am using simple PHP for that.

<form action="" method="POST" enctype="multipart/form-data">
         <input type="file" name="picUpload" />
         <input type="submit"/>
</form>

I use simple move_uploaded_file() function to move those images with combined orderID.


texts:
I want to call  observer in controller using if condition this is my code

app\code\local\EPayment\EPayment\controllers\IndexController.php

class EPayment_EPayment_IndexController extends Mage_Core_Controller_Front_Action{
    public function getepaymentAction()
    {
        $params = $this->getRequest()->getParams();
        $left_amount = $params['left_amount'];
        if($left_amount == true){
          // call observer here
           $this->getResponse()->setHeader('Content-type', 'application/json');
          $this->getResponse()->setBody($left_amount);
        }
    }
}

app\code\local\EPayment\EPayment\Model\Observer.php

class EPayment_EPayment_Model_Observer
{
    public function setDiscount($observer)
    {
        // some codes here
    }
}

The above code $left_amount is true call Observer.php.

  Note: I write code for set discount in Observer.php.


texts: Magento 2 Add custom font to Email Template

texts:
I am adding custom fonts to Luma theme and followed this tutorial:https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/templates/template-email.html

i have added fonts to :

  {luma-theme-path}/web/fonts

_typography.less file :

  .lib-font-face(
       @family-name:@font-family-name__base,
       @font-path: '@{baseDir}/fonts/my_font_name',
       @font-weight: 400,
       @font-style: normal
   );

updated _variables.less file for fonts as below:

  //  Fonts
  @font-family-name__base: 'my_family_name';
  @font-family__base: @font-family-name__base;

I used my_family_name in Email templates css. But this font does not apply to email.

I have also executed following commands:

php bin/magento setup:static-content:deploy -f
php bin/magento indexer:reindex
php bin/magento cache:clean


texts: Magetno 2 order grid pagination page number set from where we open details page of order

texts:
Suppose we are viewing 2-page number records and open that 1 particular order in details page now press back button from order view page so this should return page 2 records but it throw me on page 1.

Return page - let us say search results in 100 orders and 20 per order page. If we are on the third page and we open an order on returning or while going back it.

goes to the first page instead of the third page where we came from.


texts: How to create import csv option in admin configuration of Magento 2.3

texts:
I want to create a configuration for may custom module where i need to add import csv field. Once i upload my csv it should upload all the data to my custom table.
Below is the code I have added to system.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
    <tab id="abctab" translate="label" sortOrder="10">
        Foo Abc
    </tab>

        <class>separator-top</class>
        Foo Abc
        <tab>abctab</tab>
        <resource>ABC_FooBar::config_foobar</resource>
        <group id="general" translate="label" type="text" sortOrder="900" showInDefault="1" showInWebsite="1" showInStore="1">
            Foo Abc
            <field id="import" translate="label" type="ABC\FooBar\Block\Adminhtml\Form\Field\Import" sortOrder="52" showInDefault="1" showInWebsite="1" showInStore="0">
                Import
                <backend_model>ABC\FooBar\Model\Config\Backend\Xyz</backend_model>
                <upload_dir config="system/filesystem/media" scope_info="1">foobar/fooabc</upload_dir>
                <comment><![CDATA[Allowed file types: CSV]]></comment>
            </field>
            <field id="sort_order" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
                Sort Order
            </field>
        </group>

</system>

When I going to Store-> Configuration it is showing blank screen but the moment i comment import field it is loading the page


texts: Issues with join / joinField / joinAttribute (undefined method)

texts:
I'm trying to join a category with an event.

Here's what I have so far:

<?php
$rootCategoryId = Mage::app()->getStore()->getRootCategoryId();
$categoryModel = Mage::getModel('catalog/category');
$categories = $categoryModel->getCollection()
                ->addAttributeToSelect(array('name'))
                ->addAttributeToFilter('parent_id', array('eq' => $rootCategoryId))
                ->addAttributeToFilter('is_active', array('eq' => 1));
$categories->joinTable('catalogevent/event', 'entity_id=category_id');

The error I receive is:

  Fatal error: Call to undefined method
  Mage_Catalog_Model_Resource_Category_Flat_Collection::joinTable()

Any help is greatly appreciated. I get a similar error trying to use joinField and joinAttribute.


texts: change redirect in controller in case of error Magento 2

texts:
I have created two form to different group customers but when i make error when filling the new form added the error is shown in the first form customer/account/create  so how to correct the redirection if i am in the second form.
Thanks in advance.


texts: Magento 2: Where are Gallery Images Processed in an Admin Save?

texts:
In Magento 2, if you navigate to

 Products->Catalog->Edit->Images and Videos

you can add images to your products.  The uploader will upload a temp image immediately, and after a product save there will be appropriately sized images in pub/media/catalog/product/cache.

Where is the code that handles saving the product gallery image data to the database, and where is the code that handles creating the new media image files on disk?  The product save controller

#File: vendor/magento/module-catalog/Controller/Adminhtml/Product/Save.php
public function execute()
{
    //...
    $product = $this->initializationHelper->initialize(
        $this->productBuilder->build($this->getRequest())
    );
    $this->productTypeManager->processProduct($product);

    if (isset($data['product'][$product->getIdFieldName()])) {
        throw new \Magento\Framework\Exception\LocalizedException(__('Unable to save product'));
    }

    $originalSku = $product->getSku();
    $product->save();
    //...
}

Doesn't contain anything obvious about image saving, so the code is probably somewhere down the initializationHelper, productBuilder, productTypeManager, or save call stacks.  I'm hoping someone here knows where this data gets saved in Magento 2.


texts: Call footer block of one theme into another

texts:
There are two themes which i am using. One is magento theme 'Smartwave porto' and another is Ced commerce theme which i got for ced commerce extension. This theme is enabled only for this particular extension pages.
I want to display footer block of my 'Porto theme' into Ced commerce extension theme.
How can i do that. Remember i want to call the footer block from phtml file of ced commerce extension.


texts: Magento 2: How to Reauthorize Paypal payment & store all information

texts:
I have tried below code

Override callDoReauthorization as it has issue with original https://github.com/magento/magento2/issues/9336

magento\app\code\Custom\Module\Model\Api\Nvp.php

class Nvp extends \Magento\Paypal\Model\Api\Nvp {

    public function callDoReauthorization() {
        $request = $this->_exportToRequest($this->_doReauthorizationRequest);
        $response = $this->call('DoReauthorization', $request); // Sample Response As Below
        $this->_importFromResponse($this->_paymentInformationResponse, $response);
        $this->_importFromResponse($this->_doReauthorizationResponse, $response);
        return $this;
    }
}

Sample Response for Reauthorization

    $response = array(
        'AUTHORIZATIONID' => '45610683DL9281543', // Reauthorization Id of Transaction Id 8F998724VR277443T
        'TIMESTAMP' => '2017-04-28T01:20:31Z',
        'CORRELATIONID' => '5a5a4056b1d7',
        'ACK' => 'Success',
        'VERSION' => '72.0',
        'BUILD' => '32996991',
        'PAYMENTSTATUS' => 'Pending',
        'PENDINGREASON' => 'authorization',
        'PROTECTIONELIGIBILITY' => 'Eligible',
        'PROTECTIONELIGIBILITYTYPE' => 'ItemNotReceivedEligible, UnauthorizedPaymentEligible'
    );

For Reauthorization taking reference of magento\vendor\magento\module-paypal\Model\Express.php function _callDoAuthorize.

Reauthorization Code which I tried as below

$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$proFactory = $objectManager->get('Magento\Paypal\Model\ProFactory');
$checkoutSession = $objectManager->get('Magento\Checkout\Model\Session'); // Not sure required or not in reauth
$pro = $proFactory->create();
$pro->setMethod(\Magento\Paypal\Model\Config::METHOD_WPP_EXPRESS);
$apiData = $pro->getApi()->getData();
foreach ($apiData as $k => $v) {
    if (is_object($v)) {
        unset($apiData[$k]);
    }
}

$checkoutSession->setPaypalTransactionData($apiData);
$pro->resetApi();

$api = _setApiProcessableErrors($pro)
                    ->setAmount('78.00')
                    ->setCurrencyCode('SGD')
                    ->setAuthorizationId('8F998724VR277443T')
                    ->callDoReauthorization();

echo $api->getAuthorizationId();
exit;

_setApiProcessableErrors will use magento\vendor\magento\module-paypal\Model\Express.php function.

We need to make entry in sales_payment_transaction  & sales_order_status_history table.

When I'm using https://developer.paypal.com/docs/api/payments/#authorization_get it's not giving valid_untill & all details.

It is not updating Authorisation Expiry Date: for Same Transaction in Sandbox as well.

Reauthorization API is not working : https://stackoverflow.com/questions/43583789/paypal-unable-to-reauthorize-authorized-payment-error-an-internal-service-err


texts:
Is there a way to find out what date a particular module (or all modules) were installed? Is this stored in the database somewhere?

Trying to track an issue that exists from a few years ago, so I am trying to determine what modules were already installed before the first manifestation of the issue.

Cheers


texts: Magento2 facebook share response in product view page

texts:
I have added facebook share link in product view page, it is sharing the product, but i would like get the shared response from facebook in my file in magento2.

    Share

Thanks


texts: Magento2 - How to override magento2-base adminhtml JS files?

texts:
I want to override vendor/magento/magento2-base/lib/web/tiny_mce/tiny_mce_src.js file.

I know how to override Magento core module files and I've tried that, but it's not working.

Is there any other way to override Magento2-base admin files?


texts: Show Simple Product Custom Options on Grouped Product

texts: In Magento, is it possible to display the simple product custom options (including file upload field) on the Grouped Product Page?


texts: Magento error - all admin pages give Fatal Error

texts:
Following a connection failure during an update in Magento Connect I can no longer access any admin modules including login. I inadvertently exited to Admin rather than resolving the problem in Connect.

Front end of store is also offline but as store is used for eBay/Amazon only this is not a critical issue.

Error seen on every page is:
Fatal error: Class 'Mage_Core_Model_Config_Options' not found in /*/magento/app/code/core/Mage/Core/Model/Config.php on line 200

This text is the only thing displayed on all pages.

Any suggestions on how I can restore my store? Or would it be better to start again from scratch - I have a backup of the SQL tables but no usable backup from within Magento. Lesson definitely learned on that one!

UPDATE:
I have updated the Core folder with the files from the Magento installation zip archive, and that has changed the error message to:

  "Fatal error: Interface 'Zend_Cache_Backend_Interface' not found in
  /magento/lib/Zend/Cache/Backend/ExtendedInterface.php on line 35"


texts:
We've multiple websites in Magento (magento2.2.4) and we've got an issue at checkout cart and checkout page.
We have also enable guest checkout.

"/checkout/undefinedrest/buy/V1/guest-carts/.../buy/V1/guest-carts/"

We are getting 404 error at got estimate shipping rate java script issue.

We got bellow error in browser console.

/checkout/undefinedrest/buy/V1/guest-carts/873814e048af82699f50cc0055218f6c/estimate-shipping-methods


texts: Get all children categories of a specific category

texts:
Currently I have this to get children of a category:

$category = Mage::getModel('catalog/category')->load($categoryId);
$childrenIds = $category->getResource()->getChildren($category, true);

However, it will get only active children. Is there a way to get all children of a specific category, including disabled categories?


texts: I have a templatemonster theme for 1.7 and am trying to port it to 2.0.2. Is there any documentation on how to do this? What goes where, etc? I know I will likely have to modify includes and the files themselves. I am curious if anyone else has had to do this before?


texts: local.xml changing the layout seems to not working

texts:
According to: http://blog.belvg.com/use-a-local-xml-file.html
my local.xml is inside my themefolder now and looks like:

<layout version="0.1.0">
<default>
    <reference name="col-left">
        <remove name="catalog.compare.sidebar" />
        <remove name="catalog.product.related" />
    </reference>
</default>
</layout>

After the changes I did an:
rm -Rf var/cache/*
but on the frontend, I still can see the compare products block.
My HTML looks like this:

Do I need to change the <reference name="col-left"> to anything else?
If so, how can I find out my valid reference name values? (I assume that's different from theme to theme?)


texts: How does the "My Tags" customer dashboard feature work?

texts:
My knowledge concerning tags amounts to the fact that tags can be attached
to messages (either within the message or separately at the bottom of the
message) to allow your content to become searchable using those tags
(social media sites as well as ubiquitous for their use, for instance
you can enter #Magento on Facebook or [Magento] on Stack Overflow in
the search box to display all posts related to such tag).
This is all I know about tags.

Now I would like to know how the Magento "My Tags" feature works (this
feature is visible under "MY ACCOUNT" in the customer dashboard). What
kind of media can be tagged in Magento? Or do I have the wrong idea?
Why would each customer have their own set of tags, rather than the
tags being globally searchable and accessible to all magento customers.
Is it the customer reviews that the customers themselves can tag and
what is the syntax of a tag in Magento?

Thanks for the clarification.

Thanks.


texts: Magento 2.1.1 Catalog Price Rule using SKU's

texts:
I tried to add a CATALOG price rule, not a cart price rule, using multiple sku's.  I'm on Magento 2.1.2.  In the past I have been able to create price rules (i.e. 30% off) and added products using SKU's.  The products then show up on the front end with the discounted price.

I recently just tried this and found that only 2 of the many sku's I have added are being affected.  I tried several times to add the sku's and no matter what, only 2 of the sku's work.

I then checked the database table and the RULES are there all written to the DB correctly, but under the rules, it seems that the SKU's I add in the admin will not be written to the DB table that lists the item #'s under each rule?

Does anyone have any issues with this?  There are a number of the posts about this, but nothing with a definite answer.  I have even found a bug report, but that was for CE 1.8. and 1.9 HERE.  I also found an issue on Github where a contributor states that "in magento you have no ability to create Catalog rule based on list of SKU. You can create rule only based Attribute Set or Category." which doesn't seem to be correct.

Does anyone out here have any concrete solution or idea about this?


texts: Get getNotifyStockQty() using `product_id`

texts:
I want to run below sql from a observer

select notify_stock_qty from cataloginventory_stock_item where product_id= 119

How to do this in Magento way.

$product_id= 119;
$stock_qty = Mage::getModel('cataloginventorystock/item')
    ->getCollection()
    ->addFieldToFilter('product_id', $productId);


texts: How to get the value of certain applied filter from layered navigation?

texts:
i need to display value of certain applied filter in layered navigation.

  <?php $appliedFilters = Mage::getSingleton('catalog/layer')->getState()->getFilters();

        foreach ($appliedFilters as $item) {
            $item->getName();
            $item->getLabel();
            $item->getFilter()->getRequestVar() == 'my_attribute'; // My attribute code
                echo $item->getLabel();

                }
        ?>

This code returns all the values of all the selected attributes.

I need to display only value from 'my_attribute'.


texts: Magento 2.2.9 CE Which Elasticsearch Version?

texts:
Please, can someone clarify for me Magento 2.2.9 Community Edition Which Elasticsearch Version can be used with it?

I have Amasty Elasticsearch extension installed - Tests are successful with both Elasticsearch version 5 and 6

I have tried 6.0 but it crashing the whole server at reindexing.

Version 5.0 works but is very very slow.

On the devdocs it's confusing

Magento 2.3.1 adds support for Elasticsearch 6.x, and it is enabled by default. Magento still provides modules for Elasticsearch 2.x and 5.x, but these must be enabled in order to use these versions. Elasticsearch 2.x is still available but strongly discouraged. Versions 2.x and 5.x are End of Life. If you must run Elasticsearch 2.x or 5.x with Magento 2.3.1, you must downgrade the Elasticsearch client to an older version. Follow the instructions in Change the Elasticsearch Client.

Then also mentions

https://devdocs.magento.com/guides/v2.2/config-guide/elasticsearch/es-downgrade.html

Magento 2.2.8 adds support for Elasticsearch (ES) 6.x. Magento still provides connectivity for ES 2.x and 5.x, but you must manually enable this support.

Am I getting confused between community edition and other Magento versions? Can someone please let me know or provide the URL link for elasticseach on community edition version 2.2.9


texts: Magento 2, overriding cookie module, domain name is not set correctly

texts:
As a requirement, the magento 2 EE website does not ask user to allow for setting cookie, it is set by default and it just notifies user by message. So I override the vendor/magento/module-cookie/view/frontend/templates/html/notices.phtml in custom template. I get everything set right except the domain value. Dot is missing.

Where in vendor/magento/module-cookie the domain is set with dot in begging? The value of domain supposed to be .local.test.com for sub domains.


texts: Send an email to Admin when a User logins in frontend into his account. magento 2

texts: send an email to Admin when a User logins in frontend into his account. magento 2, using event  and observer


texts:
I want to create a custom register form.

But, the user can only create an account if he is in my XML File.

For now, I get the information of the user from my XML.

Then I want to use this information to create the account, but the user only needs to add his name, mail and password (the other information will fit into the database automatically with info from XML (like address, country...)).

But I don't know where to start,

Any Guidance will be appreciated. Thanks in Advance.

EDIT : i believe that the answer to my question is something like this
How to add a customer programmatically in Magento 2?

But when I try do add something in my constructor, I have a white page and that's all.

Here's my code :

<?php
namespace Portail\Test\Controller\Connexion;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\View\Result\PageFactory;
use Magento\Store\Model\StoreManagerInterface;

class Form extends Action
{
    protected $_pageFactory;
    protected $storeManager;

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

Without StoreManagerInterface $storeManager in constuctor i haven't white page


texts: Magento 2.4.1: How to resolve [Report Only] Refused to load the font '' because it violates the following Content Security Policy directive:

texts:
With a custom module, I am trying to resolve the content security policy warnings. I'm not sure under which policy should I place the URLS reported by Refused to connect to.
Pleae guide me as to how it needs to handled in csp_whitelist.xml. Below is a real example from our store.
[Report Only] Refused to load the font '<URL>' because it violates the following Content Security Policy directive: "font-src *.cloudflare.com *.bootstrapcdn.com 'unsafe-inline' data: api.stripe.com js.stripe.com m.stripe.com x.klarnacdn.net klarna.com na.playground.klarnaevt.com eu.playground.klarnaevt.com klarna-payments-eu.playground.klarna.com klarna-payments-na.playground.klarna.com maxcdn.bootstrapcdn.com 'self' 'unsafe-inline'".

Below is my code in csp_whitelist.xml
<policy id="font-src">
    <values>
        <value id="cloudflare" type="host">*.cloudflare.com</value>
        <value id="maxcdn" type="host">*.bootstrapcdn.com</value>
        <value id="data" type="host">'unsafe-inline' data:</value>
    </values>
</policy>


texts: Magento 2.1.0 problem with country options

texts:
I have a problem with checkout page more specific to country options. In Backend it is set all for "Romania" but in Frontend is showing another countries.

I use Magento 2.1.0 and i linked 2 image to show my problem.

Country settings:
https://i.imgur.com/APN0AK3.jpg

Frontend:
https://i.imgur.com/YYsZYkb.jpg

Please help me to solve this issue


texts: Hi I added this code in my list.phtml file in order to add some info in my product list grid page (see picture attached) and added some div class so that I can change the style and move it around. I know it is probably not the correct way however it works. Now the problem is that I am unable to translate this part in french. Is there a way I can do this? I tried inline and .csv files in my locale but doesn't work and I am pretty sure it is because my codes below are not the correct way to do it. Please help. Thank you


texts: Magento (sales igniter) site - Not responsive

texts:
I had a new theme installed via FTP. It did not respond so the theme was removed via FTP.  It looks like some of the master Magento files were also deleted at this time and now the only in to anything is via C-Panel.  Please see below as this is what comes up for both the website and the admin login.  Any one know step by step how to retrieve and fix this.

Thanks in advance for any help..

Warning: include_once(Varien/Autoload.php): failed to open stream: No such file or directory in /home/celebrat/public_html/app/Mage.php on line 51

Warning: include_once(): Failed opening 'Varien/Autoload.php' for inclusion (include_path='/home/celebrat/public_html/app/code/local:/home/celebrat/public_html/app/code/community:/home/celebrat/public_html/app/code/core:/home/celebrat/public_html/lib:.:/usr/local/lsws/lsphp55/lib/php') in /home/celebrat/public_html/app/Mage.php on line 51

Warning: include(Varien/Autoload.php): failed to open stream: No such file or directory in /home/celebrat/public_html/app/code/core/Mage/Core/functions.php on line 68

Warning: include(Varien/Autoload.php): failed to open stream: No such file or directory in /home/celebrat/public_html/app/code/core/Mage/Core/functions.php on line 68

Warning: include(): Failed opening 'Varien/Autoload.php' for inclusion (include_path='/home/celebrat/public_html/app/code/local:/home/celebrat/public_html/app/code/community:/home/celebrat/public_html/app/code/core:/home/celebrat/public_html/lib:.:/usr/local/lsws/lsphp55/lib/php') in /home/celebrat/public_html/app/code/core/Mage/Core/functions.php on line 68

Fatal error: Class 'Varien_Autoload' not found in /home/celebrat/public_html/app/Mage.php on line 5


texts:
Hi I try to create Followup to Particular seller.I don't know how to store Database. I create one Module.

My Sql

<?php
$installer = $this;
$installer->startSetup();
$sql=<<<SQLTEXT
create table followup(followup_id int not null auto_increment, name varchar(100),
seller_id varchar(255), cus_mail varchar(255), primary key(followup_id));

SQLTEXT;

$installer->run($sql);

my phtml

<?PHP
//get customer login status ?>
<?php $myStatus = Mage::getSingleton('customer/session')->isLoggedIn() ?>
 <?php if($myStatus): ?>

 Follow Up

 <?php else: ?>

<a href="<?php echo Mage::getUrl('customer/account/login');?>" title="Customer Register">Follow Up

 <?php endif ?>

If user Click Follow Up link then it will store Database. How to write code can anyone give some example for this


texts:
I am not an expert in AWS. so please excuse me for this question. Our AWS EC2 instance host all the projacts of our client including a Magento 2 project, Wordpress projects etc. Each folders are pointed to different domains. Now my doubt is if I want to Auto scale this EC2 instance using Load Balancer what all things I should take care of? so that If I update the Magento code and ran static content deploy, the new code should affect in the scaled instances too.

Is this possible?


texts: Magento 2: The directory generated/metadata doesn't exist - skipping cleanup

texts:
Magento 2.3.1: The directory generated/metadata doesn't exist - skipping cleanup

When running bin/magento setup:upgrade

we see the warning in screen The directory generated/metadata doesn't exist - skipping cleanup

As this is a Vanilla install I am asking this question

question: what is this error warning related to? and is it something we can prevent? (seems strange to receive warnings when just following the default steps)


texts:
I am just starting out learning Magento which is very daunting at first.  My new employer uses it so I better learn it fast.

I need to build an extension that basically allows me to insert a Custom DIV into the header of each page.

The content of each pages DIV will be pulled from a Static Block

Then in the settings for Products, CMS, etc pages there will be a Tab that has settings to allow to set which Static Block div that page will show on it's header.

So if we have 4 different Static Blocks that have different content for this extension, then on the settings tab for each page/section will be a dropdown list which will list all the Static Blocks that it can use.  So 1 of them can be selected to be shown on that particular page.

For pages that do not have a Static block selected in there settings, they can then use a Default block we will set in another part of the admin panel.

This sounds very difficult to me right now and I was hoping to get some advice from experienced Magento developers to see if this sounds like a good plan on how to do this.
The DIV that is to be inserted into the pages will later on be used for an exit intent popup Modal window when a user exist the page 1 time and save a cookie and not show it again.

Am I missing anything, is there a better way to do this as far as storing per page settings  and such.  Also my boss thinks Static blocks are the best route to use, is that what you would use to hold the different possible Div's content?


texts: Can I use a different DB with my Magento 2.3.5?

texts: I have done some work on a site, basically theme, graphics, content and such.  I want to keep that work without losing it but I need to use a different database.   The current one got corrupted when Cart2Cart did a migration from M 1.9 to M 2.3.5.  I didn't catch the errors at first. Their solution was to redo the migration on a new Magento site (long story).   Basically we weren't able to open past orders.  The new database works fine, but I am trying to prevent a lot of rework if possible.  Can I just update/change where the database is?  I know in M1 I could do that but I don't know if M2 is different.  They will share the same server..


texts: How to add draggable-handle for configure product variants in Magento 2?

texts:
How to add draggable-handle for configure product's variants in Magento 2 ?

I can see there is a similar behavior in the related products when editing a product.

  Like related products

Row drag and drop option draggable-handle


texts:
When I add multiple items to a cart, they get stuck in the quick cart. They even pass from computer to computer some how and I am unable to remove them. This is one of the pages affected
https://woodstove-fireplaceglass.com/shop/products.html
To recreate the issue, add an item to the cart from the catalog page. The result is 4 items are now in the quick cart but only one item will be shown on the shopping cart page. This issue appears on Chrome and Edge but not Firefox.
Magento 2.3.5-p1
update: the add to cart behavior sometimes works, but an additional issue is that the quantity update in the quick cart will add a different item if the amount is updated.


texts: Show credit card error reason @ checkout

texts:
I'm currently running 2.1.3 and utilizing Braintree processing at checkout. Currently, if a customer places an error with a bad credit card, wrong CVV number, or wrong address, they just get the error of

An error occurred on the server. Please try to place the order again.

What do I need to change in PaymentInformationManagement.php to override this and show the actual reason for decline? Such as card declined, cvv error, address error, etc.


texts: Using Magento 2.3.2 with MySQL 8.0: Which problems could arise?

texts:
According to the DevDocs only MySQL 5.6 and 5.7 is supported. I have set up a shop now with MySQL 8.0 and it seems to work so far. However, it is not a fresh installation, instead I dumped the database from MySQL 5.7 server and imported it into MySQL 8.0, then switched the database connection in the app/etc/env.php configuration.

Could I run into any issues by using this version? Is there anything that will not work?


texts: How to give user agent rule for iPad and Tablet in Magento 2.1?

texts: I have two themes, one for mobile and other for desktop. I have created 2 user agent rules for Mobile and iPad. All mobiles are showing mobile theme. But iPad and Tablets are also showing mobile theme. I need iPad and Tablets to show desktop theme. Can anyone please help me to fix this issue?


texts: Magento 2.3: How to delete store specific view without effect other store view disturb?

texts: I have 3 store views, I just want to remove one of them, I can remove that from Magento 2.3 admin but their problem with related categories/products/orders/customers? they will also delete? right? when I try to delete its warning me that they are not recoverable?


texts: Oauth Error while extending Magento Rest API

texts:
I am working with Magento Rest API for the first time, i went through the tutorials of Rest API on http://www.magentocommerce.com/api/rest and tried one example to fetch product through API:

$callbackUrl = "http://localhost/wineshop/products.php";
$temporaryCredentialsRequestUrl = "http://localhost/wineshop/oauth/initiate?     oauth_callback=" . urlencode($callbackUrl);
$adminAuthorizationUrl = 'http://localhost/wineshop/admin/oauth_authorize';
$accessTokenRequestUrl = 'http://localhost/wineshop/oauth/token';
$apiUrl = 'http://localhost/wineshop/api/rest';
$consumerKey = 'u48p1x9gzrg7r82c94woa5z7g805uw0i';
$consumerSecret = '96ydrk8s89xxath8h5z71vcl5abfq0zg';

session_start();
if (!isset($_GET['oauth_token']) && isset($_SESSION['state']) && $_SESSION['state'] == 1) {
$_SESSION['state'] = 0;
}
try {
$authType = ($_SESSION['state'] == 2) ? OAUTH_AUTH_TYPE_AUTHORIZATION : OAUTH_AUTH_TYPE_URI;
$oauthClient = new OAuth($consumerKey, $consumerSecret,  OAUTH_SIG_METHOD_HMACSHA1, $authType);
$oauthClient->enableDebug();

I've also installed the latest version of OAUTH and it also shows in my WampServer PHP Extensions but it doesn't show in phpinfo(). I coped the php_oauth.dll file into ..\www\bin\php\ext and i also edited php.ini and entered extension=php_oauth.dll but on running the products.php it shows me the Fatal error: Class 'OAuth' not found in P:\wamp\www\products.php on line 19
And i also want to know that how to request for the token i've got key and secret after entering new consumer in Magento Admin Panel. But i don't know how to get Access Token & Access Token Secret that we enter in RESTClient

Please Help, Thanks in advance


texts: Sphinx Search - How to Hide Archive Products

texts:
How I can Hide Archive Products appearing in Search results

We are using Sphinx Search, Do anyone know how not to show some products pages showing in search results.

Thanks.


texts:
I have Installed Magento 2 latest version and I have checked in My account Section but not getting Order Return section.

I want to know where I get this feature and how to enable it for front end?

Also let me know is this feature is exist is Magento 2 community version Or not.

If this feature is not available, Then is there any free Extension available?

If not free available, Then please suggest which one is best paid extension.

Thanks.


texts: Magento 2 Product rating is not visible in all store views?

texts:
I have two store views in my website some products having rating stars and displaying them is fine in default store view.

While switching into another store view the rating stars are disappearing from that place.

The entire catalog is same for all the stores in my website. How can i Make them visible in all store views.


texts: Override all shipping method titles based on condition - Magento 2

texts:
We have a custom field on the checkout shipping page. If this field is selected we want to override the shipping method title. For instance if the shipping method title is "Standard shipping" we want to change it to "Standard Shipping - Extra text".
What would be a good way to do this?


texts:
I need to rewrite app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListSort.php

my config.xml :

...
<global>
   <models>
       <mymodule>
            <class>My_Module_Model</class>
        </mymodule>
       <adminhtml>
            <rewrite>
                <system_config_source_catalog_listsort>My_Module_Model_Adminhtml_System_Config_Source_Catalog_ListSort</system_config_source_catalog_listsort>
            </rewrite>
        </adminhtml>
     </models>
 </global>
 ...

app/code/local/My/Module/Model/Adminhtml/System/Config/Source/Catalog/ListSort.php

<?php
 class My_Module_Model_Adminhtml_System_Config_Source_Catalog_ListSort
 extends Mage_Adminhtml_Model_System_Config_Source_Catalog_ListSort
{
    public function toOptionArray()
    {
        var_dump('TEST');
    }
}

Also My_Module already rewrite lot of models.

Please help me to find what i'm doing wrong.
Thanks


texts:
I work in the  Magento 2.1.6  right now in optimization process I installed Redis server with this instruction http://devdocs.magento.com/guides/v2.0/config-guide/redis/config-redis.html
But  try  cache  clean (php ./bin/magento cache:flush
) in my  store i get this error Redis::pipeline(): Already in pipeline mode.


texts: Removing the Bulk Delete Option from magento Catalog

texts: I want to remove "Delete" action from magento admin panel. Please guide.


texts: Can not get all SOAP services in Postman

texts:
I can not get all SOAP services in Postman.
when I send: http://magento2.url/soap?wsdl_list=1
I get the following response:


texts: New module always inactive in Module manager

texts: I'm trying to install new module in Magento 2.2.5 , i already enabled the module , when i checked the module status using php bin/magento module:status it is active , but the problem is the admin menu or configuration for this module does not exist. I tried to install it in new fresh  Magento repo and it shows up fine. Finally i checked at the Module Manage in System > Tools > Web Setup Wizard, when i opened the module manager it was shown inactive, i tried to install another new module and got this same problem happened when i install another new module too


texts: I have a contact page that is not in cms pages. It has a static block that is only used on this page. I can edit it and see it, but can not find the page. Any suggestions on how to track it down? Is there a way to search for the static block in the code somehow?


texts: Magento 2 - Create product tab that displays custom attribute

texts:
I am using Magento 2, On the product detail page, I would like to create a new tab next to the description tab named 'downloads'.

I have created a attribute with text area named pdf_download to display what items that come with a product.

I have idea about Magento 1 but on Magento 2, I am totally new. Please guide me.

Thanks in Advance.


texts:
After adding <crontab></crontab> in mymodule's config.xml file I got error:

  Fatal error: Class 'Mage_Mymodule_Helper_Data' not found in
  **/app/Mage.php on line 547

in my config.xml

<helpers>
    <mymodule>
     <class>Mypackage_Mymodule_Helper</class>
    </mymodule>
</helpers>

and cron tag

<crontab>
    <jobs>
      <mycron>
        <schedule><cron_expr>*/1 * * * *</cron_expr></schedule>
        <run><model>mymodule/observer::cancelOrders</model></run>
            </mycron>
    </crontab>

Please suggest in which direction i have to check the error.
Thank you for help in adv..


texts: Cannot Read Property “quoteData” of undefined magento 2.2.2

texts:
How do I fix Magento 2.2.2

  Cannot Read Property “quoteData” of undefined

Issue? Please give me flexible solution for this issue.


texts: getAttributeText() use default value regardless what store view the user is on

texts:
How would I go about getting the Admin value for an attribute, regardless of the visitor's chosen store view?

I've tried:
$_product = $this->getProduct();
$_condition = $_product->getAttributeText('condition');
$_conditionDefault = $_product->setStoreID(0)->getAttributeText('condition');

However, setStoreId() does not work in this context.

Regardless of the language or store view that the visitor is currently viewing, I would like to be able to output the value for the Admin Store View and the value for the User's Current Store View.

The Condition attribute is a DropDown.


texts: What PHP skills are required for magento?

texts:
I have a e-shop built with Opencart, so I know some things in PHP and MVC. But since Opencart is getting outdated with no recent updates, I want to switch to Magento 2.

What things do I need to learn in PHP to make a smooth transition?


texts: I added a Curl.php file in another location. Now I have a Fatal Error when accessing the backend of my store. (Yes, I deleted the other location already, but I still receive the error) Does anyone have any insight on this? Help is much appreciated.


texts: I have a generic line that I want to show in the short description of each product and at checkout (i.e. buy one and get one free). Is there a way to automate this rather than for me to enter in to each product?


texts:
When using Magento2 backend, I’m running into a lot of timeout errors (from cloudflare and from nginx (when cloudflare is disabled) ).
These timeout errors happen when i'm trying to insert / update a product.

One of those errors are

  Warning: Error while sending QUERY packet. PID=10744 in
  /home/****/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php
  on line 228

Can someone help me solve this.


texts: Magento2 http: to convert https: site stop working

texts:
I have follow below step https://docs.nexcess.net/article/how-to-set-up-magento-2-to-use-your-ssl-certificate.html

but i am getting below error

  The web page at https://m2.key.com/ might be temporarily down or it may have moved permanently to a new web address.
  ERR_TUNNEL_CONNECTION_FAILED


texts: Call Adminhtml controller action from frontend

texts:
I'm trying to write a module which allows users create their own shop in our system (multi-store function).

I'm wondering, is it possible to execute an adminhtml controller's functions in Magento frontend?

At this moment, I've just create folder and edit index.php, .htaccess when click save website in Magento backend. I need more than that, please help.

Any help will be appreciated. Thanks!


texts: How do I find API User name inside extended API module code?

texts:
I have extended out the Magento API so that I can intercept sales_order.list and not expose all orders to a third party API. This worked fine when only one service was using this API, now there is another 'consumer' of the sales_order.list and I need to differentiate between whom is logged in.

I would prefer to do this the proper Magento way, e.g. to find the API Username of the box accessing sales_order.list, at a push I could check remote IP address but that could change, hence authentication credentials are what I would prefer to check.

I have tried to look at if there is an equivalent of admin/session but could not find anything helpful.

EDIT:

Thanks to @Anna I was able to find a solution for this.

Observer:

public function setPartner(Varien_Event_Observer $observer) {

    $user = $observer->getEvent()->getModel()->getData('username');
    Mage::getSingleton('core/session')->setPartner($user);

}

Then in my extended API code:

$partner = Mage::getSingleton('core/session')->getPartner();
Mage::log($partner);

This now pulls through the 'username' of my API user, so I can therefore block this user from certain things.

Interestingly, in API code land, I could not set a registry value in my observer to then pick up in my extended API code for sales_order.list.

I was stuck for a direction to look in for an answer, @Anna's answer gave me the direction I needed although not a complete solution.


texts: .trigger('contentUpdated') just for an element of the page

texts:
Say you load via ajax another product on the product page.

There are some mage scripts that do not run and you need to run elem.trigger('contentUpdated') to make magento evaluate the <script type=“text/x-magento-init”> code.

But the issue is that magento will evaluate the entire page again. So doing it like this:

$.when(ajaxCall(productUrl)).done(function(response){
        //parse response

        container.append(parsedResponse); //append in container
        container.trigger('contentUpdated'); //trigger update
})

Magento will change the product image for current product too, loading the image from the product just loaded.

I want the current product to stay as it is obviously, and just insert the newly loaded product somewhere else (with its image and other data i.e buy, description).

The only issue that I see is with the images that gets regenerated for the current product too if I run .trigger('contentUpdated').

Being more specific with the element on which I trigger does not help, as on whatever element I trigger the update magento will reinterpret the body: https://github.com/magento/magento2/blob/develop/lib/web/mage/mage.js#L93


texts: Add custom menu links only to mobile menu layout

texts:
I am using Magento 2.2.2 and I am trying to add some custom menu links to magento in the mobile menu layout.

I tried adding a custom block with menu links by referring catalog.topnav block

default.xml

<referenceBlock name="catalog.topnav">
        <block class="Magento\Theme\Block\Html\Topmenu" name="custom.catalog.topnav" template="Mymodule_TopMenu::html/topmenu.phtml"/>
    </referenceBlock>

topmenu.phtml

    <a href="<?php echo $block->getUrl('about-us'); ?>">About Us

After doing so, the menu links are getting added to the navigation menu bar. And i am using a custom css to hide those menus from desktop layout. Only in mobile layout i am displaying it.

The problem is the menu links needs to be present in the navigation menu bar so as to display in the mobile layout as well. But i wanted to render my custom menu links only in mobile menu layout.

How can i achieve it ? Please suggest some approach.


texts: PayPal Payments Standard generates IPN warning but everything still works

texts:
Having upgraded from Magento 2.2.11 > 2.3.5, I also went from PayPal Express Checkout to PayPal Payments Standard. Since then, I've been receiving regular emails from PayPal along the lines of:

Please check your server that handles PayPal Instant Payment
Notifications (IPN). Instant Payment Notifications sent to the
following URL(s) are failing:
https://example.com/paypal/ipn/
If you do not recognize this URL, you may be using a service provider
that is using IPN on your behalf. Please contact your service provider
with the above information. If this problem continues, IPNs may be
disabled for your account.

All of the transactions are being processed OK
The usual transnational information is being returned
Order status is changing to Processing. All as expected.

Question
Am I getting these IPN messages because Payments Standard uses a different method to obtain the information, therefore making IPN redundant? If this is the case, then I guess I can disable IPN in my PayPal account? Any information on this would be useful.


texts: Adding a css class / div wrapper to a block

texts:
I have the below XML which adds my static block to the page sidebar, then removes the wishlist. I would like to add a div wrapper to this static block with a css class.

I thought this could be done with the following argument, but it does not work.

<argument name="css_class" xsi:type="string">faq</argument>

Here is the full XML so far if anyone could help it would be appreciated.

<referenceContainer name="sidebar.additional">
   <block class="Magento\Cms\Block\Block" name="faq_sidebar">
       <arguments>
            <argument name="block_id" xsi:type="string">faq_sidebar</argument>
            <argument name="css_class" xsi:type="string">faq</argument>
       </arguments>
   </block>
</referenceContainer>


texts: Migration magento 1.9 to a VPS hosting. Error Mage registry key

texts:
I am transfering my magento CE1.9.0.1 from a share hosting to a VPS.
Conf of my VPS is Debian 8
Apache 2.4.10
Mysql 5.6
PHP Version => 5.6.14-0+deb8u1

I set up apache and upload my site and since I got the error here after.
I cleared var/cache and var/sesion but without sucess.

I correctly modified app/etc/config.xml and local.xml

But never success to get rid of this error.

a:4:{i:0;s:56:
"Mage registry key "_resource_helper/core" already exists";i:1;s:1486:"
#0 /var/www/velenka.com/public_html/app/Mage.php(223): Mage::throwException('Mage registry k...')
#1 /var/www/velenka.com/public_html/app/Mage.php(563): Mage::register('_resource_helpe...', false)
#2 /var/www/velenka.com/public_html/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(534): Mage::getResourceHelper('core')
#3 /var/www/velenka.com/public_html/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(520): Mage_Core_Model_Resource_Db_Collection_Abstract->_prepareSelect(Object(Varien_Db_Select))
#4 /var/www/velenka.com/public_html/lib/Varien/Data/Collection/Db.php(566): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#5 /var/www/velenka.com/public_html/app/code/core/Mage/Core/Model/Resource/Website/Collection.php(137): Varien_Data_Collection_Db->load(false, false)
#6 /var/www/velenka.com/public_html/lib/Varien/Data/Collection.php(729): Mage_Core_Model_Resource_Website_Collection->load()
#7 /var/www/velenka.com/public_html/app/code/core/Mage/Core/Model/App.php(634): Varien_Data_Collection->getItemById('0')
#8 /var/www/velenka.com/public_html/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
#9 /var/www/velenka.com/public_html/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
#10 /var/www/velenka.com/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#11 /var/www/velenka.com/public_html/index.php(87): Mage::run('', 'store')
#12 {main}";
s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}


texts: How to make options default for multiselect attribute in Magento 2

texts:
select attribute programmatically in Magento 2, is there any way to make the options specified in the code as default so that whenever I create a product I don't have to select options manually.

Following is the code that I have used.

$eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'my_custom_attribute_code',
        [
            'type' => 'text',
            'label' => 'My Custom Attribute',
            'input' => 'multiselect',
            'required' => false,
            'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
            'global' => \Magento\Catalog\Model\Resource\Eav\Attribute::SCOPE_GLOBAL,
            'visible' => true,
            'user_defined' => false,
            'searchable' => false,
            'filterable' => true,
            'filterable_in_search' => true,
            'comparable' => false,
            'visible_on_front' => false,
            'unique' => false,
            'group' => 'General',
            'is_used_in_grid' => true,
            'is_visible_in_grid' => false,
            'is_filterable_in_grid' => true,
            'option' => [
                'values' => [
                    'Left',
                    'Right',
                    'Up',
                    'Down',
                    'All'
                ]
            ]
        ]
    );


texts: error on duplicate the extension by rename class and files

texts:
i created extension for custom form which run perfectly but as i need another page with same form i rename all files & classes it gives me error on my error log like.

    exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Cusdesign_Block_Adminhtml_Cusdesign' in /home/webfolder/public_html/demo-website/app/Mage.php:595
    Stack trace:
#0 /home/webfolder/public_html/demo-website/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /home/webfolder/public_html/demo-website/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('cusdesign/admin...', Array)
#2 /home/webfolder/public_html/demo-website/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('cusdesign/admin...', 'cusdesign')
#3 /home/webfolder/public_html/demo-website/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('cusdesign/admin...', 'cusdesign')
#4 /home/webfolder/public_html/demo-website/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#5 /home/webfolder/public_html/demo-website/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#6 /home/webfolder/public_html/demo-website/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#7 /home/webfolder/public_html/demo-website/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#8 /home/webfolder/public_html/demo-website/app/code/core/Mage/Adminhtml/Controller/Action.php(275): Mage_Core_Controller_Varien_Action->loadLayout(NULL, true, true)
#9 /home/webfolder/public_html/demo-website/app/code/local/M3/Cusdesign/controllers/Adminhtml/CusdesignController.php(7): Mage_Adminhtml_Controller_Action->loadLayout()
#10 /home/webfolder/public_html/demo-website/app/code/local/M3/Cusdesign/controllers/Adminhtml/CusdesignController.php(15): M3_Cusdesign_Adminhtml_CusdesignController->_initAction()
#11 /home/webfolder/public_html/demo-website/app/code/core/Mage/Core/Controller/Varien/Action.php(418): M3_Cusdesign_Adminhtml_CusdesignController->indexAction()
#12 /home/webfolder/public_html/demo-website/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#13 /home/webfolder/public_html/demo-website/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#14 /home/webfolder/public_html/demo-website/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#15 /home/webfolder/public_html/demo-website/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#16 /home/webfolder/public_html/demo-website/index.php(73): Mage::run('', 'store')

used the block class ..

class M3_Cusdesign_Block_Cusdesign extends Mage_Core_Block_Template

in config file

 <blocks>
        <cusdesign>
            <class>M3_Cusdesign_Block</class>
        </cusdesign>
    </blocks>

my layout file

 <cusdesign_index_index>
    <reference name="content">
        <block type="cusdesign/cusdesign" name="cusdesign" template="cusdesign/cusdesign.phtml" />
    </reference>
</cusdesign_index_index>


texts: How to add a configurable product to cart from the cart items?

texts:
I need to add configurable product to cart in observer. Problem is, I want to take the item from cart and add the same product to cart with different sku.

I tried the following code:

$itemOptions = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());
$addProductSku = 'Silky-#1-000';
                        $options = array(
                                'product' => Mage::getModel('catalog/product')->getIdBySku($addProductSku),
                                'super_attribute' => $itemOptions['info_buyRequest']['super_attribute'],
                                'qty' => $item->getQty(),
                            );
                        $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$addProductSku);
                        if ($product -> isSaleable()) {
                            $cart -> addProduct($product, $options);
                            $cart->save();
                            $session->setCartWasUpdated(true); // Not really necessary - Vicary

                        }

But it reports error as '

Invalid method Varien_Object::checkQtyIncrements(Array
(
    [0] => 1
)

'

Please anyone help on this?


texts: Count the Number of Customers Who Ordered Once, Twice, etc

texts:
I would like a query to return the number of customers who ordered once, twice, etc to the maximum number of times anyone has ordered.

I'm not great at SQL so I've got bits of a query, I just don't know how to piece them together.

I believe this will return the total number of orders per person as num_of_orders:

(SELECT
    customer_id, customer_email,
    COUNT(*) as num_orders
 FROM
    sales_flat_order AS sfo
 WHERE
    sfo.status='complete'
 GROUP BY customer_id) AS num_of_orders

Therefore, this should give the highest number of orders:

MAX(num_of_orders) AS max_num_orders

I then need to count through each row in num_of_orders perhaps using a WHILE loop?

WHILE x != max_num_orders
    COUNT(num_orders = x),
    SET x = x+1
END WHILE

Can anyone help put a query together to achieve this? Thanks!


texts:
this is my simple requirejs-config.js file

 var config = {
            deps: ['js/custom']
        };

and this is my custom.js file

define([
    "jquery",
    "domReady!"
],
function($) {
    "use strict";
    $("input").blur(function(){
        alert("This input field has lost its focus.");
    });
});

why blur alert does not works?

But if i call it with an event it works?

$(window).on('scroll', function() {
       $("input").blur(function(){
            alert("This input field has lost its focus.");
        });
    });

Also other jquery function does not works on domready and i need to call it with an event


texts: My Account and Shopping cart link not getting loaded in header for some pages in magento 2

texts:
There are few pages on my website where MyAccount and Shopping cart links are not getting loaded in my header.
Check header on this page https://wazoodle01.wsisites.net/index.php/knowledge-base/coupons-faq.html

While it gets loaded successfully on other pages. https://wazoodle01.wsisites.net/index.php/fabrics.html

In console I can see the error as theHeaderContainer.smartheader is not a function that is present in the header.phtml file

Can anyone help me to resolve this, please?


texts:
I have a magento single store website with multiple store views.
Sometimes I see attributes values of products like status are not set on default so generate confusion between store views.
Are there possible problems if I change the scope of the attribute "status" from Website to Global?
Thanks


texts: in custom module ajax-loading form translations not working magento 2.3

texts:
in ajax-loading form Change English it to italiano and it works but  italiano to English not working proper.

once transalte to italiano  then switch to english store not transalte to english language field seen in italiano.

also

Translate "This is a required field." in custom form not working

how to solved ? any idea ?


texts: Fatal error: Uncaught Error: Call to a member function getQuote() on null

texts:
I'm trying to get store information from Shopping cart page

To do so I have created a module

Following is my block file

<?
   namespace Magento\History\Block;
   class ViewQuote extends \Magento\Framework\View\Element\Template
   {
       protected $_cart;
       protected $_checkoutSession;

       public function __construct(
            \Magento\Backend\Block\Template\Context $context,
            ...
            \Magento\Checkout\Model\Cart $cart,
            \Magento\Checkout\Model\Session $checkoutSession,
            array $data = []
       )
       {
           $this->_cart = $cart;
           $this->_checkoutSession = $checkoutSession;

           parent::__construct($context, $data);
       }

   public function getCart()
   {
       return $this->_cart;
   }

   public function getCheckoutSession()
   {
        return $this->_checkoutSession;
   }
 }

And in my .phtml file, I'm calling like this

<?php
    // Get all items in cart

    $quote = $block->getCheckoutSession()->getQuote();
    $items = $quote->getAllItems();

    foreach($items as $item) {
        echo 'ID: '.$item->getProductId().'
';
        echo 'Name: '.$item->getName().'
';
        echo 'Sku: '.$item->getSku().'
';
        echo 'Quantity: '.$item->getQty().'
';
        echo 'Price: '.$item->getPrice().'
';
        echo "
";
    }

    // Get total items and total quantity in cart

    $totalItems = $quote->getItemsCount();
    $totalQuantity = $quote->getItemsQty();

    //Get subtotal and grand total price of cart

    $subTotal = $quote->getSubtotal();
    $grandTotal = $quote->getGrandTotal();

    //Get billing and shipping addresses

    $billingAddress = $quote->getBillingAddress();
    $shippingAddress = $quote->getShippingAddress();

But it's not working and showing an error :

I do not know what is the problem here?


texts:
On Drupal I often log in using drush uli. It opens a one-time login URL in my browser.
Is it possible to log in to the Magento backend with bin/magento?


texts:
In my website, sorting is in asc for all sorting option but if I select "Sort By Date" (created_at) I want it go sort on desc order. How do I do it? Also I have a theme installed. Below is the code used at present

                    <option value="<?php echo $this->getOrderUrl($_key, 'asc') ?>"<?php if($this->isOrderCurrent($_key)): ?> selected="selected"<?php endif; ?>>
                        <?php echo $this->__($_order) ?>
                    </option>


texts: When I update the product qty in the cart page I want to have the shipping rates estimated again via AJAX, how could I call this JS method in order to do that?


texts: Programmatically set category-product position

texts:
I want to sort products by manufacturer, but also allow store manager to override this easily.

My first idea was to use category-product position and set it while creating product programmatically, but I couldn't find any appropriate method (it used to be possible in 1.9 with assignProduct - Set Category Product Position of Products ).

My new idea is to use SQL to update all products with position 0 based on manufacturer name. Manufacturer name can be found in eav_attribute_option_value and position is in catalog_category_product_index, but how can I join them?

Thank you in advance for any hints on either approach to the task


texts:
I know that there is an option to use decimals for product quantity for every product. But is there an option to change this globally?

I am using Magento CE 1.7.

Many thanks.


texts: Is there any event for after select shipping method in magento

texts:
when I select shipping method from shipping list on cart page or checkout page I want to remove product vat if it is satisfy my condition for that I was thinking if there is any event like after_shipping_method or something like that then my work would be done but I can't find on net and https://magento.stackexchange.com/ so  I am asking this question.

so what I want to know is below :
for ex : I have 3 shipping methods like

1 day delivery : 20$
3 day delivery : 10$
within one week : 5$

so when user select anyone out of these three which event is fired?

And I need some event that is useful for both cart and checkout page.And if there is not any event that is useful for both the pages then what are different events for cart and checkout page respectly?

Thanks


texts: I can't see store and store view in store menu in Magento2?

texts:
My store and storeview both and not showing in window.
Please help


texts: Magento2: How to override magento tier price in custom extension?

texts: Need help with Magento2. Anyone know how to override Magento Tier Price. Actually  i am developing an extension and stuck here.


texts: Magento2 - Checkout shipping method when click Ship here

texts:
http://siteurl/rest/default/V1/carts/mine/shipping-information - return 404 with below error.

  "message":"Carrier with such method not found: %1,
  %2","parameters":["matrixrate","matrixrate_57395"],"trace":"#0
  [internal function]:
  Magento\Checkout\Model\ShippingInformationManagement->saveAddressInformation(18678,
  Object(Magento\Checkout\Model\ShippingInformation))\n#1
  /public_html/vendor/magento/module-webapi/Controller/Rest.php(307):
  call_user_func_array(Array, Array)\n#2
  /public_html/vendor/magento/module-webapi/Controller/Rest.php(216):
  Magento\Webapi\Controller\Rest->processApiRequest()\n#3
  /public_html/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(24):
  Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))\n#4
  /public_html/vendor/magento/framework/App/Http.php(135):
  Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))\n#5
  /public_html/vendor/magento/framework/App/Bootstrap.php(258):
  Magento\Framework\App\Http->launch()\n#6
  /public_html/index.php(40):
  Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))\n#7
  {main}"}


texts: Magento 2: use a chooser widget as a system configuration field

texts:
Is there an easy way to use the Magento\Catalog\Block\Adminhtml\Category\Widget\Chooser in my system.xml file for a field ?

The idea is to be able to pick a category from the chooser widget to store its id as a configuration field.

I don't want to use a simple text input as people will have to find the category id by themselves.


texts: Need clarification regarding JS merging and JS bundling in magento 2.3.2

texts:
I need to understand about JS merging, JS bundling and minify JS for site performance
Do we need to enable only one option from JS bundling and JS merging?
When i enable Js merging, my listing page does not work well.
When i enable JS bundling, my product pages does not load at all.
Which option should i select?
Please help.


texts: How can I check the cron jobs running on my site?

texts:
How can I check the cron jobs running on my site on terminal?

Magento ver. 1.6.2.0


texts:
Is there any way to use custom captcha in phtml file directly without
  using layout in captcha in magento 1.9

  If Anyone have any idea please help me. Actually i am thinking to add
  this below code in phtml file

    *Please type the letters below

        <input name="captcha[contacts]" type="text" class="input-text required-entry validation-failed" id="captcha_contacts">


texts: Add options to several products at the same time

texts:
i've created some products and now I need to add several option on each of them. How can add to a list of products the created option ?

I've found how to import them into one product at a time, but is there an easier and fastest way to do this ? (I have like 300 products where I need to apply those options, so could take a while...)


texts: Magento2 how to remove "choose an option" in configurable products drop down

texts:
How to  remove "choose an option" in configurable products drop down and in the drop-down menu have the first attribute value be the top choice please if anyone idea reply me

I need this type of


texts: How to Fix too long content-security-policy in http response header

texts:
I have just set up Magento 2.4.0 on my server.
While checking response header I found that it's too long

How to fix this any idea? any chance that it will create any other issue?


texts:
I'd like to add product id as a new sorting option in frontend catalog pages. How can I do that?

This attribute is not listed in product attributes configuration in magento backend. I guess that it can be done by custom extension but I don't know how. Could you post a solution?


texts: Magento 2 execute php bin/magento setup:upgrade without command prompt

texts:
I am running a Magento 2 website on my mac locally.

My problem is that I'm having problems with my mac setup ad i'm not about to run:

php bin/magento setup:upgrade

from my terminal.

My question is...I there's any other way to do the same as: php bin/magento setup:upgrade or php bin/magento setup:static-content:deploy without using the Terminal?


texts:
I wanna add a html table in widget.xml.
I mean this:

instead of this:

Is this possible? Thanks.


texts: cron error Cannot instantiate interface magenot 2

texts:
I'm getting the following error on magento cron execution:

Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\Lock\LockManagerInterface in /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111
Stack trace:
#0 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#1 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Framewo...')
#2 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get('Magento\\Framewo...')
#3 /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Compiled->create('KiwiCommerce\\Cr...')
#4 /home/mywebsite/public_html/vendor/magento/framework/Event/ObserverFactory.php(33): Magento\Frame in /home/mywebsite/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111

What can I do to fix this?

-----UPDATE------

I just discovered that error was caused by an extension that tries to use \Magento\Framework\Lock\LockManagerInterface in a constructor.
Here's a sample of the code:

namespace KiwiCommerce\CronScheduler\Observer;

use Magento\Framework\App\State;
use Magento\Framework\Console\Cli;
use Magento\Framework\Event\ObserverInterface;
use \Magento\Cron\Model\Schedule;
use Magento\Framework\Profiler\Driver\Standard\Stat;
use Magento\Framework\Profiler\Driver\Standard\StatFactory;

class ProcessCronQueueObserverDefault extends \Magento\Cron\Observer\ProcessCronQueueObserver
{

    private $logger;
    private $state;
    private $scheduleHelper = null;
    private $jobHelper = null;
    private $lockManager;
    private $invalid = [];

    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager,
        \Magento\Cron\Model\ScheduleFactory $scheduleFactory,
        \Magento\Framework\App\CacheInterface $cache,
        \Magento\Cron\Model\ConfigInterface $config,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Framework\App\Console\Request $request,
        \Magento\Framework\ShellInterface $shell,
        \Magento\Framework\Stdlib\DateTime\DateTime $dateTime,
        \Magento\Framework\Process\PhpExecutableFinderFactory $phpExecutableFinderFactory,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\App\State $state,
        StatFactory $statFactory,
        \Magento\Framework\Lock\LockManagerInterface $lockManager,
        \KiwiCommerce\CronScheduler\Helper\Schedule $scheduleHelper,
        \KiwiCommerce\CronScheduler\Helper\Cronjob $jobHelper
    ) {

        $construct= "__construct"; // in order to bypass the compiler
        parent::$construct($objectManager, $scheduleFactory, $cache, $config, $scopeConfig, $request, $shell, $dateTime, $phpExecutableFinderFactory, $logger, $state, $statFactory, $lockManager);
        $this->logger = $logger;
        $this->state = $state;
        $this->lockManager = $lockManager;
        $this->scheduleHelper = $scheduleHelper;
        $this->jobHelper = $jobHelper;
    }

Still don't know how to fix it though.

---- extension di.xml ------

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Cron\Observer\ProcessCronQueueObserver" type="KiwiCommerce\CronScheduler\Observer\ProcessCronQueueObserver" />
</config>


texts: Display Static block list in drop down in create product page

texts:
I want to display the static block list in magento admin product creation page.
I referred this link http://www.milessebesta.com/web-design/magento-use-custom-product-attributes-to-add-cms-static-block-to-product-page/
But it shows manual entry of static block names in custom options.
I want to show the static block option list dropdown as dynamic.


texts: Exteding magento core contact controllers issue

texts:
I am following this:turorial to extend the magento core contact controller. I want to change get postAction() function.

So I created my module in local folder:
mynamespace/mymodule/controller/IndexController:

require_once Mage::getModuleDir('controllers',"Mage_Contacts").DS."IndexController.php";

class Mynamespace_Mymodule_Contacts_IndexController extends Mage_Contacts_IndexController
{
    public function indexAction(){
        parent::indexAction();
    }
    public function postAction(){

    }
}

then the mynamespace/mymodule/etc/config.xml:

<?xml version="1.0"?>
<config>
    <modules>
    <Mynamespace_MyModule>
            <version>1.0.0</version>
    </Mynamespace_MyModule>
    </modules>
    <frontend>
        <routers>
            <contacts>
                <args>
                    <modules>
                        <robot before="Mage_Contacts">Mynamespace_MyModule</robot>
                    </modules>
                </args>
            </contacts>
        </routers>
    </frontend>

</config>

then the Mynamespace_MyModule.xml from etc/modules:

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

and it is actived.
And i am getting this error: Controller file was loaded but class does not exist when i access the contact page. What did I do wrong at this point ?


texts: Magento 2 : Change shipping address based on delivery method selection

texts:
I am looking for a way to change the shipping address of an order based on the delivery method selection, I have various collection points setup on my store using a third party extension.
The only thing with the extension is that it doesn't have the function to change the shipping address, so some customers see the shipping address on their order and think its still getting sent to their address.


texts:
After we upgraded from Magento 2.2.7 to 2.3 we have come across that customers get duplicate confirmation emails.

I can see there is some related issues here, but not for Magento 2.3.

Anyone that might know why this is happening?


texts: Magento2 : How to load quote item option by id?

texts:
In a module under Magento 1.9. I was loading quote item option using

$_quoteOption = Mage::getModel('sales/quote_item_option')->load($Option_id);

I would like to do the same thing under magento2 but I do not manage to find which class / function to use (\Magento\Sales\Model\Quote\... does not exist)

I am in a controller triggered by a button in customer account order view

Any idea?


texts: Payment method is active observer result not working in magento 2

texts:
Actually I have implemented the custom payment method in magento 2 like this article http://webhintsexplorer.com/custom-payment-method-magento-2/. Its working fine properly. I tried to hide my custom payment method using observer 'payment_method_is_active'. These are my observer code

<?xml version='1.0'?>
<config xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='urn:magento:framework:Event/etc/events.xsd'>
  <event name='payment_method_is_active'>
    <observer name='Exp\Test\Model\Observer\PaymentActive' instance='Exp\Test\Model\Observer\PaymentActive' />
  </event>
</config>

Model observer file

 <?php
    namespace Exp\Test\Model\Observer;
    use Magento\Framework\Event\ObserverInterface;
    use Exception;

class PaymentActive implements ObserverInterface {

    public function __construct (
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Store\Model\StoreManagerInterface $storeManager
    ) {
        $this->_logger = $logger;
        $this->scopeConfig = $scopeConfig;
        $this->storeManager = $storeManager;
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $this->testlog = $logger;
    }
    public function execute(\Magento\Framework\Event\Observer $observer) {
    $event           = $observer->getEvent();
        $method          = $event->getMethodInstance();
        $result          = $event->getResult();
        $currencyCode    = $this->storeManager->getStore()->getCurrentCurrencyCode();
        $this->testlog->info($method->getCode());
        if($method->getCode() == 'cashondelivery'){
              $result->setData( 'is_available', false);
        }
    }
}

The observer are triggering in checkout page when I log the payment method code using the code

$this->testlog->info($method->getCode());

in execute method. I got the result

2016-04-22T08:25:19+00:00 INFO (6): cashondelivery
2016-04-22T08:25:19+00:00 INFO (6): checkmo
2016-04-22T08:25:19+00:00 INFO (6): paypal_express_bml
2016-04-22T08:25:19+00:00 INFO (6): payflow_express
2016-04-22T08:25:19+00:00 INFO (6): paypal_express
2016-04-22T08:25:19+00:00 INFO (6): payflow_express_bml

I can't get my custom payment method code in the log. Please suggest is I am missing any settings in custom payment method model or any where?. Then I tried to hide the core payment method cash on delivery using the method code 'cashondelivery' in the code.

if($method->getCode() == 'cashondelivery'){

That is also not working. Any help is much appreciated.


texts: How to display values from a custom attribute in magento 2?

texts: I a problem on displaying the custom attribute and it's values in a custom phtml block.


texts: I am creating a custom shipping module.So,I want to get the weight of order items individually to create shipping rule.How can we get the weight?


texts: Magento cache tag based on multiple products

texts:
Is it possible to have a cache tag in Magento based on multiple products?

i.e. the cache storage is dependant on any 1 of a group of products being updated?


texts: Magento 1.9 Paypal checkout is stuck at Terms and Condition

texts:
Need help please, looked all over the interweb and cannot find solution!

Problem: When i use Paypal checkout, it's stuck at Terms and Condition, when the customer checks the form box "I understand and accept these terms and condition" the Place Order button becomes disabled and won't be able to proceed with ordering.

Using Credit Card for checkout is fine and works ok. when i disable Terms and Condition on checkout, Paypal work ok too, but i need customers to agree with Terms and Condition.

I tried renaming paypal.xml and removing Paypal API Credentials, emptying Cache etc. but none works.

I attached screen capture of the error with element inspector..


texts: Get product attribute value in new_grid.phtml magento2

texts:
I have problem with getting attribute value in new_grid.phtml. If i make it like this:

<?php $_product = $block->getProduct()
echo $_product->getData('attr_name') ?>

Page generating to this place, and after just blank page.

Please show me other option, or maybe i have mistakes in my code.

Here is the place in new_grid.phtml:

<a href="<?php /* @escapeNotVerified */ echo $block->getProductUrl($_item) ?>" class="product-item-photo">
<?php echo $block->getImage($_item, $image)->toHtml(); ?>

/* my code: */
<?php $_product = $block->getProduct() ?>
<img src="<?php echo $_product->getData('attr_name') ?>" />

Please help.

Anwer to  Keyur Shah:

it is code from custom_home.xml

<container name="header.container" as="header_container" label="Page Header Container"  htmlTag="header" htmlClass="page-header" before="main.content"/>
<block class="Magento\Framework\View\Element\Template" name="test_file" template="Magento_Theme::html/front-slider.phtml" before="main.content"/>

<container name="main.content" htmlTag="main" htmlId="maincontent" htmlClass="page-main">
<container name="columns.top" label="Before Main Columns"/>

<container name="columns" htmlTag="div" htmlClass="columns">
                <container name="main" label="Main Content Container" htmlTag="div" htmlClass="column main"/>
            </container>
</container>

In front-slider.phtml i get the new_grid.phtml by code:

<?php echo $this->getLayout()->createBlock("Magento\Catalog\Block\Product\Widget\NewWidget")->setDisplayType("all_products")->setProductsCount("6")->setTemplate("product/widget/new/content/new_grid.phtml")->toHtml(); ?>


texts: As an integrator, should I expect the provided Travis CI configuration to work properly?

texts:
As an integrator, after creating a Magento 2.2 project, should I expect the provided Travis CI configuration to work properly?

The Magento Testing Guide explains how to run individual test suites, but does not provide any guidance for the provided .travis.yml.

Why I want this

To meet the requirements of <project>, I'm going to be adding and customizing Magento 2 modules of all kinds: console commands, payment gateways, themes, shipping providers, API endpoints, etc. During this process, I think it would be really nice if an automated build system could tell me, "hey, you goofed and broke this important core thing".

It would also be really nice if there were a standard "Magento 2" way of making this happen, instead of everybody having to reinvent their own square wheel of testing. After creating a project using the given template, one would think that the provided configuration would either (a) work properly, or (b) be documented in such a way that an integrator could get up and running quickly.

...right?

Project setup steps

I've created a brand new, fresh Magento 2.2 project by following the "integrator" path, creating a project via composer by fetching the Magento CE metapackage. More specifically, I ran the following command:

$ composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition testrepo

The resulting project directory comes with (among other things) a .travis.yml file. I've configured the connection between this project and Travis CI, including valid credentials for the custom Magento composer repository. Unfortunately, the Travis CI build doesn't work out of the box.

Issues

Some issues I've run into using the provided configuration (and the workarounds I've tried):

The dev/travis/before_*.sh scripts are not executable. This causes the build to error out.

Workaround: Set executable bit on scripts.
I created the project on a machine with PHP 7.1.9, so the composer.lock file ended up with dependency versions which are incompatible with PHP 7.0. One of the specified PHP versions in the Travis matrix is 7.0, which won't work at all.

Workaround: Remove PHP 7.0 from the build matrix.
After composer install runs, it overwrites the dev/ directory. This undoes the changes to my travis scripts, making them non-executable again!

Workaround: Set executable bit on scripts in the Travis config, directly before running them.

After these changes, it works! Sort of...

What works

JS specs

TEST_SUITE=js GRUNT_COMMAND=spec

Some integration tests

TEST_SUITE=integration INTEGRATION_INDEX=1
TEST_SUITE=integration INTEGRATION_INDEX=2

Functional tests (wow, these take a long time)

TEST_SUITE=functional ACCEPTANCE_INDEX=1
TEST_SUITE=functional ACCEPTANCE_INDEX=2

What doesn't

PHP Unit tests

TEST_SUITE=unit (very few failures)

Static analysis / lint

TEST_SUITE=static (fails with lint errors on core stuff that I can't change)
TEST_SUITE=js GRUNT_COMMAND=static (holy cow, all the errors!)

Some integration tests

TEST_SUITE=integration INTEGRATION_INDEX=3 (fails on reading an XML file from the vendor directory)

Back to the question (and follow-up questions)

Is the .travis.yml intended to be used by integrators?

If so,

Why did I trip over so many hurdles while attempting to set it up?
What did I do wrong, and/or how do I fix it so that it works as
intended?

If not,

Why is the .travis.yml file included in the generated project
directory?
Why is my custom .travis.yml file overwritten with the default one each time I run composer install?


texts: Magento2 XML: How to replace an  definition by another

texts:
In order to change the checkout page summary item info, I need to replace in checkout_index_index.xml the following line <item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details</item> in order to point to my own details.js file.

I then tried :

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="checkout_index_index"/>
    <body>
            <referenceblock name="checkout.root">
                <arguments>
                    <argument name="jsLayout" xsi:type="array">
                        <item name="components" xsi:type="array">
                            <item name="checkout" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="sidebar" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="summary" xsi:type="array">
                                                <item name="children" xsi:type="array">
                                                    <item name="cart_items" xsi:type="array">
                                                        <item name="children" xsi:type="array">
                                                            <item name="details" xsi:type="array">
                                                                <item name="component" xsi:type="string">Vendor_Module/js/view/summary/item/details</item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </argument>
                </arguments>
            </referenceblock>
    </body>
</page>

but it is not working. The original details.js is called.

Thank you for your help

EDIT1 :

I tried for testing purpose to replace <item name="component" xsi:type="string">Magento_Checkout/js/view/summary/item/details</item> by <item name="component" xsi:type="string">Vendor_Module/js/view/summary/item/details</item> in the core checkout_index_index.xml file and it works. So the problem is due to my module xml


texts: Having trouble with M2 2.1.0-rc3 upgrade through web tool

texts:
I am getting the following confusing message when trying to update from M2 2.0.7 to M2 2.1.0-rc3:

  Completed! You need to resolve these issues to continue.
  Check Updater Application Availability
  Updater application is available.

  Check Cron Scripts
  Cron script readiness check passed.

  Check Component Dependency
  We found conflicting component dependencies. Hide detail

  Command "update" failed: Loading composer repositories with package information
  Updating dependencies (including require-dev)
  Your requirements could not be resolved to an installable set of packages.

  Problem 1
  - Installation request for magento/product-community-edition 2.1.0-rc3 -> satisfiable by magento/product-community-edition[2.1.0-rc3].
  - magento/product-community-edition 2.1.0-rc3 requires php ~5.6.0|7.0.2|~7.0.6 -> your PHP version does not satisfy that requirement.

  For additional assistance, see component dependency help .

  PHP Version Check
  Your PHP version is correct (7.0.7-4+deb.sury.org~trusty+1).

  PHP Settings Check
  Your PHP settings are correct.

  PHP Extensions Check
  You meet 15 out of 15 PHP extensions requirements. Show detail

As you can see my php 7.07 version check passes and all necessary extensions are available, but, the component dependency check is barfing on my php version. Not sure how to address this.

As an aside, the same php version worked just fine with upgrading to 2.0.7 and all upgrades to this point. I haven't made any changes to any php related files at all.

Any help would be greatly appreciated.


texts: Magento2 - Save Quote (Repository / Cart) Default Shipping Values

texts:
I am adding a shipping address with a same_as_billing value of 0, after adding this address to the cart / via the repository the value in the database for same_as_billing is 1 on the shipping address row.

I am trying to add the addresses in separate actions, is there (and if so where is it) any kind of mechanism that by default adds a shipping address with a same_as_billing value of 1 if it isn't set?


texts: Export Product Sku and Product_Url in magento2

texts:
Can we export product with sku and url into csv in magento2?

Is there any query to get it quickly?

I am looking for query to get all sku and its url key or full product_url.

Please anyone help me. Thanks


texts: Why is the link to 'proceed to checkout' a button type?

texts:
On the cart page ("/checkout/cart"), the link to "proceed to checkout" is a  with an onclick = window.location that sets the next page. Why is this?

More specifically, is there any risk introduced if I change this to an anchor tag with href = to the getCheckouturl?

This is probably common knowledge, but I could not find insight anywhere else.

Thanks


texts: How do you set an accept attribute against an adminhtml form file input?

texts:
I'm having trouble outputting an accept attribute to my Mage_Adminhtml_Block_Widget_Form field, with a type of file.

I've got the following code:

class Namespace_Module_Block_Adminhtml_Model_Form extends Mage_Adminhtml_Block_Widget_Form
protected function _prepareForm()
{
....
    $form->addField('attachment','file',array(
        'label' => Mage::helper('module')->__('Attach a file'),
        'name' => 'attachment',
        'required' => false
    ));
....
}

This is outputting the file input fine, however I need to restrict the extensions that can be uploaded, presumably with the accept=".doc" HTML attribute, however when I add the following:

$form->addField('attachment','file',array(
    'label' => Mage::helper('module')->__('Attach a file'),
    'name' => 'attachment',
    'required' => false,
    'accept' => '.doc'
));

It doesn't seem to output the accept attribute.

Any help would be greatly appreciated.


texts: Why magento 2 redirection from onepage not working?

texts:
My code in onepage.phtml for redirecting automatically for payment page when a specific product is added to cart.

<?php

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');

// retrieve quote items collection
$itemsCollection = $cart->getQuote()->getItemsCollection();

// get array of all items what can be display directly
$itemsVisible = $cart->getQuote()->getAllVisibleItems();

// retrieve quote items array
$items = $cart->getQuote()->getAllItems();

foreach($items as $item) {// product id
    $it[] = $item->getProductId();
}
if (in_array(482, $it)){
    header("Location: https://test.rkhomeappliances.co.in/checkout/#payment"); exit;
}

?>


texts: For Magento 2 not show some category on frontend for not logged in customer, once customer logged in it will able to see that category on front end

texts:
For Magento 2 not logged in customer not able to access selected category any way in store Ex. url, menu, search etc , once customer logged in it will able to see category and its products.

can anyone help me how can i do this. i am new in magento 2


texts: Magento default Favicon appears when accessing direct directory

texts:
I am facing issue that when I am accessing a directory in magento like /media (Which is already secured by .htaccess file ) it is showing the default magento favicon even though my website's favicon is different.

E.g. Favicon displayed is magento's default where actually I want to change favicon to my website's favicon.

or Refer to Image :

I have tried to view source but no HTML source is available.

Any one suggest me how I can resolve this issue or how I can configure my favicon for this path ?


texts: How to fix Invalid customer address id in Magento 2.1.5

texts:
How to fix Invalid customer address id 1678 etc when trying to add to cart in Magento 2.1.5

It was fixed before by adding a foreign key field to "customer_address_id".

After adding the matrixrate module its showing the same error.


texts: after migrate magento website to godaddy server i am unable to edit anything

texts:
I have migrate my website to godaddy server after migration i am unable to edit any thing in this website & unable to process product order.

Please provide me help to resolve this issue


texts:
After updating to Magento 2.2.6, the following error is output.

Go to

  Backend> System> Permission (All Users)> Users

Clicking each line... etc. outputs an error.

The following is an error message.

  Exception # 0 (Exception): Warning: Illegal offset type in
  /var/www/html/multistore/vendor/magento/module-backend/Block/Widget/Tabs.php
  on line 306


texts: Problem with reindex catalog_product_prices

texts:
Having a problem with reindexing catalog_product_prices. I get the following error message:

exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND tad_price_type.store_id = 0
 LEFT JOIN catalog_product_entity AS `tas_pric' at line 14' in /home/vampow/public_html/store/lib/Zend/Db/Statement/Pdo.php:228

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND tad_price_type.store_id = 0
 LEFT JOIN catalog_product_entity AS `tas_pric' at line 14' in /home/vampow/public_html/store/lib/Zend/Db/Statement/Pdo.php:234

This is the SQL line that is causing the problem (14):

  INNER JOIN catalog_product_entity AS tad_price_type ON tad_price_type.entity_id = e.entity_id AND tad_price_type.attribute_id =  AND tad_price_type.store_id = 0

Ran Database repair tool. Result was database didn't require any changes.


texts: magento2: Category and product page not working properly - Luma Child

texts:
I've created a child theme of the Luma theme with basic theme files. I've default.xml files on the theme layout and web folder (for js and CSS).
All pages are working fine but when I started adding the product, categories and product pages are not working. Category page layout are showing like the attached screenshot.
Can anyone let me know the exact issue as I am new in Magento?


texts: How to get product's attributes and their value from product id in Magento 1.9 Soap Api v1

texts:
All i need is product total no of attributes and their value ...via passing product id(code is given below).

<?php
require_once('../app/Mage.php');
Mage::app();

$client     = new SoapClient('http://localhost/project/api/soap/?wsdl');

$user_name  = $_POST["user_name"];
$password   = $_POST["password"];
$prod_id    = $_POST["prod_id"];

$response   = array();

$session    = $client->login($user_name, $password);
//$product    = $client->call($session,"catalog_product.info" ,$prod_id);
$listAttributes = $client->call($session,'product.listOfAdditionalAttributes',array('simple',$prod_id));

$response = array(
    "status" => "1",
    "message" => "suceess",
    "products" => $listAttributes
);

ob_start();
header('Content-type: application/json');
header('Pragma: public');
header('Cache-control: private');
header('Expires: -1');

echo json_encode($response);
exit;
?>


texts:
May I know how to do categories import in Magento 2?
I did not see the option in "System>Import" or in the "Products>Categories" section of the backend.

It is really puzzling the best Ecommerce CMS in the world such as magento does not even permit user to import categories.

I have 500+ categories but I don't want to type them one by one.

Please help :)


texts:
I am trying to add a new phtml template file (in my child theme) of a custom module (not mine).

Here is the block :

{{block class="Sm\FilterProducts\Block\FilterProducts" template="Sm_FilterProducts::default-grid-column-id16.phtml" title_module="New product"  product_source="news_products" product_limitation="8"}}

I changed the template to: Magento_Theme::mytemplate.phtml without success.

Edit for more information :

I have created a mytemplate.phtml in the folder app of my theme :

app/design/frontend/hexa/Ztheme/template/page/html/sm_template.phtml


texts: How can i increase default magento execution time in all format

texts:
I can't export my bulk products, both system->import/export->export and system->import/export->data flow-> , both process not working properly, but when i export db from my server and export my root folder of magento into my local pc, install root folder and import db sql in wamp, right after i get export my products. Actually in my store 30,000 products are there,

  my export working only not working bulk export


texts: How to get the list of all product attributes with their details

texts:
I want to retrieve the collection of all product attributes so that I can have all the details of an attribute.

Anyone who can help me please let me know.


texts: How to add pagination to custom collection in admin tab content

texts:
I have added a custom tab in customer admin view.

My tab class content is :

class Namespace_Modulename_Block_Adminhtml_Customer_Edit_Tab
extends Mage_Adminhtml_Block_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
    public function __construct()
    {
        $this->setTemplate('tab/tab.phtml');
    }
}

And in tab.phtml I have custom collection and want to add pagination.

How to add pagination for custom collection here?